libIntegra
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | List of all members
integra_api::CPath Class Reference

Represents the address of a node endpoint, absolutely or relatively. More...

#include "api/path.h"

Public Member Functions

 CPath ()
 Construct an empty path.
 
 CPath (const string &path_string)
 Construct a path from a dot-separated string eg "OuterContainer.InnerContainer.ModuleName".
 
 CPath (const CPath &to_copy)
 Copy contructor.
 
const CPathoperator= (const CPath &to_copy)
 Assignment operator.
 
bool operator== (const CPath &to_compare) const
 Equality operator.
 
int get_number_of_elements () const
 
const string & operator[] (int index) const
 array access operator. This operator allows you to access path elements in array syntax eg path[ 0 ] More...
 
const string & get_string () const
 
 operator const string & () const
 Casting operator, synonym for get_string()
 
string pop_element ()
 Pop last element from path Reduces number of elements in path by 1. More...
 
void append_element (const string &element)
 append element to path More...
 

Detailed Description

Represents the address of a node endpoint, absolutely or relatively.

libIntegra uses paths to identify node enpoints. For example, a node called 'AudioIn' within a node called 'Project' might have an endpoint called 'inLevel'. In this case, the endpoint could be addressed (from the top level) as 'Project.AudioIn.inLevel'. Or, the same endpoint could be addressed (from the 'Project' node) as 'AudioIn.inLevel'. Or, the same endpoint could be addressed (from the 'AudioIn' node) as 'inLevel'.

Note
: paths can only traverse down the node hierarchy. They cannot use '..' or similar to access parent nodes. this ensures that all the functionality in each branch of the node tree is self-contained.

Member Function Documentation

void integra_api::CPath::append_element ( const string &  element)

append element to path

Parameters
elementThe element to append
int integra_api::CPath::get_number_of_elements ( ) const
Returns
Number of elements in the path
const string& integra_api::CPath::get_string ( ) const
Returns
A dot-separated representation of the path as a single string eg "OuterContainer.InnerContainer.ModuleName"
const string& integra_api::CPath::operator[] ( int  index) const

array access operator. This operator allows you to access path elements in array syntax eg path[ 0 ]

Note
will return an empty string for out-of-range index
string integra_api::CPath::pop_element ( )

Pop last element from path Reduces number of elements in path by 1.

Returns
the last element, or an empty string if the path was already empty

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