|
HDK
|
#include <UN_SubnetData.h>
Inheritance diagram for UN_SubnetData:Classes | |
| class | IDIterator |
| Iterator for traversing valid subnet IDs. More... | |
| class | OrderedIDIterator |
| Iterator for traversing valid subnet IDs in an ascending order. More... | |
Public Types | |
| using | IDRange = UT_IteratorRange< IDIterator > |
| Returns a range for iterating valid subnet IDs. More... | |
| using | OrderedIDRange = UT_IteratorRange< OrderedIDIterator > |
| Returns a range for iterating valid subnet IDs. More... | |
Public Types inherited from UN_Data | |
| using | IDRange = UN_DataIndexMap::IDRange |
| Returns a range for iterating valid IDs. More... | |
| using | OrderedIDRange = UN_DataIndexMap::OrderedIDRange |
| Returns a range for iterating valid IDs in an ascending order. More... | |
Public Member Functions | |
| UN_SubnetData (UN_CustomSubnetDataPtr custom_data=UN_CustomSubnetDataPtr()) | |
| Constructors and destructors. More... | |
| ~UN_SubnetData ()=default | |
| UN_SubnetData (UN_SubnetData &&) | |
| UN_SubnetData & | operator= (UN_SubnetData &&) |
| void | setCapacityIfNeeded (UN_DataSize min_capacity) |
| UN_SubnetIDRemap | merge (const UN_SubnetData &src_subnet_data) |
| UN_SubnetID | addSubnet () |
| UN_SubnetID | findOrAddRootSubnet () |
| Adds a root subnet or returns one if it already exists. More... | |
| void | clearSubnet (UN_SubnetID subnet_id) |
| Clears the data for the given subnet to the default state. More... | |
| bool | removeSubnet (UN_SubnetID subnet_id) |
| void | removeAllSubnets (bool reset_next_id) |
| bool | isValid (UN_SubnetID subnet_id) const |
| IDRange | idRange () const |
| OrderedIDRange | orderedIDRange () const |
| UN_SubnetIDList | subnetIDs () const |
| Returns a list of all the valid subnet IDs in the graph. More... | |
| UN_SubnetIDList | sortedSubnetIDs () const |
| Returns a list of all the valid subnet IDs in the graph. More... | |
| UN_CustomSubnetData * | customSubnetData () |
| Returns subnet's custom data container, if one was provided to c-tor. More... | |
| const UN_CustomSubnetData * | customSubnetData () const |
| Returns subnet's custom data container, if one was provided to c-tor. More... | |
Public Member Functions inherited from UN_Data | |
| UN_Data (UN_CustomDataPtr custom_data=UN_CustomDataPtr()) | |
| Constructors and destructors. More... | |
| ~UN_Data ()=default | |
| UN_Data (UN_Data &&) | |
| Move operators. More... | |
| UN_Data & | operator= (UN_Data &&) |
| IDRange | idRange () const |
| OrderedIDRange | orderedIDRange () const |
| UN_DataIDList | dataIDs () const |
| Returns a list of all the valid IDs in this container. More... | |
| UN_DataIDList | sortedDataIDs () const |
| Returns a sorted list of all the valid IDs in this container. More... | |
| UN_DataSize | size () const |
| Returns the number of valid data items in the buffer. More... | |
| UN_DataSize | indexSize () const |
| UN_DataSize | idSize () const |
| template<typename D > | |
| UN_GenericBufferID | addGenericBuffer (const UT_StringRef &name, UN_GenericBufferType type, const D &default_value) |
| UN_GenericBufferType | genericBufferType (UN_GenericBufferID id) const |
| Returns the type of the generic buffer identified by the given ID. More... | |
| UN_GenericBufferID | findGenericBuffer (const UT_StringRef &name) const |
| const UT_StringHolder & | genericBufferName (UN_GenericBufferID id) const |
| Returns the name of the generic buffer identified by the given ID. More... | |
| UN_CustomData * | customData () |
| Returns the custom data container, if one was provided. More... | |
| const UN_CustomData * | customData () const |
| Returns the custom data container, if one was provided. More... | |
Protected Member Functions | |
| UN_SubnetData (const UN_SubnetData &)=default | |
| UN_SubnetData & | operator= (const UN_SubnetData &)=default |
| UN_SubnetIndex | subnetIndex (UN_SubnetID id) const |
| Returns the subnet data index into the data buffer arrays. More... | |
Protected Member Functions inherited from UN_Data | |
| UN_Data (const UN_Data &) | |
| UN_Data & | operator= (const UN_Data &) |
| UN_DataMergeInfo | mergeData (const UN_Data &src_data, bool combine_id_zero=false) |
| std::pair< UN_DataID, UN_DataIndex > | addData () |
| std::pair< UN_DataID, UN_DataIndex > | findOrAddData (UN_DataID data_id) |
| bool | removeData (UN_DataID data_id) |
| void | removeAllData (bool reset_next_id) |
| bool | isValid (UN_DataID data_id) const |
| UN_DataIndex | dataIndex (UN_DataID id) const |
| UN_DataSize | dataBufferSize () const |
| UN_DataSize | freeDataBufferSize () const |
| UN_DataSize | usedDataBufferSize () const |
| template<typename V , typename B > | |
| void | setData (B &buffer, UN_DataID id, const V &value) |
| Helper method to copy-assign the value to an entry in the data buffer. More... | |
| template<typename V , typename B > | |
| void | setData (B &buffer, UN_DataID id, V &&value) |
| Helper method to move-assign the value to an entry in the data buffer. More... | |
| template<typename V , typename B > | |
| const V & | getDataRef (const B &buffer, UN_DataID id, const V &default_value) const |
| Helper method to return a const ref to an entry in the data buffer. More... | |
| template<typename V , typename B > | |
| V | getDataVal (const B &buffer, UN_DataID id, const V &default_value) const |
| template<typename V , typename B > | |
| V | stealData (B &buffer, UN_DataID id, const V &default_value) |
| Helper method to return a value moved from an entry in the data buffer. More... | |
| template<typename OP , typename B > | |
| void | updateData (B &buffer, UN_DataID id, const OP &op) |
| template<typename T > | |
| void | setGenericData (UN_GenericBufferID buf_id, UN_DataID id, const T &value) |
| Sets the data value in a generic buffer for a given data ID. More... | |
| template<typename T > | |
| void | setGenericData (UN_GenericBufferID buf_id, UN_DataID id, T &&value) |
| Sets the data value in a generic buffer via move. More... | |
| template<typename T > | |
| const T & | genericDataRef (UN_GenericBufferID buf_id, UN_DataID id) const |
| Returns a const ref to the data value in a generic buffer. More... | |
| template<typename T > | |
| T | genericDataVal (UN_GenericBufferID buf_id, UN_DataID id) const |
| template<typename T > | |
| T | stealGenericData (UN_GenericBufferID buf_id, UN_DataID id) |
| Moves the data value out of a generic buffer. More... | |
| template<typename T , typename OP > | |
| void | updateGenericData (UN_GenericBufferID buf_id, UN_DataID id, const OP &op) |
| Updates the data value in a generic buffer in-place via a callable. More... | |
| void | addGenericData (UN_DataIndex index) |
| Adds a data slot at the given index to all generic buffers. More... | |
| void | clearGenericData (UN_DataIndex index) |
| Clears the generic data at the given index to defaults. More... | |
| void | removeAllGenericData () |
| Removes all data from all generic buffers. More... | |
| void | setGenericDataCapacityIfNeeded (UN_DataSize min_capacity) |
| Grows all generic buffers to the given minimum capacity. More... | |
| void | mergeGenericData (const UN_Data &src, const UN_DataMergeInfo &merge_info) |
| Merges generic data from another UN_Data container. More... | |
| bool | isGenericDataSizeConsistent (UN_DataSize expected_size) const |
| Returns true if all generic buffers have the expected size. More... | |
Protected Attributes | |
| friend | UN_GraphData |
Container of data for all the subnetworks in the graph.
NOTE: This class is generally not trivially relocatable, because its base class (UN_Data) is not trivially relocatable (see comment there).
Definition at line 30 of file UN_SubnetData.h.
| using UN_SubnetData::IDRange = UT_IteratorRange< IDIterator > |
Returns a range for iterating valid subnet IDs.
Definition at line 129 of file UN_SubnetData.h.
Returns a range for iterating valid subnet IDs.
Definition at line 137 of file UN_SubnetData.h.
| UN_SubnetData::UN_SubnetData | ( | UN_CustomSubnetDataPtr | custom_data = UN_CustomSubnetDataPtr() | ) |
Constructors and destructors.
|
default |
| UN_SubnetData::UN_SubnetData | ( | UN_SubnetData && | ) |
|
protecteddefault |
| UN_SubnetID UN_SubnetData::addSubnet | ( | ) |
Adds a slot for a new subnet in this container. Returns an ID that should be used to refer to this new subnet for accessing its data (eg, children, etc).
| void UN_SubnetData::clearSubnet | ( | UN_SubnetID | subnet_id | ) |
Clears the data for the given subnet to the default state.
|
inline |
Returns subnet's custom data container, if one was provided to c-tor.
Definition at line 56 of file UN_SubnetData.h.
|
inline |
Returns subnet's custom data container, if one was provided to c-tor.
Definition at line 61 of file UN_SubnetData.h.
| UN_SubnetID UN_SubnetData::findOrAddRootSubnet | ( | ) |
Adds a root subnet or returns one if it already exists.
|
inline |
Definition at line 130 of file UN_SubnetData.h.
|
inline |
Returns true if the given ID refers to a valid subnet entry in the data buffers. Ie, such a subnet exists and is valid.
Definition at line 95 of file UN_SubnetData.h.
| UN_SubnetIDRemap UN_SubnetData::merge | ( | const UN_SubnetData & | src_subnet_data | ) |
Merges another subnet data into this one. Returns a mapping between the data IDs in the merge source and destination (this) data buffers.
| UN_SubnetData& UN_SubnetData::operator= | ( | UN_SubnetData && | ) |
|
protecteddefault |
|
inline |
Definition at line 138 of file UN_SubnetData.h.
| void UN_SubnetData::removeAllSubnets | ( | bool | reset_next_id | ) |
Frees the data slots occupied by all the subnets.
| 'reset_next_id' | If true, the node ID generator is reset to zero. |
| bool UN_SubnetData::removeSubnet | ( | UN_SubnetID | subnet_id | ) |
Removes the subnet from this container and frees the data slot it occupied. After calling this method, the container will have no knowledge of the node by this ID. Returns true on successs; false if the node was not found.
| void UN_SubnetData::setCapacityIfNeeded | ( | UN_DataSize | min_capacity | ) |
Increases the capacity of the data buffer arrays to the given minimum, unless the capacity is already greater or equal to that minimum, in which case the capacity remains unchanged.
|
inline |
Returns a list of all the valid subnet IDs in the graph.
Definition at line 152 of file UN_SubnetData.h.
|
inline |
Returns a list of all the valid subnet IDs in the graph.
Definition at line 145 of file UN_SubnetData.h.
|
inlineprotected |
Returns the subnet data index into the data buffer arrays.
Definition at line 161 of file UN_SubnetData.h.
|
protected |
This container can have large data, so generally, forbid the costly copy operations to the public. Knowledgable friends and derived classes can still use them.
Definition at line 45 of file UN_SubnetData.h.