Jamoma API  0.6.0.a19
TTClass Class Reference

The TTClass object represents a class in the Jamoma environment. More...

#include <TTClass.h>

Public Member Functions

 TTClass (const TTSymbol className, const TTValue &tags, const TTObjectBaseInstantiationMethod anInstantiationMethod)
 Constructor method. More...
 
virtual ~TTClass ()
 Destructor. More...
 
TTErr createInstance (TTObjectBase **anObject, const TTValue &anArgument)
 Create a new instance of a registered TTObjectBase class. More...
 
TTErr releaseInstance (TTObjectBase *anObject)
 Free an instance of a TTObjectBase class. More...
 

Friends

class TTEnvironment
 
class TTObjectBase
 

Detailed Description

The TTClass object represents a class in the Jamoma environment.

This is to say that it represents everything about a class except for the class itself, which is a subclass of TTObjectBase.

Definition at line 32 of file TTClass.h.

Constructor & Destructor Documentation

TTClass::TTClass ( const TTSymbol  className,
const TTValue tags,
const TTObjectBaseInstantiationMethod  anInstantiationMethod 
)

Constructor method.

Parameters
classNameThe name of the class.
tagsThe tags that this class is associated with.
anInstantiationMethodThe instantiation method for this class.
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 24 of file TTClass.cpp.

TTClass::~TTClass ( )
virtual

Destructor.

Definition at line 31 of file TTClass.cpp.

Member Function Documentation

TTErr TTClass::createInstance ( TTObjectBase **  anObject,
const TTValue anArgument 
)

Create a new instance of a registered TTObjectBase class.

Parameters
anObjectUpon successful return, the value will be set to a TTObjectBase which is the new instance. If the pointer is passed in as non-NULL then createUnit() will try to free to the existing object to which it points prior to instantiating the new unit.
anArgumentFor most audio processing objects, this should be passed the maximum number of channels. For this reason, we overload this method with a TTUint16 argument as a convenience.
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 37 of file TTClass.cpp.

References TTSymbol::c_str(), kTTErrAllocFailed, kTTErrNone, and TTLogError().

Referenced by TTEnvironment::createInstance().

+ Here is the call graph for this function:

TTErr TTClass::releaseInstance ( TTObjectBase anObject)

Free an instance of a TTObjectBase class.

There are a couple of reasons we want to have this wrapper around the delete operator.

  • For instrumenting the code to investigate bugs, performance, etc.
  • So that we can handle any threading, spin-locks, mutexes, or other issues before actually freeing the object.
Parameters
unitA pointer to the unit to free.
Returns
TTErr error code if the method fails to execute, else kTTErrNone.

Definition at line 54 of file TTClass.cpp.

References kTTErrNone.


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