Class handling a named association of a data array with other data.
This class is used in conjunction with adsk::Data::Associations. See the documentation for adsk::Data::Associations for the bigger picture in how the classes work together.
adsk::Data::Channel is responsible for maintaining a list of named data streams, where a "stream" can be thought of as equivalent to a named array of data.
The main reason for this class to exist is to allow attachment of multiple unrelated data streams. For instance a simulator can attach an arbitrary data structure to every vertex of a mesh (that's one stream) and a shader can attach a different color-based data structure to every vertex of a mesh (that's a different stream).
Having separate streams makes it easier to find and handle the stream of data in which a particular user is interested. Having this channel class manage the streams as a unit makes it easier for changes in the indexing to do the proper thing to the data in the streams all in one place (e.g. deleting one of the associated indexes will cause the matching indexed data in each of the streams to be deleted)
|
| ~Channel () |
| Default destructor, disowns the implementation object.
|
|
| Channel () |
| Default constructor, creates an implementation object.
|
|
| Channel (const std::string &) |
| Named constructor, creates an implementation object with a specific name. More...
|
|
| Channel (const Channel &) |
| Copy constructor, shares implementation with the rhs. More...
|
|
Channel & | operator= (const Channel &) |
| Assignment operator, shares implementation with the rhs. More...
|
|
bool | operator== (const Channel &) const |
| Comparison operator, checks if this channel is the same as another. More...
|
|
Stream * | setDataStream (const Stream &newStream) |
| Set a new named data stream. More...
|
|
const Stream * | findDataStream (const std::string &) const |
| Get the Stream with the given name, return NULL if it doesn't exist. More...
|
|
Stream * | findDataStream (const std::string &) |
| Get the Stream with the given name, return NULL if it doesn't exist. More...
|
|
bool | removeDataStream (const std::string &) |
| Destroy the data stream with the given name. More...
|
|
bool | renameDataStream (const std::string &, const std::string &) |
| Rename a Stream. More...
|
|
bool | makeUnique () |
| Make the channel data unique to this object. More...
|
|
const std::string & | name () const |
| Get the name of this Channel, const-version. More...
|
|
Channel::iterator | begin () const |
| Get an iterator pointed to the beginning of the Stream list. More...
|
|
Channel::iterator | end () const |
| Get an iterator off the end of the Stream list. More...
|
|
Channel::const_iterator | cbegin () const |
| Get a read-only iterator pointed to the beginning of the Stream list. More...
|
|
Channel::const_iterator | cend () const |
| Get a read-only iterator off the end of the Stream list. More...
|
|
unsigned int | size () const |
| Get the number of Streams on this Channel. More...
|
|
bool | empty () const |
| Check to see if the Stream list is empty. More...
|
|
bool | removeElement (const Index &elementIndex) |
| Remove a single element from this data channel. More...
|
|
bool | addElement (const Index &elementIndex) |
| Add a new data element to the channel. More...
|
|
unsigned int | dataStreamCount () const |
| Get the number of data streams in this channel. More...
|
|
Stream * | dataStream (unsigned int streamIndex) |
| Get the named data stream, either const or non-const. More...
|
|
Stream * | dataStream (const std::string &streamName) |
| Get the data stream of the given name. More...
|
|
Make the channel data unique to this object.
Makes a copy of the data if it's currently being shared, otherwise leaves it as-is. Note that it can still be shared afterwards by some other object, i.e. this is not a persistent state, just an operation to perform before making changes you don't want any other copies of the associations to share.
- Returns
- true if the data was duplicated in order to make it unique