12 #ifndef __UN_WireData_h__
13 #define __UN_WireData_h__
52 void setCapacityIfNeeded(
UN_DataSize min_capacity );
77 void clearWire(UN_WireID wire_id );
83 bool removeWire( UN_WireID wire_id );
87 void removeAllWires(
bool reset_next_id );
106 {
return UN_WireID( UN_DataIndexMap::IDIterator::operator*() ); }
120 {
return UN_WireID( UN_DataIndexMap::OrderedIDIterator::operator*() ); }
129 return IDRange( id_range.begin(), id_range.end() );
144 return reinterpret_cast<UN_WireIDList&&
>( std::move(
dataIDs() ));
151 return reinterpret_cast<UN_WireIDList&&
>( std::move(
sortedDataIDs() ));
171 UN_WireID wire_id )
const
172 {
return UN_Data::genericDataRef<T>( buf_id, wire_id ); }
177 {
return UN_Data::genericDataVal<T>( buf_id, wire_id ); }
183 {
return UN_Data::stealGenericData<T>( buf_id, wire_id ); }
186 template<
typename T,
typename OP>
189 { UN_Data::updateGenericData<T>( buf_id, wire_id,
op ); }
216 void addCoreData( UN_WireIndex wire_index );
219 void clearCoreData( UN_WireIndex wire_index );
223 void removeCoreData()
228 void removeAllCoreData();
231 void setCoreDataCapacityIfNeeded(
235 bool isCoreDataSizeConsistent()
const;
238 bool isDataSizeConsistent()
const;
#define SYS_STATIC_ASSERT(expr)
void setGenericData(UN_GenericBufferID buf_id, UN_WireID wire_id, const T &value)
Sets the data value in a generic buffer for a given wire.
void setGenericData(UN_GenericBufferID buf_id, UN_WireID wire_id, T &&value)
Sets the data value in a generic buffer via move.
const T & genericDataRef(UN_GenericBufferID buf_id, UN_WireID wire_id) const
Returns a const ref to the data value in a generic buffer.
GLsizei const GLfloat * value
Iterator for traversing valid wire IDs in an ascending order.
bool isValid(UN_DataID data_id) const
T stealGenericData(UN_GenericBufferID buf_id, UN_WireID wire_id)
Moves the data value out of a generic buffer.
SYS_FORCE_INLINE TO_T UTverify_cast(FROM_T from)
Iterator for traversing valid data IDs in the map.
UN_Data & operator=(UN_Data &&)
Iterator for traversing valid wire IDs.
IDIterator(const UN_DataIndexMap::IDIterator &id_iterator)
UN_WireIDList sortedWireIDs() const
Returns a list of all the valid wire IDs in the graph.
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
OrderedIDRange orderedIDRange() const
UN_DataIndex dataIndex(UN_DataID id) const
UN_DataSize dataBufferSize() const
void updateGenericData(UN_GenericBufferID buf_id, UN_WireID wire_id, const OP &op)
Updates the data value in a generic buffer in-place via a callable.
UN_CustomData * customData()
Returns the custom data container, if one was provided.
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.
UN_CustomWireData * customWireData()
Returns wire's custom data container, if one was provided to c-tor.
value_type operator*() const
const UN_CustomWireData * customWireData() const
Returns wire's custom data container, if one was provided to c-tor.
UT_UniquePtr< UN_CustomWireData > UN_CustomWireDataPtr
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.
bool isValid(UN_WireID wire_id) const
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.
OrderedIDIterator(const UN_DataIndexMap::OrderedIDIterator &id_iterator)
T genericDataVal(UN_GenericBufferID buf_id, UN_WireID wire_id) const
Returns a copy of a data value from a generic buffer.
UN_DataIDList sortedDataIDs() const
Returns a sorted list of all the valid IDs in this container.
UN_DataIndexMap::OrderedIDRange OrderedIDRange
Returns a range for iterating valid IDs in an ascending order.
value_type operator*() const
UN_WireIDList wireIDs() const
Returns a list of all the valid wire IDs in the graph.
OrderedIDRange orderedIDRange() const
UN_WireIndex wireIndex(UN_WireID id) const
Returns the wire's data index into the data buffer arrays.