Jamoma API  0.6.0.a19
TTAddress Class Reference

The TTAddress class is used to represent a string and efficiently pass and compare that string. More...

#include <TTAddress.h>

+ Inheritance diagram for TTAddress:
+ Collaboration diagram for TTAddress:

Public Member Functions

 TTAddress (const TTSymbol newDirectory, const TTAddress newParent, const TTSymbol newName, const TTSymbol newInstance, const TTSymbol newAttribute)
 TTAddress constructor from directory, parent, name, instance and attribute part. More...
 
TTSymbolgetDirectory ()
 Get the directory part.
 
TTAddress getParent ()
 Get a pointer to the parent address.
 
TTSymbolgetName ()
 Get the name part.
 
TTSymbolgetInstance ()
 Get the instance part.
 
TTSymbolgetAttribute ()
 Get the attribute part.
 
TTAddressType getType ()
 Get the type.
 
TTSymbol getNameInstance ()
 Get the name.instance part.
 
TTAddress normalize ()
 Normalize an address for lookup and other directory operations This would return an address without directory and attribute.
 
TTAddress removeAttribute ()
 Return a new TTAddress without attribute part.
 
TTAddress appendAttribute (TTSymbol anAttribute)
 Return a new TTAddress with attribute part.
 
TTAddress appendAddress (const TTAddress &toAppend)
 Return a new TTAddress with the appended part.
 
TTAddress appendInstance (const TTSymbol anInstance)
 Return a new TTAddress with a instance part.
 
TTAddressComparisonFlag compare (const TTAddress &toCompare, TTInt8 &depthDifference)
 A comparison tool. More...
 
TTErr splitAt (TTUInt32 whereToSplit, TTAddress &returnedPart1, TTAddress &returnedPart2)
 A parsing tool : split address in two part from a given '/' position. More...
 
TTUInt32 countSeparator ()
 A parsing tool : count how many C_SEPARATOR there is in the address. More...
 
TTErr listNameInstance (TTList &nameInstanceList)
 A parsing tool : return a list containing all name.instance part (without any S_SEPARATOR) More...
 
- Public Member Functions inherited from TTSymbol
const char * c_str () const
 Return a pointer to the internal string as a C-string. More...
 
TTUInt32 getSymbolId () const
 Return this symbol's unique id. More...
 
 operator const char * () const
 Cast a symbol to a C-string. More...
 
 operator const TTString & () const
 Cast a symbol to a TTStringRef. More...
 
TTPtr rawpointer () const
 Get the value of the raw pointer into the symbol table. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from TTSymbol
static TTSymbol random ()
 Generate a pseudo-random symbol.
 
- Protected Attributes inherited from TTSymbol
TTSymbolBasemSymbolPointer
 pointer to the symbol that we represent
 

Detailed Description

The TTAddress class is used to represent a string and efficiently pass and compare that string.

It is essentially a TTSymbol extended with OSC parsing. An address follows the form: directory:/parent/name.instance:attribute

Definition at line 29 of file TTAddress.h.

Constructor & Destructor Documentation

TTAddress::TTAddress ( const TTSymbol  newDirectory,
const TTAddress  newParent,
const TTSymbol  newName,
const TTSymbol  newInstance,
const TTSymbol  newAttribute 
)
inline

TTAddress constructor from directory, parent, name, instance and attribute part.

Parameters
newDirectorydirectory symbol
newParentparent address
newNamename symbol
newInstanceinstance symbol
newAttributeattribute symbol

Definition at line 89 of file TTAddress.h.

References TTSymbolTable::lookup().

+ Here is the call graph for this function:

Member Function Documentation

TTAddressComparisonFlag TTAddress::compare ( const TTAddress toCompare,
TTInt8 depthDifference 
)
inline

A comparison tool.

Parameters
toCompareAn address to compare (it doesn't compare attribute part)
depthDifferenceReturn the number of level separating the compared addresses (> 0 for lower result, < 0 for upper result)
Returns
An comparison flag

Definition at line 182 of file TTAddress.h.

References TTSymbol::mSymbolPointer.

Referenced by TTNodeDirectory::getAlias(), TTNodeDirectory::notifyObservers(), and TTNodeDirectory::replaceAlias().

TTUInt32 TTAddress::countSeparator ( )
inline

A parsing tool : count how many C_SEPARATOR there is in the address.

Returns
The number of C_SEPARATOR

Definition at line 206 of file TTAddress.h.

Referenced by TTNodeDirectory::AliasCreate(), and TTNode::getAddress().

TTErr TTAddress::listNameInstance ( TTList &  nameInstanceList)
inline

A parsing tool : return a list containing all name.instance part (without any S_SEPARATOR)

Parameters
Thelist of name.instance part to fill

Definition at line 213 of file TTAddress.h.

TTErr TTAddress::splitAt ( TTUInt32  whereToSplit,
TTAddress returnedPart1,
TTAddress returnedPart2 
)
inline

A parsing tool : split address in two part from a given '/' position.

Parameters
whereToSplitAn int to give the '/' id where to split
returnedPart1A pointer to upper part (before the given position) : /part1
returnedPart2A pointer to lower part (after the given position) : /part2
Returns
kTTValueNotFound if the given '/' id doesn't exist

Definition at line 192 of file TTAddress.h.

Referenced by TTNode::getAddress(), and TTNodeDirectory::replaceAlias().


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