Jamoma API  0.6.0.a19
TTObjectBase.cpp
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup foundationLibrary
4  *
5  * @brief The Jamoma Object Base Class.
6  *
7  * @details Base class for all first-class Jamoma objects.
8  * Internal objects may inherit directly from #TTObjectBase,
9  * but most objects will inherit from #TTDataObject or #TTAudioObject.
10  *
11  * @author Timothy Place, Theo de la Hogue, Trond Lossius
12  *
13  * @copyright Copyright © 2008, Timothy Place @n
14  * This code is licensed under the terms of the "New BSD License" @n
15  * http://creativecommons.org/licenses/BSD/
16  */
17 
18 #include "TTObject.h"
19 #include "TTEnvironment.h"
20 #include "TTClass.h"
21 #ifdef TT_PLATFORM_WIN
22 #include <Windows.h>
23 #endif
24 
26  : classPtr(NULL), messageObservers(NULL), attributeObservers(NULL),
27  mLocked(false), referenceCount(1), valid(false), track(false), reserved1(0)//, reserved2(0)
28 {
29  messages = new TTHash;
30  attributes = new TTHash;
31  // 'valid' will be set true by the Environment class which is the factory for all objects
32 
33  // Cannot add any messages or attributes here because messages and attributes are themselves objects
34  // and we will infinitely recurse
35 }
36 
37 
39 {
40  TTValue v, u;
41 
42  // Delete message objects, then delete the hash that maintains them.
43  messages->getKeys(v);
44  for (TTUInt16 i=0; i<v.size(); i++) {
45  TTSymbol name(kTTSymEmpty);
46  TTMessage* message = NULL;
47 
48  name = v[i];
49  messages->lookup(name, u);
50  message = TTMessagePtr(TTPtr(u));
51  delete message;
52  }
53  delete messages;
54 
55  // Delete attribute objects, then delete the hash that maintains them.
56  attributes->getKeys(v);
57  for (TTUInt16 i=0; i<v.size(); i++) {
58  TTSymbol name(kTTSymEmpty);
59  TTAttribute* attribute = NULL;
60 
61  name = v[i];
62  attributes->lookup(name, u);
63  attribute = TTAttributePtr(TTPtr(u));
64  delete attribute;
65  }
66  delete attributes;
67 }
68 
69 
70 #if 0
71 #pragma mark -
72 #pragma mark Object Attributes
73 #endif
74 
75 TTErr TTObjectBase::registerAttribute(const TTSymbol name, const TTDataType type, void* address)
76 {
77  TTAttribute* newAttribute = new TTAttribute(name, type, address);
78 
79  newAttribute->setGetterFlags(kTTAttrPassObject);
80  newAttribute->setSetterFlags(kTTAttrPassObject);
81  attributes->append(name, TTPtr(newAttribute));
82  return kTTErrNone;
83 }
84 
85 TTErr TTObjectBase::registerAttribute(const TTSymbol name, const TTDataType type, void* address, TTGetterMethod getter)
86 {
87  TTAttribute* newAttribute = new TTAttribute(name, type, address, getter);
88 
89  newAttribute->setSetterFlags(kTTAttrPassObject);
90  attributes->append(name, TTPtr(newAttribute));
91  return kTTErrNone;
92 }
93 
94 TTErr TTObjectBase::registerAttribute(const TTSymbol name, const TTDataType type, void* address, TTSetterMethod setter)
95 {
96  TTAttribute* newAttribute = new TTAttribute(name, type, address, setter);
97 
98  newAttribute->setGetterFlags(kTTAttrPassObject);
99  attributes->append(name, TTPtr(newAttribute));
100  return kTTErrNone;
101 }
102 
103 TTErr TTObjectBase::registerAttribute(const TTSymbol name, const TTDataType type, void* address, TTGetterMethod getter, TTSetterMethod setter)
104 {
105  TTAttribute* newAttribute = new TTAttribute(name, type, address, getter, setter);
106 
107  attributes->append(name, TTPtr(newAttribute));
108  return kTTErrNone;
109 }
110 
111 TTErr TTObjectBase::registerAttribute(const TTSymbol name, const TTObjectBasePtr newGetterObject, const TTObjectBasePtr newSetterObject)
112 {
113  TTAttribute* newAttribute = new TTAttribute(name, newGetterObject, newSetterObject);
114 
115  attributes->append(name, TTPtr(newAttribute));
116  return kTTErrNone;
117 }
118 
119 TTErr TTObjectBase::extendAttribute(const TTSymbol name, const TTObjectBasePtr extendedObject, const TTSymbol extendedName)
120 {
121  TTAttributePtr extendedAttribute = NULL;
122  TTAttributePtr newAttribute;
123  TTErr err = extendedObject->findAttribute(extendedName, &extendedAttribute);
124 
125  if (!err) {
126  newAttribute = new TTAttribute(extendedAttribute, extendedObject);
127  attributes->append(name, TTPtr(newAttribute));
128  return kTTErrNone;
129  }
130  else
131  return err;
132 }
133 
135 {
136  TTAttribute* attribute = NULL;
137  TTErr err = findAttribute(name, &attribute);
138 
139  if (!err) {
140  err = attributes->remove(name);
141  delete attribute;
142  }
143  return err;
144 }
145 
146 
148 {
149  TTValue v;
150  TTErr err = kTTErrNone;
151 
152  err = attributes->lookup(name, v);
153  if (err == kTTErrNone)
154  *attr = TTAttributePtr(TTPtr(v));
155  else
157  return err;
158 }
159 
161 {
162  TTAttributePtr attribute = NULL;
163  TTErr err;
164 
165  err = findAttribute(name, &attribute);
166  if (!err) {
167 
168  if (attribute->getterFlags & kTTAttrPassObject)
169  err = (this->*attribute->getter)(*attribute, value);
170  else {
171  TTMethodOutputValue getter = (TTMethodOutputValue)attribute->getter;
172  err = (this->*getter)(value);
173  }
174  }
175  return err;
176 }
177 
179 {
180  TTAttributePtr attribute = NULL;
181 
182  // Retreive the registered attribute
183  TTErr err = findAttribute(name, &attribute);
184 
185  if (!err)
186  {
187  // If no value : use attribute default value
188  if (value.empty())
189  return setAttributeValue(name, attribute->mDefaultValue);
190 
191  // Can't set read only attribute
192  if (attribute->readOnly)
193  err = kTTErrReadOnly;
194 
195  else
196  {
197  // Clipping
198  if (attribute->rangeChecking == kTTSym_clip)
199  value.clip(attribute->rangeLowBound, attribute->rangeHighBound);
200  else if (attribute->rangeChecking == kTTSym_cliplow)
201  value.cliplow(attribute->rangeLowBound);
202  else if (attribute->rangeChecking == kTTSym_cliphigh)
203  value.cliphigh(attribute->rangeHighBound);
204 
205  // Calling the attribute accessor of the object depending of the arguments it takes
206 
207  // Passing attribute structure with the value
208  if (attribute->setterFlags & kTTAttrPassObject)
209  err = (this->*attribute->setter)(*attribute, value);
210 
211  // Or passing the value only
212  else
213  {
214  TTMethodInputValue setter = (TTMethodInputValue)attribute->setter;
215  err = (this->*setter)(value);
216  }
217  }
218  }
219 
220  return err;
221 }
222 
224 {
225  TTAttributePtr attributeObject;
226 
227  if (!findAttribute(name, &attributeObject))
228 
229  return *(ttDataTypeInfo[attributeObject->type]->name);
230 
231  else
232 
233  return kTTSymEmpty;
234 }
235 
237 {
238  TTAttributePtr attribute = NULL;
239  TTErr err;
240 
241  err = findAttribute(name, &attribute);
242  if (!err)
243  attribute->getGetterFlags(value);
244 
245  return err;
246 }
247 
249 {
250  TTAttributePtr attribute = NULL;
251  TTErr err;
252 
253  err = findAttribute(name, &attribute);
254  if (!err)
255  attribute->setGetterFlags(value);
256 
257  return err;
258 }
259 
260 
262 {
263  TTAttributePtr attribute = NULL;
264  TTErr err;
265 
266  err = findAttribute(name, &attribute);
267  if (!err)
268  attribute->getSetterFlags(value);
269 
270  return err;
271 }
272 
274 {
275  TTAttributePtr attribute = NULL;
276  TTErr err;
277 
278  err = findAttribute(name, &attribute);
279  if (!err)
280  attribute->setSetterFlags(value);
281 
282  return err;
283 }
284 
285 
286 void TTObjectBase::getAttributeNames(TTValue& attributeNameList)
287 {
288  TTValue unfilteredNameList;
289  TTUInt32 attributeCount;
290 
291  attributes->getKeys(unfilteredNameList);
292  attributeCount = unfilteredNameList.size();
293 
294  attributeNameList.clear();
295 
296  for (TTUInt32 i=0; i<attributeCount; i++) {
297  TTAttributePtr attribute = NULL;
298  TTSymbol attributeName = kTTSymEmpty;
299 
300  attributeName = unfilteredNameList[i];
301 // getAttribute(attributeName, &attribute);
302  findAttribute(attributeName, &attribute);
303 
304  if (attribute->hidden == NO)
305  attributeNameList.append(attributeName);
306  }
307 }
308 
309 
310 TTErr TTObjectBase::registerAttributeProperty(const TTSymbol attributeName, const TTSymbol propertyName, const TTValue& initialValue, TTGetterMethod getter, TTSetterMethod setter)
311 {
312  TTAttributePtr theAttr = NULL;
313  TTValue v;
314  TTErr err;
315 
316  err = attributes->lookup(attributeName, v);
317  if (!err) {
318  theAttr = TTAttributePtr(TTPtr(v));
319  err = theAttr->registerAttribute(propertyName, kTypeLocalValue, NULL, getter, setter);
320  theAttr->setAttributeValue(propertyName, (TTValue&)initialValue);
321  }
322  return err;
323 }
324 
325 
326 TTErr TTObjectBase::registerMessageProperty(const TTSymbol messageName, const TTSymbol propertyName, const TTValue& initialValue, TTGetterMethod getter, TTSetterMethod setter)
327 {
328  TTMessagePtr theMessage = NULL;
329  TTValue v;
330  TTErr err;
331 
332  err = messages->lookup(messageName, v);
333  if (err == kTTErrNone) {
334  theMessage = TTMessagePtr(TTPtr(v));
335  err = theMessage->registerAttribute(propertyName, kTypeLocalValue, NULL, getter, setter);
336  theMessage->setAttributeValue(propertyName, (TTValue&)initialValue);
337  }
338  return err;
339 }
340 
341 
343 {
344  TTValue unfilteredNameList;
345  TTUInt32 messageCount;
346 
347  messages->getKeys(unfilteredNameList);
348  messageCount = unfilteredNameList.size();
349 
350  messageNameList.clear();
351 
352  for (TTUInt32 i=0; i<messageCount; i++) {
353  TTMessagePtr message = NULL;
354  TTSymbol messageName(kTTSymEmpty);
355 
356  messageName = unfilteredNameList[i];
357  getMessage(messageName, &message);
358 
359  if (message->hidden == NO)
360  messageNameList.append(messageName);
361  }
362 }
363 
364 
366 {
367  return classPtr->name;
368 }
369 
370 
371 #if 0
372 #pragma mark -
373 #pragma mark Object Messages
374 #endif
375 
377 {
378  TTMessagePtr newMessage = new TTMessage(name, method, kTTMessageDefaultFlags);
379 
381  logMessage("Registering Message '%s' with flags = %ld, message count for this object is now %ld\n", name.c_str(), kTTMessageDefaultFlags, messages->getSize());
382 
383  messages->append(name, TTPtr(newMessage));
384  return kTTErrNone;
385 }
386 
387 
389 {
390  TTMessagePtr newMessage = new TTMessage(name, method, flags);
391 
393  logMessage("Registering Message '%s' with flags = %ld, message count for this object is now %ld\n", name.c_str(), kTTMessageDefaultFlags, messages->getSize());
394 
395  messages->append(name, TTPtr(newMessage));
396  return kTTErrNone;
397 }
398 
399 
401 {
402  TTValue v;
403  TTErr err = kTTErrNone;
404 
405  err = messages->lookup(TTSymbol(name), v);
406  if (!err) {
407  *message = TTMessagePtr(TTPtr(v));
408  return kTTErrNone;
409  }
410  else
411  return kTTErrInvalidAttribute;
412 }
413 
415 {
416  TTMessage* message = NULL;
417  TTErr err = findMessage(name, &message);
418 
419  if (!err) {
420  err = messages->remove(name);
421  delete message;
422  }
423  return err;
424 }
425 
426 
428 {
429  TTValue v;
430  return sendMessage(name, TTValue(), v);
431 }
432 
433 
434 #ifdef TT_SUPPORT_SINGLE_ARG_MESSAGE_CALLS
435 
436 TTErr TTObjectBase::sendMessage(const TTSymbolRef name, TTValue& anOutputValue)
437 {
438  return sendMessage(name, kTTValNONE, anOutputValue);
439 }
440 
441 
442 TTErr TTObjectBase::sendMessage(const TTSymbolRef name, const TTValue& anInputValue)
443 {
444  return sendMessage(name, anInputValue, kTTValNONE);
445 }
446 
447 #endif
448 
449 
450 TTErr TTObjectBase::sendMessage(const TTSymbol name, const TTValue& anInputValue, TTValue& anOutputValue)
451 {
452  TTMessagePtr message = NULL;
453  TTErr err;
454 
455  // Retreive the registered message
456  err = findMessage(name, &message);
457 
458  if (!err)
459  {
460  // Calling the method of the object depending of the arguments it takes
461 
462  // No argument case
463  if (message->flags & kTTMessagePassNone)
464  {
465  TTMethodNone method = (TTMethodNone)message->method;
466  return (this->*method)();
467  }
468  // Name + arguments case
469  else if (message->flags & kTTMessagePassNameAndValue)
470  {
471  return (this->*message->method)(name, anInputValue, anOutputValue);
472  }
473  // Only argument case (default : kTTMessagePassValue)
474  else
475  {
476  TTMethodValue method = (TTMethodValue)message->method;
477  return (this->*method)(anInputValue, anOutputValue);
478  }
479  }
480 
481  return kTTErrMethodNotFound;
482 }
483 
484 
485 
486 #if 0
487 #pragma mark -
488 #pragma mark Observing
489 #endif
490 
491 
493 {
494  TTValue v(observingObject);
495 
496  observers.appendUnique(v);
497  return kTTErrNone;
498 }
499 
500 
502 {
503  TTValue c(observingObject);
504  TTValue v;
505  TTErr err;
506 
507  err = observers.findEquals(c, v);
508  if (!err)
509  observers.remove(v);
510  return err;
511 }
512 
513 
515 {
516  return observers.iterateObjectsSendingMessage(name, TTValueRef(arguments));
517 }
518 
519 
520 #if 0
521 #pragma mark -
522 #pragma mark Logging
523 #endif
524 
525 /** Log messages scoped to this object instance. */
526 TTErr TTObjectBase::logMessage(TTImmutableCString fmtstring, ...)
527 {
528  char str[4096];
529  char fullstr[4096];
530  va_list ap;
531 
532  va_start(ap, fmtstring);
533  vsnprintf(str, 4000, fmtstring, ap);
534  va_end(ap);
535  str[4095] = 0;
536 
537  strncpy(fullstr, classPtr->name.c_str(), 4095);
538  strncat(fullstr, " : ", 4095);
539  strncat(fullstr, str, 4095);
540  TTLogMessage(fullstr);
541  return kTTErrNone;
542 }
543 
544 
545 TTErr TTObjectBase::logWarning(TTImmutableCString fmtstring, ...)
546 {
547  char str[4096];
548  char fullstr[4096];
549  va_list ap;
550 
551  va_start(ap, fmtstring);
552  vsnprintf(str, 4000, fmtstring, ap);
553  va_end(ap);
554  str[4095] = 0;
555 
556  strncpy(fullstr, classPtr->name.c_str(), 4095);
557  strncat(fullstr, " : ", 4095);
558  strncat(fullstr, str, 4095);
559  TTLogWarning(fullstr);
560  return kTTErrNone;
561 }
562 
563 
564 TTErr TTObjectBase::logError(TTImmutableCString fmtstring, ...)
565 {
566  char str[4096];
567  char fullstr[4096];
568  va_list ap;
569 
570  va_start(ap, fmtstring);
571  vsnprintf(str, 4000, fmtstring, ap);
572  va_end(ap);
573  str[4095] = 0;
574 
575  // classPtr can be NULL if a post happens during construction
576  if (classPtr)
577  strncpy(fullstr, classPtr->name.c_str(), 4095);
578  else
579  strncpy(fullstr, "<class name not available>", 4095);
580  strncat(fullstr, " : ", 4095);
581  strncat(fullstr, str, 4095);
582  TTLogError(fullstr);
583  return kTTErrNone;
584 }
585 
586 
587 TTErr TTObjectBase::logDebug(TTImmutableCString fmtstring, ...)
588 {
589  if (ttEnvironment->mDebugBasic) {
590  char str[4096];
591  char fullstr[4096];
592  va_list ap;
593 
594  va_start(ap, fmtstring);
595  vsnprintf(str, 4000, fmtstring, ap);
596  va_end(ap);
597  str[4095] = 0;
598 
599  strncpy(fullstr, classPtr->name.c_str(), 4095);
600  strncat(fullstr, " : ", 4095);
601  strncat(fullstr, str, 4095);
602  TTLogDebug(fullstr);
603  }
604  return kTTErrNone;
605 }
606 
TTErr sendMessage(const TTSymbol name)
TODO: Document this function.
TTFOUNDATION_EXPORT TTDataInfoPtr ttDataTypeInfo[kNumTTDataTypes]
An array, indexed by values from TTDataType, containing information about those data types...
Definition: TTBase.cpp:424
TTErr(TTObjectBase::* TTSetterMethod)(const TTAttribute &attribute, const TTValue &value)
A type that can be used to store a pointer to a message for an object.
Definition: TTObjectBase.h:78
TTErr registerMessageProperty(const TTSymbol messageName, const TTSymbol propertyName, const TTValue &initialValue, TTGetterMethod getter, TTSetterMethod setter)
Register an message property.
std::uint16_t TTUInt16
16 bit unsigned integer
Definition: TTBase.h:176
TTErr registerObserverForNotifications(const TTObject &observingObject)
Register an observer.
The default set of flags will be used if this is specified. At this time the default is #kTTMethodPas...
Definition: TTObjectBase.h:85
void getSetterFlags(TTAttributeFlags &currentFlags)
Get the current setterFlag property of the attribute, describing the behavior of the attribute setter...
TTErr(TTObjectBase::* TTMethodOutputValue)(TTValue &anOutputValue)
A type that can be used to call a message for an object that does not declare the name argument...
Definition: TTObjectBase.h:62
TTErr getAttributeSetterFlags(const TTSymbol name, TTAttributeFlags &value)
Get the setterFlags of an attribute.
Create Jamoma object instances.
This class represents a single message, as used by the TTObjectBase class.
Definition: TTMessage.h:55
TTErr unregisterObserverForNotifications(const TTObject &observingObject)
Unregister an observer for notifications.
TTErr getMessage(const TTSymbol name, TTMessagePtr *messageObject)
Search for and locate a message.
Definition: TTObjectBase.h:360
TTErr lookup(const TTSymbol key, TTValue &value)
Find the value for the given key.
Definition: TTHash.cpp:76
The TTClass object represents a class in the Jamoma environment.
TTDataType type
The data type of the attribute value.
Definition: TTAttribute.h:84
TTFOUNDATION_EXPORT TTEnvironment * ttEnvironment
The environment object has one instance, which is global in scope.
TTErr logMessage(TTImmutableCString fmtstring,...)
Log messages scoped to this object instance.
TTErr setAttributeGetterFlags(const TTSymbol name, TTAttributeFlags &value)
Set the getterFlags of an attribute.
TTErr removeAttribute(const TTSymbol name)
Remove an attribute.
TTBoolean hidden
Property: this message is private/hidden from outside usage.
Definition: TTMessage.h:61
TTErr logError(TTImmutableCString fmtstring,...)
Log errors scoped to this object instance.
TTSymbol getName() const
Return the name of this class.
TTErr setAttributeSetterFlags(const TTSymbol name, TTAttributeFlags &value)
Set the setterFlags of an attribute.
Create and use Jamoma object instances.
Definition: TTObject.h:29
size_type size() const noexcept
Return the number of elements.
TTMethod method
method associated with this message.
Definition: TTMessage.h:60
TTDataType
TTBlue Data Types Enumeration of data types used through out TTBlue, including the TTValue class and ...
Definition: TTBase.h:269
TTUInt32 getSize()
Return the number of keys in the hash table.
Definition: TTHash.cpp:199
TTErr sendNotification(const TTSymbol name, const TTValue &arguments)
Send a notification.
TTErr(TTObjectBase::* TTMethodValue)(const TTValue &anInputValue, TTValue &anOutputValue)
A type that can be used to call a message for an object that does not declare the name argument...
Definition: TTObjectBase.h:52
TTErr getAttributeValue(const TTSymbol name, TTValue &value)
Get an attribute value for an object.
TTErr getKeys(TTValue &hashKeys)
Get an array of all of the keys for the hash table.
Definition: TTHash.cpp:126
This class represents a single attribute, as used by the TTObjectBase class.
Definition: TTAttribute.h:79
TTValue mDefaultValue
Property: the default value for this attribute.
Definition: TTAttribute.h:100
TTSetterMethod setter
Method to set the attribute value.
Definition: TTAttribute.h:87
Base class for all first-class Jamoma objects.
Definition: TTObjectBase.h:109
TTErr findMessage(const TTSymbol name, TTMessage **message)
Find a message registered with this object.
TTErr(TTObjectBase::* TTMethod)(const TTSymbol methodName, const TTValue &anInputValue, TTValue &anOutputValue)
A type that can be used to store a pointer to a message for an object.
Definition: TTObjectBase.h:46
TTErr removeMessage(const TTSymbol name)
Remove a message.
TTErr registerAttribute(const TTSymbol name, const TTDataType type, void *address)
Register an attribute.
TTErr logDebug(TTImmutableCString fmtstring,...)
Log messages (scoped to this object instance) to output only if the basic debugging flag is enabled i...
TTErr setAttributeValue(const TTSymbol name, TTValue &value)
Set an attribute value for an object.
Maintain a collection of TTValue objects indexed by TTSymbol pointers.
Definition: TTHash.h:36
This is a special type used by TTAttribute to indicate that a value is a TTValue and is locally maint...
Definition: TTBase.h:286
TTErr registerMessage(const TTSymbol name, TTMethod method)
Register a message with this object.
void append(const T &anElementValueToAppend)
Insert a single TTElement at the end.
Definition: TTValue.h:243
void * TTPtr
A generic pointer.
Definition: TTBase.h:248
TTMessageFlags
Flags that determine the behavior of messages.
Definition: TTObjectBase.h:84
void cliplow(const TTFloat64 &aLowBound)
Clip numerical values below a specified boundary.
Definition: TTValue.h:289
TTBoolean hidden
Property: this attribute is private/invisible to the outside world.
Definition: TTAttribute.h:98
void setGetterFlags(TTAttributeFlags newFlags)
Set the getterFlag property of the attribute, defining the behavior of the attribute getter method...
Definition: TTAttribute.cpp:86
Attribute accessors will first be passed a reference to the TTAttribute object, then it will be passe...
Definition: TTObjectBase.h:97
The TTSymbol class is used to represent a string and efficiently pass and compare that string...
Definition: TTSymbol.h:26
void getMessageNames(TTValue &messageNameList)
Return a list of names of the available messages.
TTErr append(const TTSymbol key, const TTValue &value)
Insert an item into the hash table.
Definition: TTHash.cpp:70
void TTFOUNDATION_EXPORT TTLogError(TTImmutableCString message,...)
Platform and host independent method for posting errors.
Definition: TTBase.cpp:572
TTSymbol getAttributeType(const TTSymbol name)
Return the type of an attribute as a symbol.
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) ...
TTAttributeFlags setterFlags
Define the behavior of the attribute setter method.
Definition: TTAttribute.h:91
TTObjectBase(const TTValue arguments)
Constructor.
TTBoolean mDebugBasic
Attribute: Basic debug functionality is enabled when true.
Definition: TTEnvironment.h:53
void cliphigh(const TTFloat64 &aHighBound)
Clip numerical values above a specified boundary.
Definition: TTValue.h:299
TTErr logWarning(TTImmutableCString fmtstring,...)
Log warnings scoped to this object instance.
TTErr(TTObjectBase::* TTMethodNone)()
A type that can be used to call a message for an object that does not declare any arguments...
Definition: TTObjectBase.h:67
const char * c_str() const
Return a pointer to the internal string as a C-string.
Definition: TTSymbol.h:77
TTErr getAttributeGetterFlags(const TTSymbol name, TTAttributeFlags &value)
Get the getterFlags of an attribute.
TTBoolean mDebugMessaging
Attribute: Should all message traffic be logged?
Definition: TTEnvironment.h:54
void clip(const TTFloat64 &aLowBound, const TTFloat64 &aHighBound)
Clip numerical values between low and high boundaries.
Definition: TTValue.h:279
void clear()
Clear all values from the vector, leaving with size of 0.
Definition: TTValue.h:131
TTFloat64 rangeLowBound
If the range property is defined, this is the bottom of a value's range.
Definition: TTAttribute.h:95
TTEnvironment is a global object providing information on the environemt.
void TTFOUNDATION_EXPORT TTLogWarning(TTImmutableCString message,...)
Platform and host independent method for posting warnings.
Definition: TTBase.cpp:553
void TTFOUNDATION_EXPORT TTLogMessage(TTImmutableCString message,...)
Platform and host independent method for posting log messages.
Definition: TTBase.cpp:534
void getGetterFlags(TTAttributeFlags &currentFlags)
Get the current getterFlag property of the attribute, describing the behavior of the attribute getter...
Definition: TTAttribute.cpp:91
TTErr remove(const TTSymbol key)
Remove an item from the hash table.
Definition: TTHash.cpp:108
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
Definition: TTBase.h:342
TTErr registerAttributeProperty(const TTSymbol attributeName, const TTSymbol propertyName, const TTValue &initialValue, TTGetterMethod getter, TTSetterMethod setter)
Register an attribute property.
void setSetterFlags(TTAttributeFlags newFlags)
Set the setterFlag property of the attribute, defining the behavior of the attribute setter method...
Definition: TTAttribute.cpp:96
std::uint32_t TTUInt32
32 bit unsigned integer
Definition: TTBase.h:178
void TTFOUNDATION_EXPORT TTLogDebug(TTImmutableCString message,...)
Platform and host independent method for posting messages only when debugging is enabled in the envir...
Definition: TTBase.cpp:591
TTFloat64 rangeHighBound
If the range property is defined, this is the top of a value's range.
Definition: TTAttribute.h:96
virtual ~TTObjectBase()
Destructor.
TTAttributeFlags getterFlags
Define the behavior of the attribute getter method.
Definition: TTAttribute.h:90
TTAttributeFlags
Flags that determine the behavior of messages.
Definition: TTObjectBase.h:94
No Error.
Definition: TTBase.h:343
TTErr(TTObjectBase::* TTMethodInputValue)(const TTValue &anInputValue)
A type that can be used to call a message for an object that does not declare the name argument...
Definition: TTObjectBase.h:57
TTGetterMethod getter
Method to fetch the attribute value.
Definition: TTAttribute.h:86
Set this flag if the method you are binding to this message is prototyped to accept no arguments...
Definition: TTObjectBase.h:86
Method not found. Typically returned by the TTObject::sendMessage() function.
Definition: TTBase.h:351
TTSymbol rangeChecking
If the rangeChecking property is defined, the value should be checked for range and modified accordin...
Definition: TTAttribute.h:97
TTErr(TTObjectBase::* TTGetterMethod)(const TTAttribute &attribute, TTValue &value)
A type that can be used to store a pointer to a message for an object.
Definition: TTObjectBase.h:73
TTMessageFlags flags
define the behavior of the message.
Definition: TTMessage.h:59
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34
void getAttributeNames(TTValue &attributeNameList)
Return a list of names of the available attributes.
Bad Attribute specified.
Definition: TTBase.h:348
TTBoolean readOnly
The readonly property, if defined, means an attribute cannot be set.
Definition: TTAttribute.h:94
Set this flag if the method you are binding to this message is prototyped with two arguments: a const...
Definition: TTObjectBase.h:88
TTList observers
List of all objects watching this object for life-cycle and other changes.
Definition: TTObjectBase.h:117
TTErr findAttribute(const TTSymbol name, TTAttribute **attr)
Find an attribute.
Attempted a write to a read-only entity.
Definition: TTBase.h:354