ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DefaultHepRepAttValue.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file DefaultHepRepAttValue.h
1 // Copyright FreeHEP, 2005.
2 #ifndef CHEPREP_DEFAULTHEPREPATTVALUE_H
3 #define CHEPREP_DEFAULTHEPREPATTVALUE_H 1
4 
5 #include "cheprep/config.h"
6 
7 #include <string>
8 
10 
14 namespace cheprep {
15 
17 
18  private:
19  enum { LABELSTRINGS_LEN = 4 };
20  std::string name;
21  int type;
22 
23  // values implemented as separate items, so that they do not take up unnecessary space for an Object
24  // only ONE of these is filled
25  std::string stringValue;
27  double doubleValue;
29  std::vector<double> colorValue;
30 
32  static std::string labelStrings[LABELSTRINGS_LEN];
33 
34  void init();
35 
36  public:
37  DefaultHepRepAttValue(std::string name, std::string value, int showLabel);
38  DefaultHepRepAttValue(std::string name, int64 value, int showLabel);
39  DefaultHepRepAttValue(std::string name, int value, int showLabel);
40  DefaultHepRepAttValue(std::string name, double value, int showLabel);
41  DefaultHepRepAttValue(std::string name, bool value, int showLabel);
42  DefaultHepRepAttValue(std::string name, std::vector<double> value, int showLabel);
44 
46 
47  std::string getName();
48  std::string getLowerCaseName();
49  int getType();
50  std::string getTypeName();
51  int showLabel();
52  std::string getString();
53  std::string getLowerCaseString();
54  int64 getLong();
55  int getInteger();
56  double getDouble();
57  bool getBoolean();
58  std::vector<double> getColor();
59 
60  std::string getAsString();
61  static std::string getAsString(std::vector<double> c);
62  static std::string getAsString(int i);
63  static std::string getAsString(int64 i);
64  static std::string getAsString(double d);
65  static std::string getAsString(bool b);
66 
67  std::string toShowLabel();
68  static std::string toShowLabel(int showLabel);
69 };
70 
71 } // cheprep
72 
73 
74 #endif
75