NEOCCA bindings Specification  0.2.8
TypeMap.hh
Go to the documentation of this file.
1 #ifndef neo_TypeMap_hh_seen
2 #define neo_TypeMap_hh_seen
3 
4 /* A file of auxiliaries that mainly distract the new reader. */
5 
6 namespace neo {
7 namespace cca {
8 
14 typedef boost::shared_ptr<TypeMap> TypeMap_shared;
15 
22 class TypeMap
23 {
24 public:
25 
27  virtual ~TypeMap(){}
28 
30  virtual TypeMap_shared cloneData()= 0;
31 
33  virtual TypeMap_shared cloneEmpty()= 0;
34 
37  virtual int32_t getInt(const ::std::string & key, int32_t defaultValue) throw (TypeMismatchException )= 0;
38 
41  virtual int64_t getLong(const ::std::string & key, int64_t defaultValue) throw (TypeMismatchException )= 0;
42 
45  virtual float getFloat(const ::std::string & key, float defaultValue) throw (TypeMismatchException )= 0;
46 
49  virtual double getDouble(const ::std::string & key, double defaultValue) throw (TypeMismatchException )= 0;
50 
53  virtual ::std::complex<float> getFcomplex(const ::std::string & key, ::std::complex<float> defaultValue) throw (TypeMismatchException )= 0;
54 
57  virtual ::std::complex<double> getDcomplex(const ::std::string & key, ::std::complex<double> defaultValue) throw (TypeMismatchException )= 0;
58 
61  virtual ::std::string getString(const ::std::string & key, ::std::string defaultValue) throw (TypeMismatchException )= 0;
62 
65  virtual bool getBool(const ::std::string & key, bool defaultValue) throw (TypeMismatchException )= 0;
66 
67  // ======================================================
68 
71  virtual ::std::vector< int32_t > getIntArray(const ::std::string & key, ::std::vector< int32_t >& defaultValue) throw (TypeMismatchException )= 0;
72 
75  virtual ::std::vector< int64_t > getLongArray(const ::std::string & key, ::std::vector< int64_t >& defaultValue) throw (TypeMismatchException )= 0;
76 
79  virtual ::std::vector< float > getFloatArray(const ::std::string & key, ::std::vector< float >& defaultValue) throw (TypeMismatchException )= 0;
80 
83  virtual ::std::vector< double > getDoubleArray(const ::std::string & key, ::std::vector< double >& defaultValue) throw (TypeMismatchException )= 0;
84 
87  virtual ::std::vector< ::std::complex<float> > getFcomplexArray(const ::std::string & key, ::std::vector< ::std::complex<float> >& defaultValue) throw (TypeMismatchException )= 0;
88 
91  virtual ::std::vector< ::std::complex<double> > getDcomplexArray(const ::std::string & key, ::std::vector< ::std::complex<double> >& defaultValue) throw (TypeMismatchException )= 0;
92 
95  virtual ::std::vector< ::std::string > getStringArray(const ::std::string & key, ::std::vector< ::std::string >& defaultValue) throw (TypeMismatchException )= 0;
96 
99  virtual ::std::vector< bool > getBoolArray(const ::std::string & key, ::std::vector< bool >& defaultValue) throw (TypeMismatchException )= 0;
100 
101 
102  // ======================================================
103 
106  virtual void putInt(const ::std::string & key, int value)= 0;
107 
110  virtual void putLong(const ::std::string & key, int64_t value)= 0;
111 
114  virtual void putFloat(const ::std::string & key, float value)= 0;
115 
118  virtual void putDouble(const ::std::string & key, double value)= 0;
119 
122  virtual void putFcomplex(const ::std::string & key, ::std::complex<float> value)= 0;
123 
126  virtual void putDcomplex(const ::std::string & key, ::std::complex<double> value)= 0;
127 
130  virtual void putString(const ::std::string & key, const ::std::string & value)= 0;
131 
134  virtual void putBool(const ::std::string & key, bool value)= 0;
135 
136  // ======================================================
137 
141  virtual void putIntArray(const ::std::string & key, int * value ,int length)= 0;
143  virtual void putIntArray(const ::std::string & key, ::std::vector< int >& value)= 0;
144 
148  virtual void putLongArray(const ::std::string & key, int64_t * value ,int length)= 0;
150  virtual void putLongArray(const ::std::string & key, ::std::vector< int64_t >& value )= 0;
151 
155  virtual void putFloatArray(const ::std::string & key, float * value ,int length)= 0;
157  virtual void putFloatArray(const ::std::string & key, ::std::vector< float >& value )= 0;
158 
162  virtual void putDoubleArray(const ::std::string & key, double * value ,int length)= 0;
164  virtual void putDoubleArray(const ::std::string & key, ::std::vector< double >& value)= 0;
165 
169  virtual void putFcomplexArray(const ::std::string & key, ::std::complex<float> * value ,int length)= 0;
171  virtual void putFcomplexArray(const ::std::string & key, ::std::vector< ::std::complex<float> >& value)= 0;
172 
176  virtual void putDcomplexArray(const ::std::string & key, ::std::complex<double> * value ,int length)= 0;
178  virtual void putDcomplexArray(const ::std::string & key, ::std::vector< ::std::complex<double> >& value)= 0;
179 
183  virtual void putStringArray(const ::std::string & key, ::std::vector< ::std::string >& value)= 0;
184 
188  virtual void putBoolArray(const ::std::string & key, bool * value ,int length)= 0;
190  virtual void putBoolArray(const ::std::string & key, ::std::vector< bool >& value)= 0;
191 
192  // ======================================================
193 
195  virtual void remove (const ::std::string & key)= 0;
196 
203  virtual ::std::vector< ::std::string > getAllKeys( enum Type t)= 0;
204 
206  virtual bool hasKey(const ::std::string & key)= 0;
207 
209  virtual enum Type typeOf(const ::std::string & key)= 0;
210 
211 } ; // end interface TypeMap
212 
213 
214 } // end namespace cca
215 } // end namespace neo
216 
217 #endif // neo_TypeMap_hh_seen
virtual ::std::vector< int64_t > getLongArray(const ::std::string &key, ::std::vector< int64_t > &defaultValue)=0
Get the value associated with a given key.
virtual ::std::vector< float > getFloatArray(const ::std::string &key, ::std::vector< float > &defaultValue)=0
Get the value associated with a given key.
virtual TypeMap_shared cloneData()=0
Create an exact copy of this Map.
virtual TypeMap_shared cloneEmpty()=0
Create a new Map with no key/value associations.
A CCA typed hash map.
Definition: TypeMap.hh:22
boost::shared_ptr< TypeMap > TypeMap_shared
This (TypeMap_shared) is what everyone declares in component code and noone ever calls new on...
Definition: TypeMap.hh:14
virtual void putBool(const ::std::string &key, bool value)=0
Assign a key and value.
Type
Mapping of sidl/java primitive types and arrays to occuring in the TypeMap interface to integers...
Definition: Type.hh:14
virtual void putString(const ::std::string &key, const ::std::string &value)=0
Assign a key and value.
virtual ::std::vector< ::std::string > getAllKeys(enum Type t)=0
Get all the names associated with a particular type without exposing the data implementation details...
virtual void putBoolArray(const ::std::string &key, bool *value, int length)=0
Assign a key and value.
virtual void putLong(const ::std::string &key, int64_t value)=0
Assign a key and value.
virtual void putIntArray(const ::std::string &key, int *value, int length)=0
Assign a key and value.
virtual ::std::vector< ::std::complex< float > > getFcomplexArray(const ::std::string &key, ::std::vector< ::std::complex< float > > &defaultValue)=0
Get the complex value associated with a given key.
virtual ::std::vector< ::std::complex< double > > getDcomplexArray(const ::std::string &key, ::std::vector< ::std::complex< double > > &defaultValue)=0
Get the complex value associated with a given key.
virtual void putFloatArray(const ::std::string &key, float *value, int length)=0
Assign a key and value.
virtual void putDcomplexArray(const ::std::string &key, ::std::complex< double > *value, int length)=0
Assign a key and complex array value.
virtual void putDcomplex(const ::std::string &key, ::std::complex< double > value)=0
Assign a key and complex value.
virtual void putFloat(const ::std::string &key, float value)=0
Assign a key and value.
virtual ::std::vector< ::std::string > getStringArray(const ::std::string &key, ::std::vector< ::std::string > &defaultValue)=0
Get the value associated with a given key.
virtual void putFcomplex(const ::std::string &key, ::std::complex< float > value)=0
Assign a key and complex value.
virtual void putLongArray(const ::std::string &key, int64_t *value, int length)=0
Assign a key and value.
virtual float getFloat(const ::std::string &key, float defaultValue)=0
Get the Float value associated with a given key.
virtual void putDoubleArray(const ::std::string &key, double *value, int length)=0
Assign a key and value.
virtual void putStringArray(const ::std::string &key, ::std::vector< ::std::string > &value)=0
Assign a key and value.
Exception occuring when a get or put operation specifies incorrect data type for a given key already ...
Definition: TypeMismatchException.hh:14
virtual ::std::string getString(const ::std::string &key, ::std::string defaultValue)=0
Get the string value associated with a given key.
virtual ::std::complex< double > getDcomplex(const ::std::string &key, ::std::complex< double > defaultValue)=0
Get the Dcomplex value associated with a given key.
virtual int64_t getLong(const ::std::string &key, int64_t defaultValue)=0
Get the Long value associated with a given key.
virtual ~TypeMap()
required destructor
Definition: TypeMap.hh:27
virtual int32_t getInt(const ::std::string &key, int32_t defaultValue)=0
Get the Int value associated with a given key.
virtual ::std::vector< bool > getBoolArray(const ::std::string &key, ::std::vector< bool > &defaultValue)=0
Get the value associated with a given key.
virtual bool hasKey(const ::std::string &key)=0
Return true if the key exists in this map.
virtual ::std::vector< double > getDoubleArray(const ::std::string &key, ::std::vector< double > &defaultValue)=0
Get the value associated with a given key.
virtual void putFcomplexArray(const ::std::string &key, ::std::complex< float > *value, int length)=0
Assign a key and complex array value.
virtual void putInt(const ::std::string &key, int value)=0
Assign a key and value.
virtual double getDouble(const ::std::string &key, double defaultValue)=0
Get the Double value associated with a given key.
virtual ::std::complex< float > getFcomplex(const ::std::string &key, ::std::complex< float > defaultValue)=0
Get the Fcomplex value associated with a given key.
virtual ::std::vector< int32_t > getIntArray(const ::std::string &key, ::std::vector< int32_t > &defaultValue)=0
Get the value associated with a given key.
virtual bool getBool(const ::std::string &key, bool defaultValue)=0
Get the boolean value associated with a given key.
This is neoclassic – the ::classic::gov::cca headers updated to be similar to the official CCA speci...
Definition: neocca.hh:62
virtual void putDouble(const ::std::string &key, double value)=0
Assign a key and value.
virtual enum Type typeOf(const ::std::string &key)=0
Return the type of the value associated with this key.