RMF
|
A handle for a particular node in a read-only hierarchy. More...
#include <RMF/NodeConstHandle.h>
Public Member Functions | |
template<class T > | |
T | get_association () const |
Return the associated pointer for this node. More... | |
NodeConstHandles | get_children () const |
FileConstHandle | get_file () const |
bool | get_has_association () const |
NodeID | get_id () const |
std::string | get_name () const |
NodeType | get_type () const |
get the type of this node | |
operator NodeID () const | |
template<class T > | |
void | set_association (const T &v, bool overwrite=false) const |
Protected Member Functions | |
FrameID | get_current_frame_id () const |
std::string | get_file_name () const |
Protected Attributes | |
NodeID | node_ |
std::shared_ptr < internal::SharedData > | shared_ |
Functions to access attributes | |
template<class Tag > | |
Nullable< typename Tag::Type > | get_value (ID< Tag > k) const |
template<class Tag > | |
bool | get_has_value (ID< Tag > k) const |
template<class Tag > | |
Nullable< typename Tag::Type > | get_frame_value (ID< Tag > k) const |
template<class Tag > | |
Nullable< typename Tag::Type > | get_static_value (ID< Tag > k) const |
Use these handles to access parts of the hierarchy.
The get_value_always() methods return the appropriate value or TypeTraits::get_null_value() if the node does not have that attribute.
See the NodeHandle for modifying the contents.
Definition at line 81 of file NodeConstHandle.h.
T RMF::NodeConstHandle::get_association | ( | ) | const |
An exception will be thrown if it doesn't have one.
Definition at line 194 of file NodeConstHandle.h.
NodeID RMF::NodeConstHandle::get_id | ( | ) | const |
Get the NodeID for this handle.
Definition at line 135 of file NodeConstHandle.h.
std::string RMF::NodeConstHandle::get_name | ( | ) | const |
The name of the node is not necessarily unique.
Definition at line 141 of file NodeConstHandle.h.
void RMF::NodeConstHandle::set_association | ( | const T & | v, |
bool | overwrite = false |
||
) | const |
Each node can be associated at runtime with an arbitrary piece of data to aid in maintaining the relationship with application data structures. This data type must be convertible to a void* pointer. If direct casting does not work, you can implement a function called get_void_pointer()
that takes the passed type and returns a void*
pointer in the namespace where the type is declared (so it is found via Koenig lookup). Support has already been added for std::shared_ptr.
Either the association must not have been set before or overwrite must be true. If overwrite is true, the type must be the same as the old type.
Definition at line 185 of file NodeConstHandle.h.