Jamoma API  0.6.0.a19
TTProtocol.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup modularLibrary
4  *
5  * @brief A Protocol interface
6  *
7  * @details
8  *
9  * @author Laurent Garnier, Théo de la Hogue
10  *
11  * @copyright © 2011, Laurent Garnier, 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_PROTOCOL_H__
18 #define __TT_PROTOCOL_H__
19 
20 #include "TTFoundationAPI.h"
21 
22 /** Declares instantiation and registration methods to add the protocol class as any #TTObject class */
23 #define TT_PROTOCOL_CONSTRUCTOR \
24 TTObjectBasePtr thisTTClass :: instantiate (TTSymbol name, TTValue arguments) {return new thisTTClass (arguments);} \
25 \
26 extern "C" void thisTTClass :: registerClass () {TTClassRegister( TTSymbol(thisTTClassName), thisTTClassTags, thisTTClass :: instantiate );} \
27 \
28 thisTTClass :: thisTTClass (const TTValue& arguments) : TTProtocol(arguments)
29 
30 /** Declares all members needed by any protocol class */
31 #define TT_PROTOCOL_INITIALIZE \
32 mName = TTSymbol(thisTTClassName); \
33 mVersion = TTSymbol(thisProtocolVersion); \
34 mAuthor = TTSymbol(thisProtocolAuthor); \
35 mGet = TTBoolean(thisProtocolGet); \
36 mSet = TTBoolean(thisProtocolSet); \
37 mListen = TTBoolean(thisProtocolListen); \
38 mDiscover = TTBoolean(thisProtocolDiscover); \
39 mDiscoverAll = TTBoolean(thisProtocolDiscoverAll); \
40 registerAttribute(TTSymbol("parameterNames"), kTypeLocalValue, NULL, (TTGetterMethod)& thisTTClass::getParameterNames); \
41 
42 /** Declares specific accessors methods to manage the parameter value in order to have one value per registered applications */
43 #define TT_PROTOCOL_PARAMETER(name) \
44 TTErr get##name(TTValue& value) {TTString _attrname_##name(#name); _attrname_##name.at(0)=tolower(_attrname_##name.at(0)); return getApplicationParameters(TTSymbol(_attrname_##name),value);}; \
45 TTErr set##name(const TTValue& value) {TTString _attrname_##name(#name); _attrname_##name.at(0)=tolower(_attrname_##name.at(0)); return setApplicationParameters(TTSymbol(_attrname_##name),value);}; \
46 
47 /** Add a protocol parameter as an attribute of the class */
48 #define addAttributeAsProtocolParameter(name, type) \
49 TTString _attrname_##name(#name); _attrname_##name.at(0)=tolower(_attrname_##name.at(0)); registerAttribute(_attrname_##name, type, NULL, (TTGetterMethod)& thisTTClass ::get##name, (TTSetterMethod)& thisTTClass ::set##name ); mParameterNames.append(TTSymbol(_attrname_##name)) \
50 
51 /** Macro to update and get the local application name (to use only inside the protocol class) */
52 #define accessProtocolLocalApplicationName ProtocolGetLocalApplicationName(TTObjectBasePtr(this))
53 
54 /****************************************************************************************************/
55 // Class Specification
56 
57 /** TTProtocol is the base class for all protocol protocol.
58  It still has knowledge and support for ...
59  */
60 class TTProtocol : public TTObjectBase {
61 
62 protected:
63  TTObject mApplicationManager; ///< the application manager of the Modular framework.
64  ///< protocol programmers should not have to deal with this member.
65 
66  TTSymbol mLocalApplicationName; ///< cache local application name
67 
68  TTObject mActivityInCallback; ///< a callback to trace raw incoming messages.
69  TTObject mActivityOutCallback; ///< a callback to trace raw outputing messages.
70 
71  TTHash mApplicationParameters; ///< ATTRIBUTE : hash table containing hash table of parameters
72  ///< for each application registered for communication with this protocol
73  ///< <TTSymbol applicationName, <TTSymbol parameterName, TTValue value>>
74 
75 public:
76  TTSymbol mName; ///< ATTRIBUTE : the name of the protocol to use
77  TTSymbol mVersion; ///< ATTRIBUTE : the version of the protocol
78  TTSymbol mAuthor; ///< ATTRIBUTE : the author of the protocol
79  TTBoolean mGet; ///< ATTRIBUTE : is the Protocol allows to send get request ?
80  TTBoolean mSet; ///< ATTRIBUTE : is the Protocol allows to send set request ?
81  TTBoolean mListen; ///< ATTRIBUTE : is the Protocol allows to send listen request ?
82  TTBoolean mDiscover; ///< ATTRIBUTE : is the Protocol allows to send discover request ?
83  TTBoolean mDiscoverAll; ///< ATTRIBUTE : is the Protocol allows to send discover all request ?
84  TTBoolean mRunning; ///< ATTRIBUTE : is the Protocol reception thread enable ?
85  TTBoolean mActivity; ///< ATTRIBUTE : is the Protocol activity thread enable ?
86 
87  TTSymbol mSelectedApplication; ///< internal symbol to select an application to access to its own parameters
88  ///< note : a protocol developper have to use PROTOCOL_PARAMETERto declare specific accessors for a protocol parameter
89  ///< this allows to manage one parameter value per registered application
90 
91  TTValue mParameterNames; ///< store the name of the protocol parameters
92 
93  /** Constructor
94  @param arguments #TTApplicationManager object, #TTCallback for activity in, #TTCallback for activity out */
95  TTProtocol(const TTValue& arguments);
96 
97  /** Destructor */
98  virtual ~TTProtocol();
99 
100  /** Set application manager
101  @param[in] value #TTApplicationManager object
102  @return #TTErr error code */
103  TTErr setApplicationManager(const TTValue& value);
104 
105  /** Register an application as a client of the protocol
106  @details This method allocate a TTHash to store parameters
107  @param[in] inputValue #TTSymbol application name
108  @param[out] outputValue nothing
109  @return #TTErr error code */
110  TTErr ApplicationRegister(const TTValue& inputValue, TTValue& outputValue);
111 
112  /** Rename an application
113  @param[in] inputValue #TTSymbol old application name, #TTSymbol new application name
114  @param[out] outputValue nothing
115  @return #TTErr error code */
116  TTErr ApplicationRename(const TTValue& inputValue, TTValue& outputValue);
117 
118  /** Unregister an application as a client of the protocol
119  @details This method deallocate a TTHash used to store parameters
120  @param[in] inputValue #TTSymbol application name
121  @param[out] outputValue nothing
122  @return #TTErr error code */
123  TTErr ApplicationUnregister(const TTValue& inputValue, TTValue& outputValue);
124 
125  /** Select an application to access to its own parameters value
126  @param[in] inputValue #TTSymbol application name
127  @param[out] outputValue nothing
128  @return #TTErr error code
129  @seealso getApplicationParameters, setApplicationParameters, PROTOCOL_PAREMETER_ACCESSORS */
130  TTErr ApplicationSelect(const TTValue& inputValue, TTValue& outputValue);
131 
132  /** Select the local application to access to its own parameters value
133  @return #TTErr error code
134  @seealso getApplicationParameters, setApplicationParameters, PROTOCOL_PAREMETER_ACCESSORS */
136 
137  /** Get parameters needed by this protocol
138  @param[out] value returned parameter names */
140 
141  /** Internal accessor to get the parameter of an application
142  @param[in] parameterName the name of the parameter to get
143  @param[out] value returned the selected parameter for the selected application */
144  TTErr getApplicationParameters(TTSymbol parameterName, TTValue& value);
145 
146  /** Internal accessor to set the parameter of an application
147  @param[in] parameterName the name of the parameter to set
148  @param[in] value value for selected parameter for the selected application */
149  TTErr setApplicationParameters(TTSymbol parameterName, const TTValue& value);
150 
151  /** Get the names of the registered applications */
153 
154  /** Is an application registered for this protocol ? */
155  TTErr isRegistered(const TTValue& inputValue, TTValue& outputValue);
156 
157 
158  /** Scan to find remote applications and add them to the application manager
159  @param inputValue : anything needed for scanning
160  @param outputValue : all remote device informations
161  @return errorcode : return a kTTErrGeneric if the protocol fails to start or if it was running already
162  */
163  virtual TTErr Scan(const TTValue& inputValue, TTValue& outputValue)=0;
164 
165  /*!
166  * Run reception thread mechanism for the local application only
167  @param inputValue : nothing to run all registered applications or a #TTSymbol application name
168  @param outputValue : any informations relative to a failure when running the protocol
169  @return errorcode : return a kTTErrGeneric if the protocol fails to start or if it was running already
170  */
171  virtual TTErr Run(const TTValue& inputValue, TTValue& outputValue)=0;
172 
173  /*!
174  * Stop the reception thread mechanism for the local application only
175  @param inputValue : nothing to stop all registered applications or a #TTSymbol application name
176  @param outputValue : any informations relative to a failure when stopping the protocol
177  @return errorcode : return a kTTErrGeneric if the protocol fails to stop or if it was already stopped
178  */
179  virtual TTErr Stop(const TTValue& inputValue, TTValue& outputValue)=0;
180 
181  /**************************************************************************************************************************
182  *
183  * SEND REQUEST METHODS
184  *
185  **************************************************************************************************************************/
186 
187  /*!
188  * Send a discover request to an application to get a part of the namespace at the given address
189  *
190  @param to : the application where to discover
191  @param address : the address to discover
192  @param returnedType : the type of the node at the address (default is none which means no type)
193  @param returnedChildren : all names of nodes below the address
194  @param returnedAttributes : all attributes of the node at the address
195  @param tryCount : number of try for this request
196  @return errorcode : kTTErrNone means the answer has been received, kTTErrValueNotFound means something is bad in the request
197  else it returns kTTErrGeneric if no answer or timeout
198  */
199  virtual TTErr SendDiscoverRequest(TTSymbol to, TTAddress address,
200  TTSymbol& returnedType,
201  TTValue& returnedChildren,
202  TTValue& returnedAttributes,
203  TTUInt8 tryCount=0)=0;
204 
205  /*!
206  * Send a discover all request to an application to fill all the directory under this address
207  *
208  @param to : the application where to discover
209  @param address : the address to discover
210  @param node : the node for this address
211  @param tryCount : number of try for this request
212  @return errorcode : kTTErrNone means the answer has been received, kTTErrValueNotFound means something is bad in the request
213  else it returns kTTErrGeneric if no answer or timeout
214  */
215  virtual TTErr SendDiscoverAllRequest(TTSymbol to, TTAddress address,
216  TTNodePtr node,
217  TTUInt8 tryCount=0)=0;
218 
219  /*!
220  * Send a get request to an application to get a value at the given address
221  *
222  @param to : the application where to get
223  @param address : the address to get
224  @param returnedValue : the value which is going to be filled
225  @param tryCount : number of try for this request
226  @return errorcode : kTTErrNone means the answer has been received, kTTErrValueNotFound means something is bad in the request
227  else it returns kTTErrGeneric if no answer or timeout
228  */
229  virtual TTErr SendGetRequest(TTSymbol to, TTAddress address,
230  TTValue& returnedValue,
231  TTUInt8 tryCount=0)=0;
232 
233  /*!
234  * Send a set request to set a value of a specific application
235  *
236  @param to : the application where to set
237  @param address : the address to set
238  @param value : anything to send
239  @param tryCount : number of try for this request
240  @return errorcode : kTTErrNone means the answer has been received, kTTErrValueNotFound means something is bad in the request
241  */
242  virtual TTErr SendSetRequest(TTSymbol to, TTAddress address,
243  TTValue& value,
244  TTUInt8 tryCount=0)=0;
245 
246  /*!
247  * Send a listen request to a specific application
248  *
249  @param to : the application where to listen
250  @param address : the address to listen
251  @param attribute : the attribute to listen
252  @param enable : enable/disable the listening
253  @param tryCount : number of try for this request
254  @return errorcode : kTTErrNone means the answer has been received, kTTErrValueNotFound means something is bad in the request
255  */
256  virtual TTErr SendListenRequest(TTSymbol to, TTAddress address,
257  TTBoolean enable,
258  TTUInt8 tryCount=0)=0;
259 
260 
261  /**************************************************************************************************************************
262  *
263  * SEND ANSWER METHODS
264  *
265  **************************************************************************************************************************/
266 
267  /*!
268  * Send a disover answer to a application which ask for.
269  *
270  @param to : the application where to send answer
271  @param address : the address where comes from the description
272  @param returnedType : the type of the node at the address (default is none which means no type)
273  @param returnedChildren : all names of nodes below the address
274  @param returnedAttributes : all attributes the node at the address
275  */
276  virtual TTErr SendDiscoverAnswer(TTSymbol to, TTAddress address,
277  TTSymbol& returnedType,
278  TTValue& returnedChildren,
279  TTValue& returnedAttributes,
280  TTErr err=kTTErrNone)=0;
281 
282  /*!
283  * Send a discover answer to a application which ask for.
284  *
285  @param to : the application where to send answer
286  @param address : the address where comes from the description
287  @param node : the node for this address
288  */
289  virtual TTErr SendDiscoverAllAnswer(TTSymbol to, TTAddress address,
290  TTNodePtr node,
291  TTErr err=kTTErrNone)=0;
292 
293  /*!
294  * Send a get answer to a application which ask for.
295  *
296  @param to : the application where to send answer
297  @param address : the address where comes from the value
298  @param returnedValue : the value of the attribute at the address
299  */
300  virtual TTErr SendGetAnswer(TTSymbol to, TTAddress address,
301  const TTValue& returnedValue,
302  TTErr err=kTTErrNone)=0;
303 
304  /*!
305  * Send a listen answer to a application which ask for.
306  *
307  @param to : the application where to send answer
308  @param address : the address where comes from the value
309  @param returnedValue : the value of the attribute at the address
310  */
311  virtual TTErr SendListenAnswer(TTSymbol to, TTAddress address,
312  const TTValue& returnedValue,
313  TTErr err=kTTErrNone)=0;
314 
315  /**************************************************************************************************************************
316  *
317  * RECEIVE REQUEST METHODS (BUILT-IN METHODS)
318  *
319  **************************************************************************************************************************/
320 
321  /*!
322  * Notify the protocol that an application ask for a namespace description
323  *
324  * !!! This a built-in protocol method which sends automatically the answer (or a notification if error)
325  *
326  @param from : the application where comes from the request
327  @param address : the address the application wants to discover
328  */
330 
331  /*!
332  * Notify the protocol that an application ask for a namespace description
333  *
334  * !!! This a built-in protocol method which sends automatically the answer (or a notification if error)
335  *
336  @param from : the application where comes from the request
337  @param address : the address the application wants to discover
338  */
340 
341  /*!
342  * Notify the protocol that an application ask for value
343  *
344  * !!! This a built-in protocol method which sends automatically the answer (or a notification if error)
345  *
346  @param from : the application where comes from the request
347  @param address : the address the application wants to get
348  */
349  TTErr ReceiveGetRequest(TTSymbol from, TTAddress address);
350 
351  /*!
352  * Notify the protocol that an application wants to set value
353  *
354  * !!! This a built-in protocol method which set automatically the value (or send a notification if error)
355  *
356  @param from : the application where comes from the request
357  @param address : the address the application wants to get
358  @param newValue : the incoming value
359  */
360  TTErr ReceiveSetRequest(TTSymbol from, TTAddress address, const TTValue& newValue);
361 
362  /*!
363  * Notify the protocol that an application wants to listen (or not) the namespace
364  *
365  * !!! This a built-in protocol method which create/remove automatically the listener (or send a notification if error)
366  *
367  @param from : the application where comes from the request
368  @param address : the address the application wants to listen
369  @param enable : enable/disable the listening
370  */
371  TTErr ReceiveListenRequest(TTSymbol from, TTAddress address, TTBoolean enable);
372 
373  /**************************************************************************************************************************
374  *
375  * RECEIVE ANSWER METHODS : each protocol deals with answers when it send a request except for listening mechanism
376  * note : maybe we could add a listen answer manager because each protocol have to remember
377  * which listen requests has been done (?)
378  *
379  **************************************************************************************************************************/
380 
381  /*!
382  * Notify the protocol that an application answers to a listen request
383  *
384  * !!! This a built-in protocol method notify automatically the listener (or send a notification if error)
385  *
386  @param from : the application where comes from the answer
387  @param address : the address where comes from the answer
388  @param newValue : the answered value
389  */
390  TTErr ReceiveListenAnswer(TTSymbol from, TTAddress address, const TTValue& newValue);
391 
392  /**************************************************************************************************************************
393  *
394  * ACTIVITY METHOD : a set of built-in methods to report raw incoming or outputing messages to the manager
395  *
396  **************************************************************************************************************************/
397 
398  /*!
399  * Notify the protocol that a message is arriving
400  *
401  * !!! This a built-in protocol method
402  *
403  @param message : an incoming message
404  */
405  TTErr ActivityInMessage(const TTValue& message);
406 
407  /*!
408  * Notify the protocol that a message is outputing
409  *
410  * !!! This a built-in protocol method
411  *
412  @param message : an outputing message
413  */
414  TTErr ActivityOutMessage(const TTValue& message);
415 
416 
417 
418  friend TTErr TT_EXTENSION_EXPORT ProtocolDirectoryCallback(const TTValue& baton, const TTValue& data);
419  friend TTErr TT_EXTENSION_EXPORT ProtocolAttributeCallback(const TTValue& baton, const TTValue& data);
420 
421  friend TTErr TT_EXTENSION_EXPORT ProtocolGetAttributeCallback(const TTValue& baton, const TTValue& data);
422  friend TTErr TT_EXTENSION_EXPORT ProtocolSetAttributeCallback(const TTValue& baton, const TTValue& data);
423  friend TTErr TT_EXTENSION_EXPORT ProtocolSendMessageCallback(const TTValue& baton, const TTValue& data);
424  friend TTErr TT_EXTENSION_EXPORT ProtocolListenAttributeCallback(const TTValue& baton, const TTValue& data);
425 
426 };
427 typedef TTProtocol* TTProtocolPtr;
428 
429 /** Called when an application directory send a
430  notification to registered application observers
431  @param baton ..
432  @param data ..
433  @return an error code */
434 TTErr TT_EXTENSION_EXPORT TTProtocolDirectoryCallback(const TTValue& baton, const TTValue& data);
435 
436 /** Called when an application object attribute send a
437  notification to registered application observers
438  @param baton ..
439  @param data ..
440  @return an error code */
441 TTErr TT_EXTENSION_EXPORT TTProtocolAttributeCallback(const TTValue& baton, const TTValue& data);
442 
443 /**
444  @param baton ..
445  @param data ..
446  @return an error code */
447 TTErr TT_EXTENSION_EXPORT TTProtocolGetAttributeCallback(const TTValue& baton, const TTValue& data);
448 
449 /**
450  @param baton ..
451  @param data ..
452  @return an error code */
453 TTErr TT_EXTENSION_EXPORT TTProtocolSetAttributeCallback(const TTValue& baton, const TTValue& data);
454 
455 /**
456  @param baton ..
457  @param data ..
458  @return an error code */
459 TTErr TT_EXTENSION_EXPORT TTProtocolSendMessageCallback(const TTValue& baton, const TTValue& data);
460 
461 /**
462  @param baton ..
463  @param data ..
464  @return an error code */
465 TTErr TT_EXTENSION_EXPORT TTProtocolListenAttributeCallback(const TTValue& baton, const TTValue& data);
466 
467 #endif //__TT_PROTOCOL_H__
468 
469 #ifndef __TT_PROTOCOLLIB_H__
470 #define __TT_PROTOCOLLIB_H__
471 
472 class TT_EXTENSION_EXPORT TTProtocolLib {
473 public:
474 
475  /** Return a list of all available protocols. */
476  static void getProtocolNames(TTValue& protocolNames);
477 };
478 
479 #endif //__TT_PROTOCOLLIB_H__
bool TTBoolean
Boolean flag, same as Boolean on the Mac.
Definition: TTBase.h:167
TTErr TT_EXTENSION_EXPORT TTProtocolSetAttributeCallback(const TTValue &baton, const TTValue &data)
Definition: TTProtocol.cpp:512
virtual TTErr Stop(const TTValue &inputValue, TTValue &outputValue)=0
TTObject mApplicationManager
the application manager of the Modular framework.
Definition: TTProtocol.h:63
TTErr ReceiveListenRequest(TTSymbol from, TTAddress address, TTBoolean enable)
Definition: TTProtocol.cpp:369
TTErr ApplicationUnregister(const TTValue &inputValue, TTValue &outputValue)
Unregister an application as a client of the protocol.
Definition: TTProtocol.cpp:192
virtual TTErr SendDiscoverAllAnswer(TTSymbol to, TTAddress address, TTNodePtr node, TTErr err=kTTErrNone)=0
virtual TTErr SendGetRequest(TTSymbol to, TTAddress address, TTValue &returnedValue, TTUInt8 tryCount=0)=0
TTSymbol mSelectedApplication
internal symbol to select an application to access to its own parameters note : a protocol developper...
Definition: TTProtocol.h:87
We build a directory of TTNodes, and you can request a pointer for any TTNode, or add an observer to ...
Definition: TTNode.h:59
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
TTProtocol is the base class for all protocol protocol.
Definition: TTProtocol.h:60
TTErr ActivityOutMessage(const TTValue &message)
Definition: TTProtocol.cpp:419
Base class for all first-class Jamoma objects.
Definition: TTObjectBase.h:109
TTValue mParameterNames
store the name of the protocol parameters
Definition: TTProtocol.h:91
Maintain a collection of TTValue objects indexed by TTSymbol pointers.
Definition: TTHash.h:36
TTErr ReceiveDiscoverRequest(TTSymbol from, TTAddress address)
Definition: TTProtocol.cpp:291
TTErr ApplicationSelect(const TTValue &inputValue, TTValue &outputValue)
Select an application to access to its own parameters value.
Definition: TTProtocol.cpp:226
virtual TTErr SendListenAnswer(TTSymbol to, TTAddress address, const TTValue &returnedValue, TTErr err=kTTErrNone)=0
virtual ~TTProtocol()
Destructor.
Definition: TTProtocol.cpp:73
TTErr getApplicationParameters(TTSymbol parameterName, TTValue &value)
Internal accessor to get the parameter of an application.
Definition: TTProtocol.cpp:239
TTObject mActivityOutCallback
a callback to trace raw outputing messages.
Definition: TTProtocol.h:69
TTErr isRegistered(const TTValue &inputValue, TTValue &outputValue)
Is an application registered for this protocol ?
Definition: TTProtocol.cpp:279
TTProtocol(const TTValue &arguments)
Constructor.
Definition: TTProtocol.cpp:23
TTSymbol mLocalApplicationName
cache local application name
Definition: TTProtocol.h:66
TTErr setApplicationParameters(TTSymbol parameterName, const TTValue &value)
Internal accessor to set the parameter of an application.
Definition: TTProtocol.cpp:254
virtual TTErr SendListenRequest(TTSymbol to, TTAddress address, TTBoolean enable, TTUInt8 tryCount=0)=0
The TTSymbol class is used to represent a string and efficiently pass and compare that string...
Definition: TTSymbol.h:26
TTErr setApplicationManager(const TTValue &value)
Set application manager.
Definition: TTProtocol.cpp:91
TTBoolean mActivity
ATTRIBUTE : is the Protocol activity thread enable ?
Definition: TTProtocol.h:85
virtual TTErr SendDiscoverAllRequest(TTSymbol to, TTAddress address, TTNodePtr node, TTUInt8 tryCount=0)=0
TTBoolean mGet
ATTRIBUTE : is the Protocol allows to send get request ?
Definition: TTProtocol.h:79
TTErr ApplicationRegister(const TTValue &inputValue, TTValue &outputValue)
Register an application as a client of the protocol.
Definition: TTProtocol.cpp:97
TTErr ApplicationSelectLocal()
Select the local application to access to its own parameters value.
Definition: TTProtocol.cpp:233
TTBoolean mSet
ATTRIBUTE : is the Protocol allows to send set request ?
Definition: TTProtocol.h:80
TTSymbol mAuthor
ATTRIBUTE : the author of the protocol.
Definition: TTProtocol.h:78
virtual TTErr SendGetAnswer(TTSymbol to, TTAddress address, const TTValue &returnedValue, TTErr err=kTTErrNone)=0
virtual TTErr SendDiscoverRequest(TTSymbol to, TTAddress address, TTSymbol &returnedType, TTValue &returnedChildren, TTValue &returnedAttributes, TTUInt8 tryCount=0)=0
TTErr TT_EXTENSION_EXPORT TTProtocolDirectoryCallback(const TTValue &baton, const TTValue &data)
Called when an application directory send a notification to registered application observers...
Definition: TTProtocol.cpp:433
TTSymbol mName
ATTRIBUTE : the name of the protocol to use.
Definition: TTProtocol.h:76
TTErr TT_EXTENSION_EXPORT TTProtocolListenAttributeCallback(const TTValue &baton, const TTValue &data)
Definition: TTProtocol.cpp:560
TTErr ReceiveListenAnswer(TTSymbol from, TTAddress address, const TTValue &newValue)
Definition: TTProtocol.cpp:391
TTErr TT_EXTENSION_EXPORT TTProtocolAttributeCallback(const TTValue &baton, const TTValue &data)
Called when an application object attribute send a notification to registered application observers...
Definition: TTProtocol.cpp:471
TTHash mApplicationParameters
ATTRIBUTE : hash table containing hash table of parameters for each application registered for commun...
Definition: TTProtocol.h:71
TTObject mActivityInCallback
a callback to trace raw incoming messages.
Definition: TTProtocol.h:68
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
Definition: TTBase.h:342
TTBoolean mRunning
ATTRIBUTE : is the Protocol reception thread enable ?
Definition: TTProtocol.h:84
TTErr TT_EXTENSION_EXPORT TTProtocolGetAttributeCallback(const TTValue &baton, const TTValue &data)
Definition: TTProtocol.cpp:488
TTErr ReceiveDiscoverAllRequest(TTSymbol from, TTAddress address)
Definition: TTProtocol.cpp:315
TTBoolean mDiscoverAll
ATTRIBUTE : is the Protocol allows to send discover all request ?
Definition: TTProtocol.h:83
TTErr TT_EXTENSION_EXPORT TTProtocolSendMessageCallback(const TTValue &baton, const TTValue &data)
Definition: TTProtocol.cpp:536
TTBoolean mListen
ATTRIBUTE : is the Protocol allows to send listen request ?
Definition: TTProtocol.h:81
TTErr ApplicationRename(const TTValue &inputValue, TTValue &outputValue)
Rename an application.
Definition: TTProtocol.cpp:160
virtual TTErr SendDiscoverAnswer(TTSymbol to, TTAddress address, TTSymbol &returnedType, TTValue &returnedChildren, TTValue &returnedAttributes, TTErr err=kTTErrNone)=0
TTErr ActivityInMessage(const TTValue &message)
Definition: TTProtocol.cpp:412
No Error.
Definition: TTBase.h:343
TTErr ReceiveGetRequest(TTSymbol from, TTAddress address)
Definition: TTProtocol.cpp:335
TTSymbol mVersion
ATTRIBUTE : the version of the protocol.
Definition: TTProtocol.h:77
virtual TTErr Scan(const TTValue &inputValue, TTValue &outputValue)=0
Scan to find remote applications and add them to the application manager.
virtual TTErr Run(const TTValue &inputValue, TTValue &outputValue)=0
TTErr ReceiveSetRequest(TTSymbol from, TTAddress address, const TTValue &newValue)
Definition: TTProtocol.cpp:352
TTBoolean mDiscover
ATTRIBUTE : is the Protocol allows to send discover request ?
Definition: TTProtocol.h:82
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34
virtual TTErr SendSetRequest(TTSymbol to, TTAddress address, TTValue &value, TTUInt8 tryCount=0)=0
TTErr getParameterNames(TTValue &value)
Get parameters needed by this protocol.
Definition: TTProtocol.h:139
TTErr getApplicationNames(TTValue &value)
Get the names of the registered applications.
Definition: TTProtocol.cpp:273
unsigned char TTUInt8
8 bit unsigned integer (char)
Definition: TTBase.h:174