SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
IDs assigned in random order by an array held on a component. More...
#include <IndirectAssignedIds.h>
Classes | |
struct | Iterator |
An iterator for array-indexed IDs. More... | |
Public Types | |
using | AssignedIdCtor = std::function< std::shared_ptr< AssignedIds >(const std::shared_ptr< IdSpace > &, IdNature, IdType, IdType)> |
enum | Forwardness |
The access-level of iteration (constant or mutable), used as a template parameter. More... | |
Public Types inherited from smtk::markup::AssignedIds | |
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 | |
smtkTypeMacro (smtk::markup::IndirectAssignedIds) | |
smtkSuperclassMacro (smtk::markup::AssignedIds) | |
template<typename... Args> | |
IndirectAssignedIds (const std::shared_ptr< IdSpace > &space, IdNature nature, IdType begin, IdType end, Component *owningNode, Args &&...) | |
AssignedIdCtor | cloneFunctor () const override |
Provide a constructor functor to be passed to IdSpace::requestRange(). | |
void | setIdArray (vtkSmartPointer< vtkIdTypeArray > idArray) |
Set/get the array of IDs used in the order they are indexed by the component. | |
vtkSmartPointer< vtkIdTypeArray > | idArray () const |
IdType | size () const |
Return the number of allotted IDs. More... | |
IdType | maxId () const |
Return the number of alloted IDs less one (as a convenience for iteration). | |
bool | empty () const |
Return true when no IDs are assigned. | |
Iterator< Forward > | begin () const |
Return an iterator pointing to the first assigned ID. | |
Iterator< Forward > | end () const |
Return an iterator just past the end of the last assigned ID. | |
Iterator< Reverse > | rbegin () const |
Return an iterator pointing to the last assigned ID. | |
Iterator< Reverse > | rend () const |
Return an iterator just before the beginning of the first assigned ID. | |
IdType | contains (IdType begin, IdType end) const |
Return the number of allotted ids in the half-open interval [begin, end[. More... | |
template<typename Functor > | |
smtk::common::Visited | visit (Functor visitor) const |
Call visitor on each alloted ID. | |
vtkIdType | firstIndexFor (IdType value) const |
Public Member Functions inherited from smtk::markup::AssignedIds | |
smtkTypeMacroBase (smtk::markup::AssignedIds) | |
template<typename... Args> | |
AssignedIds (const std::shared_ptr< IdSpace > &space, IdNature nature, IdType begin, IdType end, Component *owningNode, Args &&...) | |
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::IdSpace > | space () const |
bool | setNature (const IdNature &nature) |
const IdNature & | nature () const |
IdNature & | nature () |
Component * | node () const |
template<typename NodeType > | |
NodeType * | nodeAs () const |
Protected Attributes | |
vtkSmartPointer< vtkIdTypeArray > | m_idArray |
std::multimap< IdType, vtkIdType > | m_idToIndex |
Protected Attributes inherited from smtk::markup::AssignedIds | |
std::weak_ptr< smtk::markup::IdSpace > | m_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). | |
Component * | m_node |
The graph node which owns the assignment (if any). | |
Additional Inherited Members | |
Public Attributes inherited from smtk::markup::AssignedIds | |
IdType | begin |
IdType | end |
IdNature | nature |
IDs assigned in random order by an array held on a component.
Because the order of IDs in the component is not consecutive, this class assumes there is an array (of the proper size for the component) holding IDs as they appear. There may be unused IDs within the range, however no IDs outside the range() of the assignment may appear.
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).
Return the number of allotted ids in the half-open interval [begin, end[.
Note that this does not count repeated ids more than once. For instance, if the underlying array holds 1, 3, 3, 5, 7, then contains(1, 4) == 2 (and contains(1, 5) == 2 as well since end is not included in the count).
IdType smtk::markup::IndirectAssignedIds::size | ( | ) | const |