Jamoma API  0.6.0.a19
TTGraphDescription.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup graphLibrary
4  *
5  * @brief Jamoma Asynchronous Object Graph Layer
6  *
7  * @details Creates a wrapper for TTObjectBases that can be used to build a control graph for asynchronous message passing
8  *
9  * @authors Timothy Place
10  *
11  * @copyright Copyright © 2010 by Timothy Place @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 __TTGRAPH_DESCRIPTION_H__
18 #define __TTGRAPH_DESCRIPTION_H__
19 
20 #include "TTGraph.h"
21 
22 
23 /******************************************************************************************/
24 
25 class TTGraphDescription;
26 typedef std::vector<TTGraphDescription> TTGraphDescriptionVector;
27 typedef TTGraphDescriptionVector::iterator TTGraphDescriptionIter;
28 
29 typedef std::vector<TTString> TTStringVector;
30 typedef TTStringVector::iterator TTStringVectorIter;
31 
32 
33 /** This object represents a single 'outlet' from a #TTGraphObjectBase.
34  #TTGraphObjectBase maintains a vector of these outlets.
35 */
36 
37 class TTGRAPH_EXPORT TTGraphDescription {
38 public:
39  TTSymbol mClassName;
40  TTGraphDescriptionVector mInputDescriptions;
41  TTObject mObjectInstance;
42 
43  TTInt32 mID; ///< An index number that uniquely identifies this instance
44  TTPtr mUserData; ///< A place for a descriptions' user to store custom information, per node
45 
46  static TTInt32 sIndex; ///< Used for creating mID
47 
48 
50  mObjectInstance(),
51  mUserData(NULL)
52  {
53  ;
54  }
55 
56 
57  TTGraphDescription& operator = (const TTGraphDescription &newValue)
58  {
59  // inherited
60  mClassName = newValue.mClassName;
61  mInputDescriptions = newValue.mInputDescriptions;
62  mObjectInstance = newValue.mObjectInstance;
63  mID = newValue.mID;
64  mUserData = newValue.mUserData;
65 
66  // audio specific
67 // mAudioDescriptionsForInlets = newValue.mAudioDescriptionsForInlets;
68 // mControlDescription = newValue.mControlDescription;
69 // mOutletNumber = newValue.mOutletNumber;
70 // mNumInlets = newValue.mNumInlets;
71 // mNumOutlets = newValue.mNumOutlets;
72 
73  return *this;
74  }
75 
76 
77  void exportRuby(const TTString& fullpathToFile);
78  int exportRubyNode(TTString& rubyContent, int& index, TTStringVector& nodeNames);
79 
80  void exportCpp(const TTString& fullpathToFile);
81  int exportCppNode(TTString& content, int& index, TTStringVector& nodeNames);
82 
83  void exportMax(const TTString& fullpathToFile);
84  int exportMaxNode(TTString& content, int& index, TTStringVector& nodeNames);
85 
86 
87 };
88 
90 
91 
92 #endif // __TTGRAPH_DESCRIPTION_H__
TTPtr mUserData
A place for a descriptions' user to store custom information, per node.
Jamoma Asynchronous Object Graph Layer.
Create and use Jamoma object instances.
Definition: TTObject.h:29
void * TTPtr
A generic pointer.
Definition: TTBase.h:248
The TTSymbol class is used to represent a string and efficiently pass and compare that string...
Definition: TTSymbol.h:26
std::int32_t TTInt32
32 bit signed integer
Definition: TTBase.h:177
static TTInt32 sIndex
Used for creating mID.
TTInt32 mID
An index number that uniquely identifies this instance.
The TTString class is used to represent a string.
Definition: TTString.h:34
This object represents a single 'outlet' from a TTGraphObjectBase.