- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends

# IndexPair Class Reference

Search for all occurrences

## Detailed Description

Index type which uses a pair of IndexCount values for the index mapping.

adsk::Data::Stream objects contain a list of data elements. Each element has to be accessed by Index. This is one of the more general index types, a pair of IndexCount values. An adsk::Data::IndexPair element is used to lookup the physical location of a data element, either directly in an array using the dense mode or indirectly through a mapping in the sparse, or mapping, mode.

`#include <adskDataIndexPair.h>`

Inheritance diagram for IndexPair:
[legend]

List of all members.

## Public Member Functions
| IndexPair (IndexCount firstValue, IndexCount secondValue)
| Conversion constructor.
| IndexPair (const IndexPair &rhs)
| Copy constructor, simplest level.
| IndexPair (const std::string &value)
| Construct an IndexPair from a string containing the two values.
virtual | ~IndexPair ()
| Default destructor, nothing to do.
IndexPair & | operator= (const IndexPair &rhs)
| Class assignment operator.
void | getIndexPair (IndexCount &first, IndexCount &second) const
| Get the two values comprising this index pair.
virtual std::string | asString () const
| Get the IndexPair in string form.
virtual bool | supportsDenseMode () const
| Notifies users that this index type can be packed densely.
virtual IndexCount | denseSpaceBetween (const IndexType &rhs) const
| Calculate the dense space occupied between two index pairs.
virtual bool | operator== (const IndexType &rhs) const
| Equality operator, checks if this IndexPair is the same as another Objects of different types are defined as not equal.
virtual bool | operator!= (const IndexType &rhs) const
| Inequality operator, checks if this IndexPair is not the same as another Objects of different types are defined as not equal.
virtual bool | operator< (const IndexType &rhs) const
| Less-than operator, checks if this IndexPair is less than another Operator sorts by typeid if the object passed in is not an IndexPair.
virtual bool | operator<= (const IndexType &rhs) const
| Less-or-equal operator, checks if this IndexPair is <= another Operator sorts by typeid if the object passed in is not an IndexPair.
virtual bool | operator> (const IndexType &rhs) const
| Greater-than operator, checks if this IndexPair is greater than another Operator sorts by typeid if the object passed in is not an IndexPair.
virtual bool | operator>= (const IndexType &rhs) const
| Greater-or-equal operator, checks if this IndexPair is >= another Operator sorts by typeid if the object passed in is not an IndexPair.
virtual bool | operator== (const IndexPair &rhs) const
| Equality operator, checks if this IndexPair is the same as another.
virtual bool | operator!= (const IndexPair &rhs) const
| Inequality operator, checks if this IndexPair is not the same as another.
virtual bool | operator< (const IndexPair &rhs) const
| Less-than operator, checks if this IndexPair is less than another.
virtual bool | operator<= (const IndexPair &rhs) const
| Less-or-equal operator, checks if this IndexPair is <= another.
virtual bool | operator> (const IndexPair &rhs) const
| Greater-than operator, checks if this IndexPair is greater than another.
virtual bool | operator>= (const IndexPair &rhs) const
| Greater-or-equal operator, checks if this IndexPair is >= another.
## Static Public Member Functions
static bool | Debug (const IndexPair *me, adsk::Debug::Print &request)
| Answer a Print request for the IndexPair type.
static bool | Debug (const IndexPair *me, adsk::Debug::Footprint &request)
| Answer a footprint request for the IndexPair type.
## Protected Member Functions
| IndexPair ()
| Default constructor, should never be used.
## Protected Attributes
IndexCount | fSecondIndex
| First index used for mapping.
## Static Protected Attributes Search for all occurrences
static std::string | myTypeName = "pair"
| Name used to identify this type. Search for all occurrences
static IndexRegistration | myRegistration
| Name used to identify this type.
## Friends Search for all occurrences
class | CRTP_IndexType< IndexPair >
| Second index used for mapping. Search for all occurrences

## Constructor & Destructor Documentation

IndexPair | ( | IndexCount | firstIndex,
|  | IndexCount | secondIndex
| ) |  |

Conversion constructor.

Parameters:

  [in] | firstIndex | One of the IndexCounts
  [in] | secondIndex | The other of the IndexCounts

IndexPair | ( | const IndexPair & | rhs | ) |

Copy constructor, simplest level.

Parameters:

  [in] | rhs | IndexPair data to be copied

IndexPair | ( | const std::string & | value | ) |

Construct an IndexPair from a string containing the two values.

Parameters:

  [in] | value | String with format "### ###" containing the two index values

Exceptions:

  Index::kBadSyntax | Non-numeric values, or less than 2 numbers
  Index::kExcessData | More than 2 numbers in the string

## Member Function Documentation

IndexPair & operator= | ( | const IndexPair & | rhs | ) |

Class assignment operator.

Parameters:

  [in] | rhs | IndexPair data to be copied

void getIndexPair | ( | IndexCount & | first,
|  | IndexCount & | second
| ) |  | const

Search for all occurrences

Get the two values comprising this index pair.

Parameters:

  [out] | first | First index value of the pair
  [out] | second | Second index value of the pair

std::string asString | ( |  | ) | const`[virtual]`

Search for all occurrences

Get the IndexPair in string form.

Returns:
  String representing the index value (in the same form expected by the creator functions)

Implements IndexType.

bool supportsDenseMode | ( |  | ) | const`[virtual]`

Search for all occurrences

Notifies users that this index type can be packed densely.

Returns:
  true, indicating that this index type can be used in dense mode

Implements IndexType.

IndexCount denseSpaceBetween | ( | const IndexType & | rhs | ) | const`[virtual]`

Search for all occurrences

Calculate the dense space occupied between two index pairs.

An index pair can be thought of as a matrix so the space occupied by densely packing that matrix [a,b] - [c,d] equals the integral area of a subsection of the infinite matrix at those coordinates

b d +-------------------------+ | | a| XXXXXXXXXXXXXX | | XXXXXXXXXXXXXX | | XXXXXXXXXXXXXX | | XXXXXXXXXXXXXX | | XXXXXXXXXXXXXX | c| XXXXXXXXXXXXXX | | | +-------------------------+

Parameters:

  [in] | rhs | The other object from whom packing space is to be calculated

Returns:
  Size of that sub-matrix occupied between the pairs, including the rows and columns occupied by the endpoints. Returns 0 if the dense packing cannot be supported.

Implements IndexType.

bool operator== | ( | const IndexType & | rhs | ) | const`[virtual]`

Equality operator, checks if this IndexPair is the same as another Objects of different types are defined as not equal.

Parameters:

  [in] | rhs | IndexPair to be compared

Returns:
  true if the two IndexPair objects have the same underlying IndexCounts

Implements IndexType.

bool operator!= | ( | const IndexType & | rhs | ) | const`[virtual]`

Inequality operator, checks if this IndexPair is not the same as another Objects of different types are defined as not equal.

Parameters:

  [in] | rhs | IndexPair to be compared

Returns:
  true if the two IndexPair objects have a different underlying IndexCount

Implements IndexType.

bool operator< | ( | const IndexType & | rhs | ) | const`[virtual]`

Less-than operator, checks if this IndexPair is less than another Operator sorts by typeid if the object passed in is not an IndexPair.

Parameters:

  [in] | rhs | IndexPair to be compared

Returns:
  true if this IndexPair's counter is less than rhs's

Implements IndexType.

bool operator<= | ( | const IndexType & | rhs | ) | const`[virtual]`

Less-or-equal operator, checks if this IndexPair is <= another Operator sorts by typeid if the object passed in is not an IndexPair.

Parameters:

  [in] | rhs | IndexPair to be compared

Returns:
  true if this IndexPair's counter is less than or equal to rhs's

Implements IndexType.

bool operator> | ( | const IndexType & | rhs | ) | const`[virtual]`

Greater-than operator, checks if this IndexPair is greater than another Operator sorts by typeid if the object passed in is not an IndexPair.

Parameters:

  [in] | rhs | IndexPair to be compared

Returns:
  true if this IndexPair's counter is greater than rhs's

Implements IndexType.

bool operator>= | ( | const IndexType & | rhs | ) | const`[virtual]`

Greater-or-equal operator, checks if this IndexPair is >= another Operator sorts by typeid if the object passed in is not an IndexPair.

Parameters:

  [in] | rhs | IndexPair to be compared

Returns:
  true if this IndexPair's counter is greater than or equal to rhs's

Implements IndexType.

bool operator== | ( | const IndexPair & | rhs | ) | const`[virtual]`

Equality operator, checks if this IndexPair is the same as another.

Parameters:

  [in] | rhs | IndexPair to be compared

Returns:
  true if the two IndexPair objects have the same underlying IndexCounts

bool operator!= | ( | const IndexPair & | rhs | ) | const`[virtual]`

Inequality operator, checks if this IndexPair is not the same as another.

Parameters:

  [in] | rhs | IndexPair to be compared

Returns:
  true if the two IndexPair objects have different underlying IndexCounts

bool operator< | ( | const IndexPair & | rhs | ) | const`[virtual]`

Less-than operator, checks if this IndexPair is less than another.

Parameters:

  [in] | rhs | IndexPair to be compared

Returns:
  true if this IndexPair is less than rhs's

bool operator<= | ( | const IndexPair & | rhs | ) | const`[virtual]`

Less-or-equal operator, checks if this IndexPair is <= another.

Parameters:

  [in] | rhs | IndexPair to be compared

Returns:
  true if this IndexPair is less than or equal to rhs's

bool operator> | ( | const IndexPair & | rhs | ) | const`[virtual]`

Greater-than operator, checks if this IndexPair is greater than another.

Parameters:

  [in] | rhs | IndexPair to be compared

Returns:
  true if this IndexPair is greater than rhs's

bool operator>= | ( | const IndexPair & | rhs | ) | const`[virtual]`

Greater-or-equal operator, checks if this IndexPair is >= another.

Parameters:

  [in] | rhs | IndexPair to be compared

Returns:
  true if this IndexPair is greater than or equal to rhs's

bool Debug | ( | const IndexPair * | me,
|  | adsk::Debug::Print & | request
| ) |  | `[static]`

Search for all occurrences

Answer a Print request for the IndexPair type.

Use the request object to dump all information on the "me" IndexPair, or all static IndexPair information if "me" is NULL.

Parameters:

  [in] | me | Pointer to object to debug, NULL means class static
  [out] | request | Print request object

Returns:
  True if the request was successfully processed.

bool Debug | ( | const IndexPair * | me,
|  | adsk::Debug::Footprint & | request
| ) |  | `[static]`

Search for all occurrences

Answer a footprint request for the IndexPair type.

Populate the Footprint request with the information on all data stored within this class if "me" is NULL, otherwise the information stored in the IndexPair object pointed at by "me".

Parameters:

  [in] | me | Pointer to object to footprint, NULL means class static
  [out] | request | Footprint object to populate

Returns:
  True if the request was successfully processed. The Footprint object will have all information added to it.

IndexPair IndexPair IndexPair IndexPair IndexPair IndexPair IndexPair IndexPair IndexPair IndexPair
IndexPair IndexPair IndexPair IndexPair IndexPair IndexPair IndexPair IndexPair IndexPair IndexPair