SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Public Types | Public Member Functions | Public Attributes | Protected Attributes | List of all members
smtk::markup::AssignedIds Class Reference

An API for querying the IDs allotted to a component in an IdSpace. More...

#include <AssignedIds.h>

Inheritance diagram for smtk::markup::AssignedIds:
[legend]
Collaboration diagram for smtk::markup::AssignedIds:
[legend]

Public Types

enum  Forwardness { Forward, Reverse }
 The access-level of iteration (constant or mutable), used as a template parameter. More...
 
using IdType = smtk::markup::IdType
 
using IdIterator = struct { smtk::markup::IdSpace *idSpace
 
using IdRange = std::array< IdType, 2 >
 
using AssignedIdCtor = std::function< std::shared_ptr< AssignedIds >(const std::shared_ptr< IdSpace > &, IdNature, IdType, IdType)>
 

Public Member Functions

 smtkTypeMacroBase (smtk::markup::AssignedIds)
 
template<typename... Args>
 AssignedIds (const std::shared_ptr< IdSpace > &space, IdNature nature, IdType begin, IdType end, Component *owningNode, Args &&...)
 
virtual AssignedIdCtor cloneFunctor () const
 Subclasses must override this method to return a functor producing an instance of themselves.
 
IdRange range () const
 Returns the range of IDs in the allotment.
 
IdType size () const
 Return the number of allotted IDs. More...
 
bool empty () const
 Return true when no IDs are assigned.
 
std::shared_ptr< smtk::markup::IdSpacespace () const
 
bool setNature (const IdNature &nature)
 
const IdNaturenature () const
 
IdNaturenature ()
 
Componentnode () const
 
template<typename NodeType >
NodeType * nodeAs () const
 

Public Attributes

IdType begin
 
IdType end
 
IdNature nature
 

Protected Attributes

std::weak_ptr< smtk::markup::IdSpacem_space
 The parent space from which our assigned IDs come.
 
IdRange m_range
 The overall range of the assignment (used to accelerate intersection tests).
 
IdNature m_nature
 The nature of the assignment (ownership or reference; exclusive or non-exclusive).
 
Componentm_node
 The graph node which owns the assignment (if any).
 

Detailed Description

An API for querying the IDs allotted to a component in an IdSpace.

Member Enumeration Documentation

◆ Forwardness

The access-level of iteration (constant or mutable), used as a template parameter.

The direction of iteration (used as a template parameter for subclass iterators).

Enumerator
Forward 

The iterator traverses IDs from lowest to highest.

Reverse 

The iterator traverses IDs from highest to lowest.

Member Function Documentation

◆ size()

IdType smtk::markup::AssignedIds::size ( ) const
inline

Return the number of allotted IDs.

This simply returns range()[1] - range()[0], since the range is a half-open interval.


The documentation for this class was generated from the following files: