RMF
RMF::NodeConstHandle Class Reference

A handle for a particular node in a read-only hierarchy. More...

#include <RMF/NodeConstHandle.h>

Inheritance diagram for RMF::NodeConstHandle:

Public Member Functions

template<class T>
T get_association () const
 Return the associated pointer for this node.
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

Detailed Description

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.

Examples
benchmark/benchmark_rmf.cpp.

Definition at line 81 of file NodeConstHandle.h.

Constructor & Destructor Documentation

◆ NodeConstHandle()

RMF::NodeConstHandle::NodeConstHandle ( )

Definition at line 138 of file NodeConstHandle.h.

Member Function Documentation

◆ get_association()

template<class T>
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.

◆ get_frame_value()

template<class Tag>
Nullable< typename Tag::Type > RMF::NodeConstHandle::get_frame_value ( ID< Tag > k) const

Definition at line 157 of file NodeConstHandle.h.

◆ get_has_association()

bool RMF::NodeConstHandle::get_has_association ( ) const

Definition at line 198 of file NodeConstHandle.h.

◆ get_has_value()

template<class Tag>
bool RMF::NodeConstHandle::get_has_value ( ID< Tag > k) const

Definition at line 153 of file NodeConstHandle.h.

◆ get_id()

NodeID RMF::NodeConstHandle::get_id ( ) const

Get the NodeID for this handle.

Definition at line 135 of file NodeConstHandle.h.

◆ get_name()

std::string RMF::NodeConstHandle::get_name ( ) const

The name of the node is not necessarily unique.

Definition at line 141 of file NodeConstHandle.h.

◆ get_static_value()

template<class Tag>
Nullable< typename Tag::Type > RMF::NodeConstHandle::get_static_value ( ID< Tag > k) const

Definition at line 163 of file NodeConstHandle.h.

◆ get_type()

NodeType RMF::NodeConstHandle::get_type ( ) const

Definition at line 203 of file NodeConstHandle.h.

◆ get_value()

template<class Tag>
Nullable< typename Tag::Type > RMF::NodeConstHandle::get_value ( ID< Tag > k) const

Definition at line 149 of file NodeConstHandle.h.

◆ operator NodeID()

RMF::NodeConstHandle::operator NodeID ( ) const

Definition at line 131 of file NodeConstHandle.h.

◆ set_association()

template<class T>
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.

Member Data Documentation

◆ node_

NodeID RMF::NodeConstHandle::node_
protected

Definition at line 112 of file NodeConstHandle.h.

◆ shared_

std::shared_ptr<internal::SharedData> RMF::NodeConstHandle::shared_
protected

Definition at line 113 of file NodeConstHandle.h.


The documentation for this class was generated from the following file: