Jamoma API  0.6.0.a19
TTFoundation.h
1 /*
2  * Jamoma Foundation
3  * Copyright © 2008, Timothy Place
4  *
5  * License: This code is licensed under the terms of the "New BSD License"
6  * http://creativecommons.org/licenses/BSD/
7  */
8 
9 #ifndef __TT_FOUNDATION_H__
10 #define __TT_FOUNDATION_H__
11 
12 #define TTFOUNDATION_VERSION_STRING "0.6"
13 
14 #include "TTBase.h"
15 #include "TTString.h"
16 #include "TTThread.h"
17 #include "TTFifo.h"
18 #include "TTSymbolCache.h"
19 #include "TTNodeLib.h"
20 
21 
22 /*
23  If we could do virtual static methods then we would. But we can't.
24  So enforce the static register() and instantiate() methods we will use the macros to
25  define our classes.
26 
27  This also enforces the protection of the constructor and destructor methods so that they
28  cannot be manipulated directly.
29  */
30 
31  /** TODO Doxygen: need more comments here
32  @ingroup macros
33  */
34 #define TT_OBJECT_CONSTRUCTOR \
35  TTObjectBasePtr thisTTClass :: instantiate (TTSymbol name, const TTValue arguments) {return new thisTTClass (arguments);} \
36  \
37  extern "C" void thisTTClass :: registerClass () {TTClassRegister( thisTTClassName, thisTTClassTags, thisTTClass :: instantiate );} \
38  \
39  thisTTClass :: thisTTClass (const TTValue& arguments) : TTDataObjectBase(arguments)
40 
41  /** TODO Doxygen: need more comments here
42  @ingroup macros
43  */
44 #define TT_BASE_OBJECT_CONSTRUCTOR \
45  TTObjectBasePtr thisTTClass :: instantiate (TTSymbol name, const TTValue arguments) {return new thisTTClass (arguments);} \
46  \
47  extern "C" void thisTTClass :: registerClass () {TTClassRegister( thisTTClassName, thisTTClassTags, thisTTClass :: instantiate );} \
48  \
49  thisTTClass :: thisTTClass (const TTValue& arguments) : TTObjectBase(arguments)
50 
51  /** TODO Doxygen: need more comments here
52  @ingroup macros
53  */
54 #define TTCLASS_SETUP(className) \
55  friend class TTEnvironment; \
56  public: \
57  static void registerClass(); \
58  protected: \
59  static TTObjectBasePtr instantiate (TTSymbol name, const TTValue arguments); \
60  /** Constructor */ \
61  className (const TTValue& arguments); \
62  /** Destructor */ \
63  virtual ~className (); \
64 
65 // ON WINDOWS THERE CAN BE NO SPACE BETWEEN ~ and CLASSNAME like
66 // virtual ~ className ();
67 
68 extern TTFOUNDATION_EXPORT TTString TTFoundationBinaryPath;
69 void TTFOUNDATION_EXPORT TTFoundationInit(const char* pathToTheJamomaFolder = nullptr, bool loadFromBuiltinPaths = false);
70 
71 
72 #endif // __TT_FOUNDATION_H__
Jamoma's lowest-level base class and related infrastructure.
The TTString class is used to represent a string.
Definition: TTString.h:34