src/DataTypeWriterBase.h
branchv_0
changeset 15 8fd6c4d44071
parent 9 0a40752e401d
child 16 3613617d3076
equal deleted inserted replaced
14:733334eca89b 15:8fd6c4d44071
     9 /**
     9 /**
    10  * This class contains common features that are independent from particular data type (generic/template type)
    10  * This class contains common features that are independent from particular data type (generic/template type)
    11  */
    11  */
    12 class DataTypeWriterBase {
    12 class DataTypeWriterBase {
    13 private:
    13 private:
    14 	const integer_t typeId;
    14 	const TypeId typeId;
    15 	const string_t typeCode;
    15 	const string_t typeCode;
    16 public:
    16 public:
    17 
    17 
    18 	DataTypeWriterBase(const integer_t typeId, const string_t typeCode) :
    18 	DataTypeWriterBase(const TypeId typeId, const string_t typeCode) :
    19 	typeId(typeId), typeCode(typeCode) {
    19 	typeId(typeId), typeCode(typeCode) {
    20 	}
    20 	}
    21 
    21 
    22 	virtual ~DataTypeWriterBase() {
    22 	virtual ~DataTypeWriterBase() {
    23 	};
    23 	};
    33 
    33 
    34 	/**
    34 	/**
    35 	 * @param dataType data type code as defined in DDP L0
    35 	 * @param dataType data type code as defined in DDP L0
    36 	 * @return whether this class supports conversions of this type
    36 	 * @return whether this class supports conversions of this type
    37 	 */
    37 	 */
    38 	virtual bool supports(const integer_t &dataType) {
    38 	virtual bool supports(const TypeId &dataType) {
    39 		return dataType == typeId;
    39 		return dataType == typeId;
    40 	}
    40 	}
    41 
    41 
    42 	/**
    42 	/**
    43 	 * @param dataType data type name as defined in DDP L0
    43 	 * @param dataType data type name as defined in DDP L0
    45 	 */
    45 	 */
    46 	virtual bool supports(const string_t &dataType) {
    46 	virtual bool supports(const string_t &dataType) {
    47 		return dataType == typeCode;
    47 		return dataType == typeCode;
    48 	}
    48 	}
    49 
    49 
    50 	integer_t getTypeId() {
    50 	TypeId getTypeId() {
    51 		return typeId;
    51 		return typeId;
    52 	}
    52 	}
    53 
    53 
    54 	string_t getTypeCode() {
    54 	string_t getTypeCode() {
    55 		return typeCode;
    55 		return typeCode;