// ---------------------------------------------------------------------- // // Column.cc - implementation of the class Column // // // methods present: // ~Column // bool checkType(char val); // bool checkType(short val); // bool checkType(int val); // bool checkType(long val); // bool checkType(unsigned char val); // bool checkType(unsigned short val); // bool checkType(unsigned int val); // bool checkType(unsigned long val); // bool checkType(float val); // bool checkType(double val); // bool checkType(bool val); #include "HepTuple/Column.h" #include "HepTuple/ColumnT.h" ZM_BEGIN_NAMESPACE( zmht ) /* namespace zmht { */ Column::~Column() { delete internals_; } bool Column::checkType(Int1 val) { return (_attributes.type == Int1_ct); } bool Column::checkType(Int2 val) { return (_attributes.type == Int2_ct); } bool Column::checkType(Int4 val) { return (_attributes.type == Int4_ct); } #ifdef Int8 bool Column::checkType(Int8 val) { return (_attributes.type == Int8_ct); } #endif bool Column::checkType(UInt1 val) { return (_attributes.type == Uint1_ct); } bool Column::checkType(UInt2 val) { return (_attributes.type == Uint2_ct); } bool Column::checkType(UInt4 val) { return (_attributes.type == Uint4_ct); } #ifdef Uint8 bool Column::checkType(UInt8 val) { return (_attributes.type == Uint8_ct); } #endif bool Column::checkType(Float4 val) { return (_attributes.type == Float4_ct); } bool Column::checkType(Float8 val) { return (_attributes.type == Float8_ct); } #ifdef Float16 bool Column::checkType(Float16 val) { return (_attributes.type == Float16_ct); } #endif bool Column::checkType(bool val) { return (_attributes.type == Bool_ct); } bool Column::checkType(void* val) { return (_attributes.type == Ptr_ct); } Column* Column::newColumn(Block* block, ColumnAttribs attrib) { switch ( attrib.type ) { case Int1_ct: return new ColumnT(block,attrib); case Int2_ct: return new ColumnT(block,attrib); case Int4_ct: return new ColumnT(block,attrib); #ifdef Int8 case Int8_ct: return new ColumnT(block,attrib); #endif case Uint1_ct: return new ColumnT(block,attrib); case Uint2_ct: return new ColumnT(block,attrib); case Uint4_ct: return new ColumnT(block,attrib); #ifdef Uint8 case Uint8_ct: return new ColumnT(block,attrib); #endif case Float4_ct: return new ColumnT(block,attrib); case Float8_ct: return new ColumnT(block,attrib); #ifdef Float16 case Float16_ct: return new ColumnT(block,attrib); #endif case Bool_ct: case Bool2_ct: case Bool4_ct: return new ColumnT(block,attrib); case Ptr_ct: return new ColumnT(block,attrib); default: ZMthrow(ZMxHepUnknownType("Type not supported")); } return NULL; } void Column::clear() { _isCaptured = false; setToDefault(); } // return true if a destination has been set. bool Column::hasDestination () const { return ( (_attributes.destination != NULL) || (_attributes.setMethod != NULL) || (_attributes.destFunction != NULL) ); } ZM_END_NAMESPACE( zmht ) /* } // namespace zmht */