12 #ifndef __UN_SubnetData_h__
13 #define __UN_SubnetData_h__
53 void setCapacityIfNeeded(
UN_DataSize min_capacity );
75 UN_SubnetID addSubnet();
78 UN_SubnetID findOrAddRootSubnet();
81 void clearSubnet( UN_SubnetID subnet_id );
87 bool removeSubnet( UN_SubnetID subnet_id );
91 void removeAllSubnets(
bool reset_next_id );
95 bool isValid( UN_SubnetID subnet_id )
const
110 {
return UN_SubnetID( UN_DataIndexMap::IDIterator::operator*() ); }
124 {
return UN_SubnetID(UN_DataIndexMap::OrderedIDIterator::operator*()); }
133 return IDRange( id_range.begin(), id_range.end() );
148 return reinterpret_cast<UN_SubnetIDList&&
>( std::move(
dataIDs() ));
155 return reinterpret_cast<UN_SubnetIDList&&
>(std::move(
sortedDataIDs()));
163 return UN_SubnetIndex(
182 UN_SubnetID addSubnetData(UN_SubnetID subnet_id,
183 UN_SubnetIndex subnet_index );
191 void addCoreData( UN_SubnetIndex subnet_index );
194 void clearCoreData( UN_SubnetIndex subnet_index );
198 void removeCoreData()
203 void removeAllCoreData();
206 void setCoreDataCapacityIfNeeded(
210 bool isCoreDataSizeConsistent()
const;
213 bool isDataSizeConsistent()
const;
value_type operator*() const
#define SYS_STATIC_ASSERT(expr)
value_type operator*() const
UN_SubnetIDList subnetIDs() const
Returns a list of all the valid subnet IDs in the graph.
OrderedIDRange orderedIDRange() const
Iterator for traversing valid subnet IDs in an ascending order.
bool isValid(UN_DataID data_id) const
UN_SubnetIDList sortedSubnetIDs() const
Returns a list of all the valid subnet IDs in the graph.
SYS_FORCE_INLINE TO_T UTverify_cast(FROM_T from)
Iterator for traversing valid data IDs in the map.
UN_Data & operator=(UN_Data &&)
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
UN_DataIndex dataIndex(UN_DataID id) const
UT_UniquePtr< UN_CustomSubnetData > UN_CustomSubnetDataPtr
Iterator for traversing valid subnet IDs.
UN_CustomSubnetData * customSubnetData()
Returns subnet's custom data container, if one was provided to c-tor.
UN_CustomData * customData()
Returns the custom data container, if one was provided.
UN_DataIDList dataIDs() const
Returns a list of all the valid IDs in this container.
UN_DataIndexMap::IDRange IDRange
Returns a range for iterating valid IDs.
Maintains a mapping from data ID to data index in the data buffer.
Iterator for traversing valid data IDs in the map in an ordered fashion.
IDIterator(const UN_DataIndexMap::IDIterator &id_iterator)
bool isValid(UN_SubnetID subnet_id) const
const UN_CustomSubnetData * customSubnetData() const
Returns subnet's custom data container, if one was provided to c-tor.
UN_SubnetIndex subnetIndex(UN_SubnetID id) const
Returns the subnet data index into the data buffer arrays.
UN_DataIDList sortedDataIDs() const
Returns a sorted list of all the valid IDs in this container.
OrderedIDIterator(const UN_DataIndexMap::OrderedIDIterator &id_iterator)
UN_DataIndexMap::OrderedIDRange OrderedIDRange
Returns a range for iterating valid IDs in an ascending order.
OrderedIDRange orderedIDRange() const