25std::string DefaultHepRepAttValue::labelStrings[LABELSTRINGS_LEN];
28 : name(aName), type(
HepRepConstants::TYPE_STRING), stringValue(aValue), showLabelValue(aShowLabel) {
34 : name(aName), type(
HepRepConstants::TYPE_LONG), longValue(aValue), showLabelValue(aShowLabel) {
40 : name(aName), type(
HepRepConstants::TYPE_INT), longValue(aValue), showLabelValue(aShowLabel) {
46 : name(aName), type(
HepRepConstants::TYPE_DOUBLE), doubleValue(aValue), showLabelValue(aShowLabel) {
52 : name(aName), type(
HepRepConstants::TYPE_BOOLEAN), booleanValue(aValue), showLabelValue(aShowLabel) {
58 : name(aName), type(
HepRepConstants::TYPE_COLOR), colorValue(aValue), showLabelValue(aShowLabel) {
66void DefaultHepRepAttValue::init() {
67 labelStrings[0] =
"NAME";
68 labelStrings[1] =
"DESC";
69 labelStrings[2] =
"VALUE";
70 labelStrings[3] =
"EXTRA";
81 default:
return new DefaultHepRepAttValue(name,
"Unknown type stored in HepRepAttDef", showLabelValue);
91 transform(s.begin(), s.end(), s.begin(), (
int(*)(
int)) tolower);
107 default:
return "Unknown type stored in HepRepAttDef";
112 return showLabelValue;
122 string s = stringValue;
123 transform(s.begin(), s.end(), s.begin(), (
int(*)(
int)) tolower);
134 return (
int64)longValue;
161 default:
return "Unknown typecode";
167 sprintf(
buffer,
"%4.2f, %4.2f, %4.2f, %4.2f",
171 (c.size() > 3) ? c[3] : 1.0);
195 return b ?
"true" :
"false";
212 for (
int i=0; i<16; i++) {
213 if (((
showLabel >> i) & 0x0001) == 0x0001) {
219 if (i < LABELSTRINGS_LEN) {
220 label.append(labelStrings[i]);
223 sprintf(hex,
"%0x", 1 << i);
std::string getLowerCaseString()
HEPREP::HepRepAttValue * copy()
DefaultHepRepAttValue(std::string name, std::string value, int showLabel)
std::vector< double > getColor()
std::string toShowLabel()
std::string getLowerCaseName()
std::string getAsString()
std::string getTypeName()
#define CHEPREP_INT64_FORMAT