Jamoma API  0.6.0.a19
NoneDataspace.cpp
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup foundationDataspaceLib
4  *
5  * @brief The #NoneDataspace is a dataspace unit for situations where no dataspace conversions are desired or relevant. It contains only one unit, the #NoneUnit, and that unit does not perform any conversions.
6  *
7  * @details The neutral unit of the angle dataspace is none.
8  *
9  * @authors Tim Place, Nils Peters, Trond Lossius, ...
10  *
11  * @copyright Copyright © 2007 by Nils Peters @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 #include "NoneDataspace.h"
18 
19 
20 #define thisTTClass NoneUnit
21 #define thisTTClassName "unit.none"
22 #define thisTTClassTags "dataspace.unit, none"
23 
25 TTDataspaceUnit(arguments)
26 {;}
27 
28 NoneUnit::~NoneUnit(){;}
29 
30 void NoneUnit::convertToNeutral(const TTValue& input, TTValue& output)
31 {
32  output = input;
33 }
34 
35 
36 void NoneUnit::convertFromNeutral(const TTValue& input, TTValue& output)
37 {
38  output = input;
39 }
40 
41 
42 #undef thisTTClass
43 #undef thisTTClassName
44 #undef thisTTClassTags
45 
46 /***********************************************************************************************/
47 
48 #define thisTTClass NoneDataspace
49 #define thisTTClassName "dataspace.none"
50 #define thisTTClassTags "foundationDataspaceLib, dataspace, none"
51 
53 {
54  TTErr err;
55 
56  // Create one of each kind of unit, and cache them in a hash
57  registerUnit(TT("unit.none"), TT("none"));
58 
59  // Set our neutral unit (the unit through which all conversions are made)
60  neutralUnit = TT("none");
61 
62  // Now that the cache is created, we can create a set of default units
63  err = setInputUnit(neutralUnit);
64  if (err)
65  throw TTException("Could not create neutralUnit for NoneDataspace");
66 
67  err = setOutputUnit(neutralUnit);
68  if (err)
69  throw TTException("Could not create neutralUnit for NoneDataspace");
70 }
71 
72 
73 NoneDataspace::~NoneDataspace()
74 {
75  ;
76 }
77 
78 #undef thisTTClass
79 #undef thisTTClassName
80 #undef thisTTClassTags
void convertToNeutral(const TTValue &input, TTValue &output)
Convertion from none to neutral unit leaves the value untouched.
#define TT
This macro is defined as a shortcut for doing a lookup in the symbol table.
Definition: TTSymbol.h:155
A TTBlue exception is thown with this object.
Definition: TTBase.h:368
Specification for the base class of each DataspaceUnit.
The NoneDataspace is a dataspace unit for situations where no dataspace conversions are desired or re...
void convertFromNeutral(const TTValue &input, TTValue &output)
Convertion from neutral unit to the "none" unit leaves the value untouched.
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
Definition: TTBase.h:342
TT_OBJECT_CONSTRUCTOR
Constructor macro.
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34