21 #ifndef DATAPARAMETER_H
22 #define DATAPARAMETER_H
25 #include "Collections.h"
75 static string ToString( DATA_TYPE type );
108 } PARAMETER_DIRECTION;
125 m_Name(
"" ), m_Direction( paramDirection ), m_Type(
DataType::INVALID_TYPE ), m_Dimension( 0 ), m_StoragePointer( NULL ) {}
134 m_Name( paramName ), m_Direction( paramDirection ), m_Type( paramType ), m_Dimension( dimension ), m_StoragePointer( NULL ) {}
141 m_Type( source.m_Type ), m_Dimension( source.m_Dimension ), m_StoragePointer( source.m_StoragePointer ) {}
145 if (
this == &source )
162 if ( m_StoragePointer != NULL )
163 m_StoragePointer = NULL;
175 m_Direction = paramDirection;
191 return m_StoragePointer;
195 return m_StoragePointer;
202 virtual void* getIndicatorValue() = 0;
205 m_Dimension = dimension;
212 virtual bool isNULLValue()
const = 0;
214 inline virtual void push_back(
const string& value ) {
throw logic_error(
"Not supported by this data type"); }
215 inline virtual const string&
getElement(
size_t position )
const {
throw logic_error(
"Not supported by this data type"); }
217 virtual void setString(
string value );
218 void setInt(
int value );
219 void setLong(
long value );
220 void setShort(
short value );
236 class DataParameter :
public DataParameterBase
246 m_StoragePointer = (
unsigned char * )&m_Value;
258 m_StoragePointer = (
unsigned char * )&m_Value;
268 m_Value = source.getValue();
269 m_StoragePointer = (
unsigned char * )&m_Value;
280 if (
this == &source )
283 DataParameterBase::operator=( source );
285 m_Value = source.m_Value;
286 m_StoragePointer = (
unsigned char * )&m_Value;
292 virtual void setValue( T newValue ) = 0;
293 virtual T getValue()
const = 0;
295 inline virtual void setDimension(
const unsigned int dimension )
297 m_Dimension = dimension;
317 return DataType::CHAR_TYPE;
324 return DataType::TIMESTAMP_TYPE;
330 return DataType::SHORTINT_TYPE;
336 return DataType::LONGINT_TYPE;
386 if (
this == &source )
391 m_Value = source.m_Value;
392 m_StoragePointer = NULL;
490 #endif // DBPARAMETER_H