Jamoma API  0.6.0.a19
TTDataspaceConverter.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup foundationDataspaceLib
4  *
5  * @brief Specification for #TTDataspaceConverter, the base class of dataspace converters. TODO: Could this be made more descriptive, making it easier to understand how this is distinguished as compared to TTDataspace and TTDataspaceUnit?
6  *
7  * @authors Tim Place, Trond Lossius, ...
8  *
9  * @copyright Copyright © 2007 by Tim Place @n
10  * This code is licensed under the terms of the "New BSD License" @n
11  * http://creativecommons.org/licenses/BSD/
12  */
13 
14 #ifndef __TTDATASPACECONVERTER_H__
15 #define __TTDATASPACECONVERTER_H__
16 
17 #include "TTDataspace.h"
18 
19 
20 /** TODO: What is the purpose of this class as compared to TTDataspace and TTdataspaceUnit?
21  */
24 
25  TTSymbol mDataspace; ///< TODO
26  TTObjectBasePtr mDataspaceTTObject; ///< TODO - TTObject
27  TTDataspacePtr mDataspaceObject; ///< The above, cast to it's other parent class. TODO: This needs to be more descriptive.
28 
29 
30  /** Set what dataspace to use.
31  @param newValue The dataspace to use
32  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
33  */
34  TTErr setDataspace(const TTValue& newValue);
35 
36 
37  /** Converts input to output, possibly doing a unit conversion. TODO: How do this method differ from dictionary()?
38  @param anInputValue The input value that is to be converted.
39  @param anOutputValue The converted value.
40  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
41  */
42  TTErr convert(const TTValue& anInputValue, TTValue& anOutputValue);
43 
44 
45  /** Converts input to output, possibly doing a unit conversion. TODO: How do this method differ from convert()?
46  @param anInputValue TODO
47  @param anOutputValue TODO
48  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
49  */
50  TTErr dictionary(const TTValue& anInputValue, TTValue& anOutputValue);
51 
52 
53  /** Set the input unit type for this dataspace object by it's name as a symbol.
54  @inUnitName Set the unit used for the input that is to be converted.
55  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
56  */
57  TTErr setInputUnit(const TTValue& inUnitName);
58 
59 
60  /** Get the input unit type for this dataspace object by it's name as a symbol.
61  @param inUnitName Used to return what unit is used for the input value to the conversion.
62  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
63  */
64  TTErr getInputUnit(TTValue& inUnitName);
65 
66 
67  /** Set the output unit type for this dataspace object by it's name as a symbol.
68  @param outUnitName Set the unit used for the output from the conversion.
69  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
70  */
71  TTErr setOutputUnit(const TTValue& outUnitName);
72 
73 
74  /** Get the output unit type for this dataspace object by it's name as a symbol.
75  @param outUnitName Used to return what unit is used for the output value from the conversion.
76  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
77  */
78  TTErr getOutputUnit(TTValue& inUnitName);
79 
80 
81  /** Return a list of all available units for this dataspace.
82  @param anUnusedInoutValue This is not being used.
83  @param unitNames Used to return an array providing a list of available units for this dataspace.
84  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
85  */
86  TTErr getAvailableUnits(const TTValue& anUnusedInputValue, TTValue& unitNames);
87 
88 
89  /** Return a list of all dataspaces.
90  @param anUnusedInoutValue This is not being used.
91  @param dataspaceNames Used to return an array providing a list of available dataspaces.
92  @return #TTErr error code if the method fails to execute, else #kTTErrNone.
93  */
94  TTErr getAvailableDataspaces(const TTValue& anUnusedInputValue, TTValue& dataspaceNames);
95 };
96 
97 
98 #endif // __TTDATASPACECONVERTER_H__
TTDataObjectBase is the base class for all data generating and processing objects.
TODO: What is the purpose of this class as compared to TTDataspace and TTdataspaceUnit?
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
Specification for TTDataspace, the base class of each dataspace.
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
Definition: TTBase.h:342
Base class for each dataspace.
Definition: TTDataspace.h:30
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34