Lightweight class handling index values.
adsk::Data::Stream objects contain a list of data elements. Each element has to be accessed by index. In the simplest case the index is an array index (of type IndexCount, whose typedef appears above) but there can be more complex cases as well, such as a pair of integers, or a string.
This is the base class used by the adsk::Data:Stream indexing system. It is configured to be as efficient as possible in the simple index case while allowing extension to arbitrary index types. The simple integer index value is contained within this class. More complex index types are stored in a letter class of type "IndexType".
It can be used as the basis of a mapping from a general index type onto an adsk::Data::Index value, used for data referencing. Its purpose is to overload the concept of a general std::map<Index, Index> so that in the simple case where Index is the same as Index no mapping is required. The calling classes are responsible for creating that relationship, the methods in this class are defined to support that use.
Public Types |
|
typedef Index(* | IndexCreator )(const std::string &) |
| | False if using fIndex and simple IndexCount index types, otherwise use fComplexIndex.
|
Public Member Functions |
| | Index (IndexCount value) |
| | Conversion constructor.
|
| | Index (const Index &rhs) |
| | Copy constructor, simplest level.
|
| | Index (const IndexType &rhs) |
| | Conversion constructor.
|
| | Index (const std::string &indexValue) |
| | Constructor based on an index value in a string.
|
|
| ~Index () |
| | Default destructor, release the ComplexIndex if there is one.
|
| Index & | operator= (IndexCount rhs) |
| | IndexCount assignment operator.
|
| Index & | operator= (const Index &rhs) |
| | Class assignment operator.
|
|
| operator IndexCount () const |
| | IndexCount cast operator.
|
| IndexCount | index () const |
| | IndexCount extraction.
|
|
| operator IndexType * () |
| | IndexType* cast operator.
|
| std::string | asString () const |
| | Get the Index in string form.
|
| IndexType * | complexIndex () |
| | Quick access to the complex index, if it's used.
|
| bool | supportsDenseMode () const |
| | Notifies users that this index type can be packed densely.
|
| IndexCount | denseSpaceBetween (const Index &rhs) const |
| | Calculate the dense space occupied between two indices.
|
| bool | operator== (const Index &rhs) const |
| | Equality operator, checks if this Index is the same as another.
|
| bool | operator!= (const Index &rhs) const |
| | Inequality operator, checks if this Index is not the same as another.
|
| bool | operator< (const Index &rhs) const |
| | Less-than operator, checks if this Index is less than another Put simple index types before complex ones.
|
| bool | operator<= (const Index &rhs) const |
| | Less-or-equal operator, checks if this Index is <= another Put simple index types before complex ones.
|
| bool | operator> (const Index &rhs) const |
| | Greater-than operator, checks if this Index is greater than another Put simple index types before complex ones.
|
| bool | operator>= (const Index &rhs) const |
| | Greater-or-equal operator, checks if this Index is >= another Put simple index types before complex ones.
|
| std::string | typeName () const |
| | Get the type name of this object.
|
Static Public Member Functions |
| static bool | Debug (const Index *me, Debug::Print &request) |
| | Answer a Print request for an Index object.
|
| static bool | Debug (const Index *me, Debug::Footprint &request) |
| | Answer a footprint request for an Index object.
|
| static Index | doCreate (const std::string &, const std::string &) |
| | Create an Index of a given type from a string description of the value.
|
| static IndexCreator | creator (const std::string &) |
| | Get a function for construction of a given index type.
|
| static std::string | theTypeName () |
| | Get the type name of the simple index type.
|