#ifndef DEFAULTHEPREPATTVALUE_H #define DEFAULTHEPREPATTVALUE_H 1 #include "FreeHepTypes.h" #include #include "HEPREP/HepRepAttValue.h" /** * * @author M.Donszelmann */ class DefaultHepRepAttValue : public virtual HEPREP::HepRepAttValue { private: enum { LABELSTRINGS_LEN = 4 }; std::string name; int type; // values implemented as separate items, so that they do not take up unnecessary space for an Object // only ONE of these is filled std::string stringValue; long longValue; double doubleValue; bool booleanValue; std::vector colorValue; int showLabelValue; std::string labelStrings[LABELSTRINGS_LEN]; void init(); public: DefaultHepRepAttValue(std::string name, std::string value, int showLabel); DefaultHepRepAttValue(std::string name, long value, int showLabel); DefaultHepRepAttValue(std::string name, int value, int showLabel); DefaultHepRepAttValue(std::string name, double value, int showLabel); DefaultHepRepAttValue(std::string name, bool value, int showLabel); DefaultHepRepAttValue(std::string name, std::vector value, int showLabel); ~DefaultHepRepAttValue(); HEPREP::HepRepAttValue* copy(); std::string getName(); std::string getLowerCaseName(); int getType(); std::string getTypeName(); int showLabel(); std::string getString(); std::string getLowerCaseString(); long getLong(); int getInteger(); double getDouble(); bool getBoolean(); std::vector getColor(); std::string getAsString(); std::string toShowLabel(); }; #endif