Jamoma API  0.6.0.a19
TTApplicationManager Class Reference

Handles TTApplication and #Protocol instances. More...

#include <TTApplicationManager.h>

+ Inheritance diagram for TTApplicationManager:
+ Collaboration diagram for TTApplicationManager:

Public Member Functions

TTApplicationPtr findApplication (TTSymbol applicationName)
 Get an application relative to a name. More...
 
TTNodeDirectoryPtr findApplicationDirectory (TTSymbol applicationName)
 Get an application directory relative to a name. More...
 
TTApplicationPtr getApplicationLocal ()
 Get local application. More...
 
TTApplicationPtr findApplicationFrom (TTAddress anAddress)
 Get an application relative to an address. More...
 
TTNodeDirectoryPtr findApplicationDirectoryFrom (TTAddress anAddress)
 Get an application directory relative to an address. More...
 
TTValue getApplicationProtocolNames (TTSymbol applicationName)
 Get application protocol names relative to a name. More...
 
TTProtocolPtr findProtocol (TTSymbol protocolName)
 Get a protocol relative to a name. More...
 
- Public Member Functions inherited from TTObjectBase
virtual ~TTObjectBase ()
 Destructor.
 
TTUInt16 getReferenceCount ()
 Query an object to get its current reference count. More...
 
TTUInt32 getObserverCount () const
 Query an object to get the number of observers. More...
 
TTErr registerAttribute (const TTSymbol name, const TTDataType type, void *address)
 Register an attribute. More...
 
TTErr extendAttribute (const TTSymbol name, const TTObjectBasePtr extendedObject, const TTSymbol extendedName)
 Extend the attribute of an existing TTObjectBase to this TTObjectBase (using another attribute name) More...
 
TTErr removeAttribute (const TTSymbol name)
 Remove an attribute. More...
 
TTErr findAttribute (const TTSymbol name, TTAttribute **attr)
 Find an attribute. More...
 
TTErr setAttributeValue (const TTSymbol name, TTValue &value)
 Set an attribute value for an object. More...
 
template<class T >
TTErr set (const TTSymbol aName, T aValue)
 Set an attribute value for an object This is the same as calling setAttributeValue(). More...
 
TTErr getAttributeValue (const TTSymbol name, TTValue &value)
 Get an attribute value for an object. More...
 
template<class T >
TTErr get (const TTSymbol aName, T &aReturnedValue)
 Get an attribute value for an object This is the same as calling getAttributeValue(). More...
 
TTSymbol getAttributeType (const TTSymbol name)
 Return the type of an attribute as a symbol. More...
 
TTErr getAttributeGetterFlags (const TTSymbol name, TTAttributeFlags &value)
 Get the getterFlags of an attribute. More...
 
TTErr setAttributeGetterFlags (const TTSymbol name, TTAttributeFlags &value)
 Set the getterFlags of an attribute. More...
 
TTErr getAttributeSetterFlags (const TTSymbol name, TTAttributeFlags &value)
 Get the setterFlags of an attribute. More...
 
TTErr setAttributeSetterFlags (const TTSymbol name, TTAttributeFlags &value)
 Set the setterFlags of an attribute. More...
 
TTErr registerAttributeProperty (const TTSymbol attributeName, const TTSymbol propertyName, const TTValue &initialValue, TTGetterMethod getter, TTSetterMethod setter)
 Register an attribute property. More...
 
TTErr registerMessageProperty (const TTSymbol messageName, const TTSymbol propertyName, const TTValue &initialValue, TTGetterMethod getter, TTSetterMethod setter)
 Register an message property. More...
 
TTErr getAttribute (const TTSymbol name, TTAttributePtr *attributeObject)
 Search for and locate an attribute. More...
 
TTErr getMessage (const TTSymbol name, TTMessagePtr *messageObject)
 Search for and locate a message. More...
 
void getAttributeNames (TTValue &attributeNameList)
 Return a list of names of the available attributes. More...
 
void getMessageNames (TTValue &messageNameList)
 Return a list of names of the available messages. More...
 
TTSymbol getName () const
 Return the name of this class. More...
 
TTErr registerMessage (const TTSymbol name, TTMethod method)
 Register a message with this object. More...
 
TTErr findMessage (const TTSymbol name, TTMessage **message)
 Find a message registered with this object. More...
 
TTErr removeMessage (const TTSymbol name)
 Remove a message. More...
 
TTErr sendMessage (const TTSymbol name)
 TODO: Document this function. More...
 
TTErr registerObserverForMessage (const TTObject &observingObject, const TTSymbol messageName)
 Register an observer for a message. More...
 
TTErr registerObserverForAttribute (const TTObject &observingObject, const TTSymbol attributeName)
 Register an observer for an attribute. More...
 
TTErr registerObserverForNotifications (const TTObject &observingObject)
 Register an observer. More...
 
TTErr unregisterObserverForMessage (const TTObject &observingObject, const TTSymbol messageName)
 Unregister an observer for a message. More...
 
TTErr unregisterObserverForAttribute (const TTObject &observingObject, const TTSymbol attributeName)
 Unregister an observer for an attribute. More...
 
TTErr unregisterObserverForNotifications (const TTObject &observingObject)
 Unregister an observer for notifications. More...
 
TTErr sendNotification (const TTSymbol name, const TTValue &arguments)
 Send a notification. More...
 
TTErr logMessage (TTImmutableCString fmtstring,...)
 Log messages scoped to this object instance. More...
 
TTErr logWarning (TTImmutableCString fmtstring,...)
 Log warnings scoped to this object instance. More...
 
TTErr logError (TTImmutableCString fmtstring,...)
 Log errors scoped to this object instance. More...
 
TTErr logDebug (TTImmutableCString fmtstring,...)
 Log messages (scoped to this object instance) to output only if the basic debugging flag is enabled in the environment. More...
 
TTErr lock ()
 Lock the object in order to ensure thread-safe processing. More...
 
TTErr unlock ()
 Unlock the object when thread-safe processing is no longer required. More...
 
TTBoolean isLocked ()
 Query if the object currently is locked for thread-safe processing. More...
 
TTBoolean waitForLock ()
 If the object is locked (e.g. More...
 

Friends

TTErr TTMODULAR_EXPORT TTApplicationManagerAddApplicationObserver (TTSymbol anApplicationName, const TTObject anObserver)
 Add a TTCallback as observer of application creation/destruction note : it uses the extern TTModularApplications variable. More...
 
TTErr TTMODULAR_EXPORT TTApplicationManagerRemoveApplicationObserver (TTSymbol anApplicationName, const TTObject anObserver)
 Remove a TTCallback as observer of application creation/destruction note : it uses the extern TTModularApplications variable. More...
 
TTErr TTMODULAR_EXPORT TTApplicationManagerProtocolActivityInCallback (const TTValue &baton, const TTValue &data)
 To get back raw incoming messages from any protocol. More...
 
TTErr TTMODULAR_EXPORT TTApplicationManagerProtocolActivityOutCallback (const TTValue &baton, const TTValue &data)
 To get back raw outputing messages from any protocol. More...
 

Additional Inherited Members

- Public Attributes inherited from TTObjectBase
TTBoolean valid
 If the object isn't completely built, or is in the process of freeing, this will be false.
 
TTBoolean track
 enable the print of a log message to ease the track of reference counting mechanism on an instance More...
 
- Protected Member Functions inherited from TTObjectBase
 TTObjectBase (const TTValue arguments)
 Constructor. More...
 
- Protected Attributes inherited from TTObjectBase
TTList observers
 List of all objects watching this object for life-cycle and other changes.
 

Detailed Description

Handles TTApplication and #Protocol instances.

the TTApplicationManager class is a kind of tower control between our application (called "local") and all others (called "distant"). This coordination between applications is based on protocol units which one applications have to register.
Then, once applications are registered to protocols, any distant applications can :

  • discover the local application namespace.
  • get the value an attribute of an object registered into the local application.
  • set the value an attribute of an object registered into the local application.
  • listen the value an attribute of an object registered into the local application.
    First of all, notice those features are not available for all protocols
    Then, notice the features above can also be done in the opposite way (the local application to the distant applications).
    The TTApplicationManager class provides method to instanciate and release TTApplication and #Protocol instances.
    See also
    TTApplication, ProtocolLib

Definition at line 66 of file TTApplicationManager.h.

Member Function Documentation

TTApplicationPtr TTApplicationManager::findApplication ( TTSymbol  applicationName)

Get an application relative to a name.

Parameters
applicationNameTTSymbol
Returns
#TTApplicationPtr or NULL if the application doesn't exist

Definition at line 1299 of file TTApplicationManager.cpp.

References TTObject::instance(), and TTHash::lookup().

Referenced by findApplicationDirectory(), and findApplicationFrom().

+ Here is the call graph for this function:

TTNodeDirectoryPtr TTApplicationManager::findApplicationDirectory ( TTSymbol  applicationName)

Get an application directory relative to a name.

Parameters
applicationNameTTSymbol
Returns
#TTNodeDirectoryPtr or NULL if the application doesn't exist

Definition at line 1313 of file TTApplicationManager.cpp.

References findApplication(), and TTApplication::getDirectory().

+ Here is the call graph for this function:

TTNodeDirectoryPtr TTApplicationManager::findApplicationDirectoryFrom ( TTAddress  anAddress)

Get an application directory relative to an address.

Parameters
anAddressTTAddress
Returns
#TTNodeDirectoryPtr : mApplicationLocal directory for address without directory part or NULL if the directory part is not an application name

Definition at line 1343 of file TTApplicationManager.cpp.

References findApplicationFrom(), and TTApplication::getDirectory().

+ Here is the call graph for this function:

TTApplicationPtr TTApplicationManager::findApplicationFrom ( TTAddress  anAddress)

Get an application relative to an address.

Parameters
anAddressTTAddress
Returns
#TTApplicationPtr : mApplicationLocal for address without directory part or NULL if the directory part is not an application name

Definition at line 1329 of file TTApplicationManager.cpp.

References findApplication(), TTAddress::getDirectory(), and TTObject::instance().

Referenced by findApplicationDirectoryFrom().

+ Here is the call graph for this function:

TTProtocolPtr TTApplicationManager::findProtocol ( TTSymbol  protocolName)

Get a protocol relative to a name.

Parameters
protocolNameTTSymbol
Returns
#TTProtocolPtr or NULL if the protocol doesn't exist

Definition at line 1382 of file TTApplicationManager.cpp.

References TTObject::instance(), TTHash::lookup(), and TTLogError().

+ Here is the call graph for this function:

TTApplicationPtr TTApplicationManager::getApplicationLocal ( )

Get local application.

Returns
#TTApplicationPtr or NULL if the application doesn't exist

Definition at line 1323 of file TTApplicationManager.cpp.

References TTObject::instance().

+ Here is the call graph for this function:

TTValue TTApplicationManager::getApplicationProtocolNames ( TTSymbol  applicationName)

Get application protocol names relative to a name.

Parameters
applicationNameTTSymbol
Returns
a TTValue containing all protocol names

Definition at line 1353 of file TTApplicationManager.cpp.

References TTValue::append(), TTHash::getKeys(), TTHash::lookup(), TTObject::send(), and TTValue::size().

+ Here is the call graph for this function:

Friends And Related Function Documentation

TTErr TTMODULAR_EXPORT TTApplicationManagerAddApplicationObserver ( TTSymbol  anApplicationName,
const TTObject  anObserver 
)
friend

Add a TTCallback as observer of application creation/destruction note : it uses the extern TTModularApplications variable.

Parameters
anApplicationNamean application to observe
observera TTCallbackPtr to add
Returns
an error code

Definition at line 1403 of file TTApplicationManager.cpp.

TTErr TTMODULAR_EXPORT TTApplicationManagerProtocolActivityInCallback ( const TTValue baton,
const TTValue data 
)
friend

To get back raw incoming messages from any protocol.

Parameters
baton..
data..
Returns
an error code

Definition at line 1470 of file TTApplicationManager.cpp.

TTErr TTMODULAR_EXPORT TTApplicationManagerProtocolActivityOutCallback ( const TTValue baton,
const TTValue data 
)
friend

To get back raw outputing messages from any protocol.

Parameters
baton..
data..
Returns
an error code

Definition at line 1486 of file TTApplicationManager.cpp.

TTErr TTMODULAR_EXPORT TTApplicationManagerRemoveApplicationObserver ( TTSymbol  anApplicationName,
const TTObject  anObserver 
)
friend

Remove a TTCallback as observer of application creation/destruction note : it uses the extern TTModularApplications variable.

Parameters
anApplicationNamean application
observera TTCallbackPtr to remove
Returns
a kTTErrGeneric if there isn't observer

Definition at line 1435 of file TTApplicationManager.cpp.


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