Jamoma API  0.6.0.a19
TTObject Class Reference

Create and use Jamoma object instances. More...

#include <TTObject.h>

+ Inheritance diagram for TTObject:
+ Collaboration diagram for TTObject:

Public Member Functions

 TTObject (const TTSymbol aClassName, const TTValue arguments)
 Constructor. More...
 
 TTObject (const TTSymbol aClassName)
 Constructor to create an empyt container which will be assigned/copied-to at a later point.
 
 TTObject ()
 Constructor to create an empyt container which will be assigned/copied-to at a later point.
 
 TTObject (TTObjectBase *anObjectBase)
 Special constructor to create new object that wraps an existing TTObjectBase pointer. More...
 
 TTObject (const TTObject &anObjectToCopy)
 Copy constructor.
 
virtual ~TTObject ()
 Destructor.
 
TTObjectoperator= (TTObject object)
 Assign a TTObject instance to another TTObject.
 
TTObjectBaseinstance () const
 Return a direct pointer to the internal instance. More...
 
template<class T >
TTErr set (const TTSymbol aName, T aValue)
 Set an attribute value for an object. More...
 
template<class T >
TTErr get (const TTSymbol aName, T &aReturnedValue) const
 Get an attribute value for an object. More...
 
void attributes (TTValue &returnedAttributeNames) const
 Return a list of names of the available attributes. More...
 
TTSymbol attributeType (const TTSymbol aName)
 Return the type of an attribute as a symbol. More...
 
void messages (TTValue &returnedMessageNames) const
 Return a list of names of the available messages. More...
 
TTSymbol name () const
 Return the name of this class. More...
 
TTErr send (const TTSymbol aName)
 Send a message to this object with no arguments. More...
 
TTValue send (const TTSymbol aName, const TTValue &anInputValue)
 Send a message to this object with arguments. More...
 
TTErr registerObserverForNotifications (const TTObject &anObservingObject)
 Register an observer. More...
 
TTErr unregisterObserverForNotifications (const TTObject &anObservingObject)
 Unregister an observer for notifications. More...
 
TTBoolean valid () const
 Determine if the object contained by this TTObject is truly ready for use. More...
 
void track (TTBoolean newTrackingValue)
 Enable/Disable reference count tracking of the instance. More...
 

Static Public Member Functions

static TTErr GetRegisteredClassNames (TTValue &classNames)
 Query TTEnvironment for names of all registered TTObjectBase classes. More...
 
static TTErr GetRegisteredClassNamesForTags (TTValue &classNames, const TTValue &searchTags)
 Query TTEnvironment for names of all registered TTObjectBase classes that share specific tags. More...
 
static TTErr GetRegisteredTags (TTValue &tags)
 Query TTEnvironment for all registered tags used by TTObjectBase classes. More...
 

Friends

class TTEnvironment
 

Detailed Description

Create and use Jamoma object instances.

See also
TTObjectTest

Definition at line 29 of file TTObject.h.

Constructor & Destructor Documentation

TTObject::TTObject ( const TTSymbol  aClassName,
const TTValue  arguments 
)

Constructor.

Parameters
aClassNameThe symbolic name of the class to create/wrap.
argumentsArguments to the constructor.

Definition at line 20 of file TTObject.cpp.

References TTSymbol::c_str(), TTEnvironment::createInstance(), ttEnvironment, and TTLogError().

+ Here is the call graph for this function:

TTObject::TTObject ( TTObjectBase anObjectBase)

Special constructor to create new object that wraps an existing TTObjectBase pointer.

Use of the constructor is generally discouraged as is using TTObjectBase pointers in general.

Definition at line 51 of file TTObject.cpp.

References TTEnvironment::referenceInstance(), and ttEnvironment.

+ Here is the call graph for this function:

Member Function Documentation

void TTObject::attributes ( TTValue returnedAttributeNames) const

Return a list of names of the available attributes.

Parameters
attributeNameListPointer to a list of all attributes registered with this TTObjectBase.

Definition at line 111 of file TTObject.cpp.

References TTObjectBase::getAttributeNames().

Referenced by TTFreeHandFunction::getCurveList(), TTExplorerDirectoryCallback(), wrapTTModularClassAsMaxClass(), and wrapTTModularClassAsPdClass().

+ Here is the call graph for this function:

TTSymbol TTObject::attributeType ( const TTSymbol  aName)

Return the type of an attribute as a symbol.

Parameters
aNameThe name of the attribute we want the type.
Returns
TTSymbol : kTTSym__none, kTTSym_uint8, kTTSym_int8, kTTSym_uint16, kTTSym_int16, kTTSym_uint32, kTTSym_int32, kTTSym_uint64, kTTSym_int64, kTTSym_float32, kTTSym_float64, kTTSym__boolean, kTTSym_symbol, kTTSym_string, kTTSym_pointer, kTTSym_object, kTTSym_value. Returns kTTSymEmpty if the attribute doesn't exist.

Definition at line 117 of file TTObject.cpp.

References TTObjectBase::getAttributeType().

+ Here is the call graph for this function:

template<class T >
TTErr TTObject::get ( const TTSymbol  aName,
T &  aReturnedValue 
) const
TTErr TTObject::GetRegisteredClassNames ( TTValue classNames)
static

Query TTEnvironment for names of all registered TTObjectBase classes.

Parameters
[out]classNamesTTValue whose content will be set to an array of TTSymbol names for available classes
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 71 of file TTObject.cpp.

References TTEnvironment::getAllClassNames(), and ttEnvironment.

+ Here is the call graph for this function:

TTErr TTObject::GetRegisteredClassNamesForTags ( TTValue classNames,
const TTValue searchTags 
)
static

Query TTEnvironment for names of all registered TTObjectBase classes that share specific tags.

Parameters
[out]classNamesTTValue whose content will be set to an array of TTSymbol names for available classes
[in]searchTagsTTValue array containing the tags used to limit search
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 78 of file TTObject.cpp.

References TTEnvironment::getClassNamesWithTags(), and ttEnvironment.

Referenced by TTAllpass::getFilters(), TTFunction::getFunctions(), WindowFunction::getFunctions(), TTSpat::getSpatFunctions(), and TTTrajectory::getTypes().

+ Here is the call graph for this function:

TTErr TTObject::GetRegisteredTags ( TTValue tags)
static

Query TTEnvironment for all registered tags used by TTObjectBase classes.

Parameters
[out]tagsTTValue whose content will be set to an array of TTSymbol names for available tags
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 84 of file TTObject.cpp.

References kTTErrMethodNotFound.

void TTObject::messages ( TTValue returnedMessageNames) const

Return a list of names of the available messages.

Parameters
messageNameListPointer to a list of all messages registered with this TTObjectBase.

Definition at line 123 of file TTObject.cpp.

References TTObjectBase::getMessageNames().

Referenced by wrapTTModularClassAsMaxClass(), and wrapTTModularClassAsPdClass().

+ Here is the call graph for this function:

TTSymbol TTObject::name ( ) const

Return the name of this class.

Returns
The name of this object.

Definition at line 129 of file TTObject.cpp.

References TTObjectBase::getName().

Referenced by TTAudioGraphObjectBase::getAudioDescription(), TTFreeHandFunction::getCurveList(), TTContainerValueAttributeCallback(), TTInputDirectoryCallback(), TTMapperInputCreationCallback(), TTMapperOutputCreationCallback(), TTOutputDirectoryCallback(), TTPresetTestObject(), and TTProtocolDirectoryCallback().

+ Here is the call graph for this function:

TTErr TTObject::registerObserverForNotifications ( const TTObject anObservingObject)

Register an observer.

The observer will be monitoring this object.

Parameters
anObservingObjectReference to the observing object.
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 155 of file TTObject.cpp.

References TTObjectBase::registerObserverForNotifications().

Referenced by score_doread().

+ Here is the call graph for this function:

TTErr TTObject::send ( const TTSymbol  aName)

Send a message to this object with no arguments.

Parameters
aNameThe name of the message to send.
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 135 of file TTObject.cpp.

References TTObjectBase::sendMessage().

Referenced by TTProtocol::ActivityInMessage(), TTProtocol::ActivityOutMessage(), TTProtocol::ApplicationRegister(), TTOverdrive::clear(), TTLimiter::clear(), data_dec(), data_inc(), TTMirror::enableListening(), TTApplicationManager::getApplicationProtocolNames(), jamoma_container_send(), jamoma_data_command(), jamoma_input_send(), jamoma_output_send(), jamoma_sender_send(), jamoma_subscriber_create(), jamoma_viewer_send(), TTSampleMatrix::load(), model_init(), model_preset_amenities(), model_preset_doedit(), model_preset_doread(), model_preset_doread_again(), model_preset_dowrite(), model_preset_dowrite_again(), model_preset_edit(), model_reference_dowrite(), model_signal_return_audio_bypass(), model_signal_return_audio_gain(), model_signal_return_audio_mix(), model_signal_return_audio_mute(), model_signal_return_data_active(), model_signal_return_data_bypass(), model_subscribe(), TTNodeDirectory::notifyObservers(), TTOscReceive::oscSocketReceive(), ramp_bang(), ramp_float(), ramp_int(), ramp_list(), ramp_set(), ramp_stop(), TTXmlHandler::Read(), receive_bang(), TTProtocol::ReceiveDiscoverAllRequest(), TTProtocol::ReceiveDiscoverRequest(), TTProtocol::ReceiveGetRequest(), TTProtocol::ReceiveListenAnswer(), TTProtocol::ReceiveListenRequest(), TTProtocol::ReceiveSetRequest(), TTModelInfo::Rename(), TTSampleMatrix::resizeThenLoad(), score_doread(), score_doread_again(), TTSoundfileLoader::test(), TTDataRampCallback(), TTModularInit(), TTReceiverAttributeCallback(), TTReceiverDirectoryCallback(), TTWebReceive::WebSocketReceive(), WrappedContainerClass_free(), WrappedScoreClass_free(), and TTXmlHandler::Write().

+ Here is the call graph for this function:

TTValue TTObject::send ( const TTSymbol  aName,
const TTValue anInputValue 
)

Send a message to this object with arguments.

All arguments for input must be packed into a TTValue container. Any return values from the message will be packed into a second TTValue container, which you must provide.

Parameters
aNameThe name of the message to send.
anInputValueAny additional arguments to the message.
anOutputValueWill be filled-in with data upon return if the message returns data.
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 140 of file TTObject.cpp.

References TTObjectBase::sendMessage().

+ Here is the call graph for this function:

template<class T >
TTErr TTObject::set ( const TTSymbol  aName,
aValue 
)

Set an attribute value for an object.

Parameters
nameThe name of the attribute to set.
valueThe value to use for setting the attribute. This value can be changed(!), for example if the value is out of range for the attribute. Hence, it is not declared const.
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 22 of file TTObjectTemplates.h.

References TTObjectBase::setAttributeValue().

Referenced by TTProtocol::ApplicationRegister(), TTAudioGraphSource::create(), in_subscribe(), jamoma_container_create(), jamoma_cueManager_create(), jamoma_data_create(), jamoma_explorer_create(), jamoma_input_create(), jamoma_mapper_create(), jamoma_output_create(), jamoma_presetManager_create(), jamoma_receiver_create(), jamoma_receiver_create_audio(), jamoma_viewer_create(), model_preset_doread(), model_preset_doread_again(), model_preset_dowrite(), model_preset_dowrite_again(), model_preset_edit(), model_reference_dowrite(), model_signal_amenities(), model_subscribe(), out_subscribe(), TTTrajectory::ramp(), ramp_functionParameter(), ramp_schedulerParameter(), receive_address(), receive_subscribe(), TTTrajectory::reset(), send_address(), send_list(), send_return_model_address(), send_subscribe(), TTFreeHandFunction::setCurveList(), TTOverdrive::setDcBlocker(), TTLimiter::setDCBlocker(), TTMixer::setNumInputs(), TTMixer::setNumOutputs(), TTLimiter::setPreamp(), TTWavetable::setSize(), TTSoundfileLoader::test(), TTApplicationManagerProtocolActivityInCallback(), TTApplicationManagerProtocolActivityOutCallback(), TTOverdrive::updateMaxNumChannels(), TTLimiter::updateMaxNumChannels(), WrappedContainerClass_free(), WrappedContainerClass_new(), WrappedRampClass_new(), WrappedReceiverClass_free(), WrappedReceiverClass_new(), WrappedSenderClass_free(), and WrappedSenderClass_new().

+ Here is the call graph for this function:

void TTObject::track ( TTBoolean  newTrackingValue)

Enable/Disable reference count tracking of the instance.

Parameters
newTrackingValue#YES to enable the tracking, #NO to disable it

Definition at line 187 of file TTObject.cpp.

References TTObjectBase::track, and TTObjectBase::valid.

TTErr TTObject::unregisterObserverForNotifications ( const TTObject anObservingObject)

Unregister an observer for notifications.

The observer wiln no longer be monitoring.

Parameters
anObservingObjectReference to the observing object.
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 161 of file TTObject.cpp.

References TTObjectBase::unregisterObserverForNotifications().

+ Here is the call graph for this function:


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