Jamoma API  0.6.0.a19
TTReceiver.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup modularLibrary
4  *
5  * @brief A Receiver Object
6  *
7  * @details
8  *
9  * @authors Théo de la Hogue
10  *
11  * @copyright © 2010, Théo de la Hogue @n
12  * This code is licensed under the terms of the "New BSD License" @n
13  * http://creativecommons.org/licenses/BSD/
14  */
15 
16 
17 #ifndef __TT_RECEIVER_H__
18 #define __TT_RECEIVER_H__
19 
20 #include "TTModularIncludes.h"
21 
22 /** TTReceiver ... TODO : an explanation
23 
24 
25  */
26 
27 class TTMODULAR_EXPORT TTReceiver : public TTObjectBase
28 {
30 
31 public: // use public for quick acces during signal processing
32 
33  TTObject mSignal; ///< any data structure to receive complex signal
34 
35 private:
36 
37  TTAddress mAddress; ///< ATTRIBUTE : the address to bind
38  TTBoolean mActive; ///< ATTRIBUTE : if false, received data won't be output without unregister the attribute observer (default true).
39 
40  TTObject mReturnAddressCallback; ///< a way to return received address to the owner of this receiver
41  TTObject mReturnValueCallback; ///< a way to return received value to the owner of this receiver
42  TTObject mAddressObserver; ///< an address life cycle observer
43  TTObject mApplicationObserver; ///< an application life cycle observer
44  TTList mNodesObserversCache; ///< a list containing <aNode, anAttrObserver>
45  // TODO JamomaCore #305 : TTList : allow to register as none pointer members
46  TTListPtr mObjectCache; ///< ATTRIBUTE : a cache containing all binded objects for quick access
47 
48  /** Setter for mAddress attribute. */
49  TTErr setAddress(const TTValue& value);
50 
51  /** Setter for mActive attribute. */
52  TTErr setActive(const TTValue& value);
53 
54  /** Getter for mObjectCache attribute. */
55  TTErr getObjectCache(TTValue& value);
56 
57  /** Ask the value and use the callback to return it */
58  TTErr Get();
59 
60  /** Ask the value and use the outputValue to return it.
61  This method is not relevant with address containing wildcards */
62  TTErr Grab(const TTValue& inputValue, TTValue& outputValue);
63 
64  /** */
65  TTErr bindAddress(TTNodeDirectoryPtr aDirectory);
66  void cacheNodeObserver(TTNodePtr aNode, TTAddress& anAddress, TTSymbol& anAttributeName);
67 
68  /** */
69  TTErr unbindAddress(TTNodeDirectoryPtr aDirectory);
70  void uncacheNodeObserver(TTNodePtr aNode, TTObject& oldObserver, TTSymbol& anAttributeName);
71 
72  /** */
73  TTErr bindApplication();
74 
75  /** */
76  TTErr unbindApplication();
77 
78  friend TTErr TTMODULAR_EXPORT TTReceiverDirectoryCallback(const TTValue& baton, const TTValue& data);
79  friend TTErr TTMODULAR_EXPORT TTReceiverAttributeCallback(const TTValue& baton, const TTValue& data);
80  friend TTErr TTMODULAR_EXPORT TTReceiverApplicationManagerCallback(const TTValue& baton, const TTValue& data);
81 
82 };
83 
84 typedef TTReceiver* TTReceiverPtr;
85 
86 /**
87  @param baton ..
88  @param data ..
89  @return an error code */
90 TTErr TTMODULAR_EXPORT TTReceiverDirectoryCallback(const TTValue& baton, const TTValue& data);
91 
92 /**
93  @param baton ..
94  @param data ..
95  @return an error code */
96 TTErr TTMODULAR_EXPORT TTReceiverAttributeCallback(const TTValue& baton, const TTValue& data);
97 
98 /**
99  @param baton ..
100  @param data ..
101  @return an error code */
102 TTErr TTMODULAR_EXPORT TTReceiverApplicationManagerCallback(const TTValue& baton, const TTValue& data);
103 
104 #endif // __TT_RECEIVER_H__
bool TTBoolean
Boolean flag, same as Boolean on the Mac.
Definition: TTBase.h:167
TTModular Library.
TTErr TTMODULAR_EXPORT TTReceiverApplicationManagerCallback(const TTValue &baton, const TTValue &data)
Definition: TTReceiver.cpp:595
We build a directory of TTNodes, and you can request a pointer for any TTNode, or add an observer to ...
Definition: TTNode.h:59
TTReceiver ...
Definition: TTReceiver.h:27
The TTAddress class is used to represent a string and efficiently pass and compare that string...
Definition: TTAddress.h:29
Create and use Jamoma object instances.
Definition: TTObject.h:29
TTErr TTMODULAR_EXPORT TTReceiverAttributeCallback(const TTValue &baton, const TTValue &data)
Definition: TTReceiver.cpp:571
Base class for all first-class Jamoma objects.
Definition: TTObjectBase.h:109
#define TTCLASS_SETUP(className)
TODO Doxygen: need more comments here.
Definition: TTFoundation.h:54
The TTSymbol class is used to represent a string and efficiently pass and compare that string...
Definition: TTSymbol.h:26
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
Definition: TTBase.h:342
TTObject mSignal
any data structure to receive complex signal
Definition: TTReceiver.h:33
We build a tree of TTNodes, and you can request a pointer for any TTNode, or add an observer to any T...
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34
TTErr TTMODULAR_EXPORT TTReceiverDirectoryCallback(const TTValue &baton, const TTValue &data)
Definition: TTReceiver.cpp:452