g4tools  5.4.0
value
Go to the documentation of this file.
1 // Copyright (C) 2010, Guy Barrand. All rights reserved.
2 // See the file tools.license for terms.
3 
4 #ifndef tools_value
5 #define tools_value
6 
7 #include "array"
8 #include "typedefs"
9 #include "num2s"
10 #include "b2s"
11 
12 #ifdef TOOLS_MEM
13 #include "mem"
14 #endif
15 
16 namespace tools {
17 
18 class value {
19  static const std::string& s_class() {
20  static const std::string s_v("tools::value");
21  return s_v;
22  }
23 public:
24  enum e_type {
25  NONE = 0,
26  // integers :
27  //UNSIGNED_CHAR = 10,
28  //CHAR = 11,
30  SHORT = 13,
32  INT = 15,
34  INT64 = 17,
35  // reals :
36  FLOAT = 30,
37  DOUBLE = 31,
38  // else :
39  BOOL = 50,
40  STRING = 51,
41  // pointers :
42  VOID_STAR = 100,
43  DOUBLE_STAR = 101,
44  FLOAT_STAR = 102,
45  INT_STAR = 103,
46 
47  // multidimensional vectors (1000+base type) :
48  //ARRAY_UNSIGNED_CHAR = 1010,
49  //ARRAY_CHAR = 1011,
51  ARRAY_SHORT = 1013,
53  ARRAY_INT = 1015,
55  ARRAY_INT64 = 1017,
56  ARRAY_FLOAT = 1030,
57  ARRAY_DOUBLE = 1031,
58  ARRAY_BOOL = 1050,
59  ARRAY_STRING = 1051
60  };
61 
62 /*
63  static e_type type(unsigned short) {return UNSIGNED_SHORT;}
64  static e_type type(short) {return SHORT;}
65  static e_type type(unsigned int) {return UNSIGNED_INT;}
66  static e_type type(int) {return INT;}
67  static e_type type(uint64) {return UNSIGNED_INT64;}
68  static e_type type(int64) {return INT64;}
69  static e_type type(float) {return FLOAT;}
70  static e_type type(double) {return DOUBLE;}
71  static e_type type(bool) {return BOOL;}
72  static e_type type(void*) {return VOID_STAR;}
73  static e_type type(double*) {return DOUBLE_STAR;}
74  static e_type type(float*) {return FLOAT_STAR;}
75  static e_type type(int*) {return INT_STAR;}
76  //static e_type type(const std::string&) {return STRING;}
77 */
78 public:
79  value():m_label(0),m_itag(0){
80 #ifdef TOOLS_MEM
81  mem::increment(s_class().c_str());
82 #endif
83  m_type = NONE;
84  u.m_unsigned_int64 = 0;
85  }
86 
87  value(bool a_value):m_label(0),m_itag(0) {
88 #ifdef TOOLS_MEM
89  mem::increment(s_class().c_str());
90 #endif
91  m_type = BOOL;
92  u.m_bool = a_value;
93  }
94 // value(char a_value):m_label(0),m_itag(0) {
95 //#ifdef TOOLS_MEM
96 // mem::increment(s_class().c_str());
97 //#endif
98 // m_type = CHAR;
99 // u.m_char = a_value;
100 // }
101  value(short a_value):m_label(0),m_itag(0) {
102 #ifdef TOOLS_MEM
103  mem::increment(s_class().c_str());
104 #endif
105  m_type = SHORT;
106  u.m_short = a_value;
107  }
108  value(int a_value):m_label(0),m_itag(0) {
109 #ifdef TOOLS_MEM
110  mem::increment(s_class().c_str());
111 #endif
112  m_type = INT;
113  u.m_int = a_value;
114  }
115  value(int64 a_value):m_label(0),m_itag(0) {
116 #ifdef TOOLS_MEM
117  mem::increment(s_class().c_str());
118 #endif
119  m_type = INT64;
120  u.m_int64 = a_value;
121  }
122  value(uint64 a_value):m_label(0),m_itag(0) {
123 #ifdef TOOLS_MEM
124  mem::increment(s_class().c_str());
125 #endif
127  u.m_unsigned_int64 = a_value;
128  }
129  value(float a_value):m_label(0),m_itag(0) {
130 #ifdef TOOLS_MEM
131  mem::increment(s_class().c_str());
132 #endif
133  m_type = FLOAT;
134  u.m_float = a_value;
135  }
136  value(double a_value):m_label(0),m_itag(0) {
137 #ifdef TOOLS_MEM
138  mem::increment(s_class().c_str());
139 #endif
140  m_type = DOUBLE;
141  u.m_double = a_value;
142  }
143 
144 // value(unsigned char a_value):m_label(0),m_itag(0) {
145 //#ifdef TOOLS_MEM
146 // mem::increment(s_class().c_str());
147 //#endif
148 // m_type = UNSIGNED_CHAR;
149 // u.m_unsigned_char = a_value;
150 // }
151  value(unsigned short a_value):m_label(0),m_itag(0) {
152 #ifdef TOOLS_MEM
153  mem::increment(s_class().c_str());
154 #endif
156  u.m_unsigned_short = a_value;
157  }
158  value(unsigned int a_value):m_label(0),m_itag(0) {
159 #ifdef TOOLS_MEM
160  mem::increment(s_class().c_str());
161 #endif
163  u.m_unsigned_int = a_value;
164  }
165  value(void* a_value):m_label(0),m_itag(0) {
166 #ifdef TOOLS_MEM
167  mem::increment(s_class().c_str());
168 #endif
169  m_type = VOID_STAR;
170  u.m_void_star = a_value;
171  }
172  value(double* a_value):m_label(0),m_itag(0) {
173 #ifdef TOOLS_MEM
174  mem::increment(s_class().c_str());
175 #endif
177  u.m_double_star = a_value;
178  }
179  value(float* a_value):m_label(0),m_itag(0) {
180 #ifdef TOOLS_MEM
181  mem::increment(s_class().c_str());
182 #endif
183  m_type = FLOAT_STAR;
184  u.m_float_star = a_value;
185  }
186  value(int* a_value):m_label(0),m_itag(0) {
187 #ifdef TOOLS_MEM
188  mem::increment(s_class().c_str());
189 #endif
190  m_type = INT_STAR;
191  u.m_int_star = a_value;
192  }
193 
194  value(const char* a_value):m_label(0),m_itag(0) {
195 #ifdef TOOLS_MEM
196  mem::increment(s_class().c_str());
197 #endif
198  m_type = STRING;
199  u.m_string = new std::string(a_value?a_value:"");
200  }
201  value(const std::string& a_value):m_label(0),m_itag(0) {
202 #ifdef TOOLS_MEM
203  mem::increment(s_class().c_str());
204 #endif
205  m_type = STRING;
206  u.m_string = new std::string(a_value);
207  }
208 
209 #ifdef TOOLS_MEM
210 #define TOOLS_VALUE_CSTOR(a_what,a_m_what,a_type) \
211  value(const std::vector<a_what>& a_v):m_label(0),m_itag(0){\
212  mem::increment(s_class().c_str());\
213  m_type = a_type;\
214  std::vector<unsigned int> is(1);\
215  is[0] = (unsigned int)a_v.size();\
216  u.a_m_what = new array<a_what>(is);\
217  u.a_m_what->fill(a_v);\
218  }
219 #else
220 #define TOOLS_VALUE_CSTOR(a_what,a_m_what,a_type) \
221  value(const std::vector<a_what>& a_v):m_label(0),m_itag(0){\
222  m_type = a_type;\
223  std::vector<unsigned int> is(1);\
224  is[0] = (unsigned int)a_v.size();\
225  u.a_m_what = new array<a_what>(is);\
226  u.a_m_what->fill(a_v);\
227  }
228 #endif
229 
230 //TOOLS_VALUE_CSTOR(unsigned char,m_array_unsigned_char,ARRAY_UNSIGNED_CHAR)
231 //TOOLS_VALUE_CSTOR(char,m_array_char,ARRAY_CHAR)
242 
243 #undef TOOLS_VALUE_CSTOR
244 
245 #ifdef TOOLS_MEM
246 #define TOOLS_VALUE_CSTORA(a_what,a_m_what,a_type) \
247  value(const array<a_what>& a_a):m_label(0),m_itag(0){\
248  mem::increment(s_class().c_str());\
249  m_type = a_type;\
250  u.a_m_what = new array<a_what>(a_a);\
251  }
252 #else
253 #define TOOLS_VALUE_CSTORA(a_what,a_m_what,a_type) \
254  value(const array<a_what>& a_a):m_label(0),m_itag(0){\
255  m_type = a_type;\
256  u.a_m_what = new array<a_what>(a_a);\
257  }
258 #endif
259 
260 //TOOLS_VALUE_CSTORA(unsigned char,m_array_unsigned_char,ARRAY_UNSIGNED_CHAR)
261 //TOOLS_VALUE_CSTORA(char,m_array_char,ARRAY_CHAR)
272 
273 #undef TOOLS_VALUE_CSTORA
274 
275  virtual ~value() {
276  delete m_label;
277  reset();
278 #ifdef TOOLS_MEM
279  mem::decrement(s_class().c_str());
280 #endif
281  }
282 public:
283  value(const value& a_from):m_label(0),m_itag(a_from.m_itag){
284 #ifdef TOOLS_MEM
285  mem::increment(s_class().c_str());
286 #endif
287 
288  if(a_from.m_label) m_label = new std::string(*a_from.m_label);
289  m_type = a_from.m_type;
290 
291  if(a_from.m_type==STRING) {
292  u.m_string = new std::string(*a_from.u.m_string);
293 
294  //} else if(a_from.m_type==ARRAY_UNSIGNED_CHAR) {
295  // u.m_array_unsigned_char =
296  // new array<unsigned char>(*a_from.u.m_array_unsigned_char);
297 
298  //} else if(a_from.m_type==ARRAY_CHAR) {
299  // u.m_array_char = new array<char>(*a_from.u.m_array_char);
300 
301  } else if(a_from.m_type==ARRAY_UNSIGNED_SHORT) {
302  u.m_array_unsigned_short =
304 
305  } else if(a_from.m_type==ARRAY_SHORT) {
306  u.m_array_short = new array<short>(*a_from.u.m_array_short);
307 
308  } else if(a_from.m_type==ARRAY_UNSIGNED_INT) {
309  u.m_array_unsigned_int = new array<unsigned int>(*a_from.u.m_array_unsigned_int);
310 
311  } else if(a_from.m_type==ARRAY_INT) {
312  u.m_array_int = new array<int>(*a_from.u.m_array_int);
313 
314  } else if(a_from.m_type==ARRAY_UNSIGNED_INT64) {
315  u.m_array_unsigned_int64 = new array<uint64>(*a_from.u.m_array_unsigned_int64);
316 
317  } else if(a_from.m_type==ARRAY_INT64) {
318  u.m_array_int64 = new array<int64>(*a_from.u.m_array_int64);
319 
320  } else if(a_from.m_type==ARRAY_FLOAT) {
321  u.m_array_float = new array<float>(*a_from.u.m_array_float);
322 
323  } else if(a_from.m_type==ARRAY_DOUBLE) {
324  u.m_array_double = new array<double>(*a_from.u.m_array_double);
325 
326  } else if(a_from.m_type==ARRAY_BOOL) {
327  u.m_array_bool = new array<bool>(*a_from.u.m_array_bool);
328 
329  } else if(a_from.m_type==ARRAY_STRING) {
330  u.m_array_string = new array<std::string>(*a_from.u.m_array_string);
331 
332  } else {
333  u = a_from.u;
334  }
335  }
336 
337  value& operator=(const value& a_from) {
338  if(&a_from==this) return *this;
339 
340  delete m_label;m_label = 0;
341  if(a_from.m_label) m_label = new std::string(*a_from.m_label);
342 
343  m_itag = a_from.m_itag;
344 
345  reset();
346 
347  m_type = a_from.m_type;
348 
349  if(a_from.m_type==STRING) {
350  u.m_string = new std::string(*a_from.u.m_string);
351 
352  //} else if(a_from.m_type==ARRAY_UNSIGNED_CHAR) {
353  // u.m_array_unsigned_char =
354  // new array<unsigned char>(*a_from.u.m_array_unsigned_char);
355 
356  //} else if(a_from.m_type==ARRAY_CHAR) {
357  // u.m_array_char = new array<char>(*a_from.u.m_array_char);
358 
359  } else if(a_from.m_type==ARRAY_UNSIGNED_SHORT) {
360  u.m_array_unsigned_short = new array<unsigned short>(*a_from.u.m_array_unsigned_short);
361 
362  } else if(a_from.m_type==ARRAY_SHORT) {
363  u.m_array_short = new array<short>(*a_from.u.m_array_short);
364 
365  } else if(a_from.m_type==ARRAY_UNSIGNED_INT) {
366  u.m_array_unsigned_int = new array<unsigned int>(*a_from.u.m_array_unsigned_int);
367 
368  } else if(a_from.m_type==ARRAY_INT) {
369  u.m_array_int = new array<int>(*a_from.u.m_array_int);
370 
371  } else if(a_from.m_type==ARRAY_UNSIGNED_INT64) {
372  u.m_array_unsigned_int64 = new array<uint64>(*a_from.u.m_array_unsigned_int64);
373 
374  } else if(a_from.m_type==ARRAY_INT64) {
375  u.m_array_int64 = new array<int64>(*a_from.u.m_array_int64);
376 
377  } else if(a_from.m_type==ARRAY_FLOAT) {
378  u.m_array_float = new array<float>(*a_from.u.m_array_float);
379 
380  } else if(a_from.m_type==ARRAY_DOUBLE) {
381  u.m_array_double = new array<double>(*a_from.u.m_array_double);
382 
383  } else if(a_from.m_type==ARRAY_BOOL) {
384  u.m_array_bool = new array<bool>(*a_from.u.m_array_bool);
385 
386  } else if(a_from.m_type==ARRAY_STRING) {
387  u.m_array_string = new array<std::string>(*a_from.u.m_array_string);
388 
389  } else {
390  u = a_from.u;
391  }
392 
393  return *this;
394  }
395 /* for tests/symbolic.cpp.
396 public:
397  value operator*(const value& a_from) const {
398  value tmp(*this);
399  std::string serr;
400  multiply(tmp,a_from,serr);
401  return tmp;
402  }
403  value operator+(const value& a_from) const {
404  value tmp(*this);
405  std::string serr;
406  add(tmp,a_from,serr);
407  return tmp;
408  }
409  value operator-(const value& a_from) const {
410  value tmp(*this);
411  std::string serr;
412  subtract(tmp,a_from,serr);
413  return tmp;
414  }
415  value operator+=(const value& a_from) {
416  value s = operator+(a_from);
417  *this = s;
418  return s;
419  }
420  value operator-=(const value& a_from) {
421  value s = operator-(a_from);
422  *this = s;
423  return s;
424  }
425 */
426 private:
427  static const std::string& s_empty() {
428  static const std::string s_v("");
429  return s_v;
430  }
431 public:
432  void set_itag(unsigned int a_itag) {m_itag = a_itag;} //gopaw
433  unsigned int itag() const {return m_itag;} //gopaw
434  void set_label(const std::string& a_s) {
435  delete m_label;
436  m_label = new std::string(a_s);
437  }
438  const std::string& label() const {return m_label?(*m_label):s_empty();}
439 
440  e_type type() const {return m_type;}
441  void set_type(e_type a_type) {
442  reset();
443  m_type = a_type;
444  switch(a_type) {
445  case NONE: u.m_unsigned_int64 = 0;break;
446  //case UNSIGNED_CHAR: u.m_unsigned_char = 0;break;
447  //case CHAR: u.m_char = 0;break;
448  case UNSIGNED_SHORT: u.m_unsigned_short = 0;break;
449  case SHORT: u.m_short = 0;break;
450  case UNSIGNED_INT: u.m_unsigned_int = 0;break;
451  case INT: u.m_int = 0;break;
452  case UNSIGNED_INT64: u.m_unsigned_int64 =0;break;
453  case INT64: u.m_int64 = 0;break;
454  case FLOAT: u.m_float = 0;break;
455  case DOUBLE: u.m_double = 0;break;
456  case BOOL: u.m_bool = false;break;
457  case VOID_STAR: u.m_void_star = 0;break;
458  case DOUBLE_STAR: u.m_double_star = 0;break;
459  case FLOAT_STAR: u.m_float_star = 0;break;
460  case INT_STAR: u.m_int_star = 0;break;
461  case STRING: u.m_string = new std::string("");break;
462  //case ARRAY_UNSIGNED_CHAR:
463  // u.m_array_unsigned_char = new array<unsigned char>();break;
464  //case ARRAY_CHAR:u.m_array_char = new array<char>();break;
465 
467  u.m_array_unsigned_short = new array<unsigned short>();break;
468  case ARRAY_SHORT:u.m_array_short = new array<short>();break;
469 
470  case ARRAY_UNSIGNED_INT:
471  u.m_array_unsigned_int = new array<unsigned int>();break;
472  case ARRAY_INT:u.m_array_int = new array<int>();break;
474  u.m_array_unsigned_int64 = new array<uint64>();break;
475  case ARRAY_INT64:u.m_array_int64 = new array<int64>();break;
476 
477  case ARRAY_FLOAT:u.m_array_float = new array<float>();break;
478  case ARRAY_DOUBLE:u.m_array_double = new array<double>();break;
479  case ARRAY_BOOL:u.m_array_bool = new array<bool>();break;
480  case ARRAY_STRING:u.m_array_string = new array<std::string>();break;
481  }
482  }
483 
484  void set_none() {
485  reset();
486  m_type = NONE;
487  u.m_unsigned_int64 = 0;
488  }
489  //void set(char a_value) {
490  // reset();
491  // m_type = CHAR;
492  // u.m_char = a_value;
493  //}
494  //void set(unsigned char a_value) {
495  // reset();
496  // m_type = UNSIGNED_CHAR;
497  // u.m_unsigned_char = a_value;
498  //}
499  void set(short a_value) {
500  reset();
501  m_type = SHORT;
502  u.m_short = a_value;
503  }
504  void set(unsigned short a_value) {
505  reset();
507  u.m_unsigned_short = a_value;
508  }
509  void set(int a_value) {
510  reset();
511  m_type = INT;
512  u.m_int = a_value;
513  }
514  void set(unsigned int a_value) {
515  reset();
517  u.m_unsigned_int = a_value;
518  }
519  void set(int64 a_value) {
520  reset();
521  m_type = INT64;
522  u.m_int64 = a_value;
523  }
524  void set(uint64 a_value) {
525  reset();
527  u.m_unsigned_int64 = a_value;
528  }
529  void set(float a_value) {
530  reset();
531  m_type = FLOAT;
532  u.m_float = a_value;
533  }
534  void set(double a_value) {
535  reset();
536  m_type = DOUBLE;
537  u.m_double = a_value;
538  }
539  void set(bool a_value) {
540  reset();
541  m_type = BOOL;
542  u.m_bool = a_value;
543  }
544 
545  void set(const std::string& a_value) {
546  reset();
547  m_type = STRING;
548  u.m_string = new std::string(a_value);
549  }
550  void set(const char* a_value) {
551  // To avoid the bool, const std::string& and passing "text" problem.
552  reset();
553  m_type = STRING;
554  u.m_string = new std::string(a_value);
555  }
556 
557  void set(void* a_value) {
558  reset();
559  m_type = VOID_STAR;
560  u.m_void_star = a_value;
561  }
562 
563  void set(double* a_value) {
564  reset();
566  u.m_double_star = a_value;
567  }
568  void set(float* a_value) {
569  reset();
570  m_type = FLOAT_STAR;
571  u.m_float_star = a_value;
572  }
573  void set(int* a_value) {
574  reset();
575  m_type = INT_STAR;
576  u.m_int_star = a_value;
577  }
578 
579  //unsigned char get_unsigned_char() const {return u.m_unsigned_char;}
580  //char get_char() const {return u.m_char;}
581  unsigned int get_unsigned_int() const {return u.m_unsigned_int;}
582  int get_int() const {return u.m_int;}
583 
584  int64 get_int64() const {return u.m_int64;}
585  uint64 get_unsigned_int64() const {return u.m_unsigned_int64;}
586 
587  unsigned short get_unsigned_short() const{return u.m_unsigned_short;}
588  short get_short() const {return u.m_short;}
589  float get_float() const {return u.m_float;}
590  double get_double() const {return u.m_double;}
591  void* get_void_star() const {return u.m_void_star;}
592  double* get_double_star() const {return u.m_double_star;}
593  float* get_float_star() const {return u.m_float_star;}
594  int* get_int_star() const {return u.m_int_star;}
595  bool get_bool() const {return u.m_bool;}
596 
597  const std::string& get_string() const {return *u.m_string;}
598 
599 #define TOOLS_VALUE_SET(a_what,a_m_what,a_type) \
600  void set(const std::vector<unsigned int>& a_orders,const std::vector<a_what>& a_v){\
601  reset();\
602  m_type = a_type;\
603  u.a_m_what = new array<a_what>(a_orders);\
604  u.a_m_what->fill(a_v);\
605  }
606 
607 //TOOLS_VALUE_SET(unsigned char,m_array_unsigned_char,ARRAY_UNSIGNED_CHAR)
608 //TOOLS_VALUE_SET(char,m_array_char,ARRAY_CHAR)
619 
620 #undef TOOLS_VALUE_SET
621 
622 #define TOOLS_VALUE_SET2(a_what,a_m_what,a_type) \
623  void set(const std::vector<a_what>& a_v){\
624  reset();\
625  m_type = a_type;\
626  std::vector<unsigned int> is(1);\
627  is[0] = (unsigned int)a_v.size();\
628  u.a_m_what = new array<a_what>(is);\
629  u.a_m_what->fill(a_v);\
630  }
631 
632 //TOOLS_VALUE_SET2(unsigned char,m_array_unsigned_char,ARRAY_UNSIGNED_CHAR)
633 //TOOLS_VALUE_SET2(char,m_array_char,ARRAY_CHAR)
644 
645 #undef TOOLS_VALUE_SET2
646 
647 #define TOOLS_VALUE_GET(a_what,a_get_what,a_m_what) \
648  const std::vector<a_what>& a_get_what(std::vector<unsigned int>& a_orders) const {\
649  a_orders = u.a_m_what->orders();\
650  return u.a_m_what->vector();\
651  }
652 
653 //TOOLS_VALUE_GET(unsigned char,get_array_unsigned_char,m_array_unsigned_char)
654 //TOOLS_VALUE_GET(char,get_array_char,m_array_char)
655  TOOLS_VALUE_GET(unsigned short,get_array_unsigned_short,m_array_unsigned_short)
656  TOOLS_VALUE_GET(short,get_array_short,m_array_short)
657  TOOLS_VALUE_GET(unsigned int,get_array_unsigned_int,m_array_unsigned_int)
658  TOOLS_VALUE_GET(int,get_array_int,m_array_int)
659  TOOLS_VALUE_GET(uint64,get_array_unsigned_int64,m_array_unsigned_int64)
660  TOOLS_VALUE_GET(int64,get_array_int64,m_array_int64)
661  TOOLS_VALUE_GET(float,get_array_float,m_array_float)
662  TOOLS_VALUE_GET(double,get_array_double,m_array_double)
663  TOOLS_VALUE_GET(bool,get_array_bool,m_array_bool)
664  TOOLS_VALUE_GET(std::string,get_array_string,m_array_string)
665 
666 #undef TOOLS_VALUE_GET
667 
668 
669 public:
670  bool s_type(std::string& a_s) const {return s_type(m_type,a_s);}
671 
672  static bool s_type(value::e_type a_type,std::string& a_s){
673  switch(a_type) {
674  case NONE:a_s = "NONE";return true;
675  case INT:a_s = "INT";return true;
676  case INT64:a_s = "INT64";return true;
677  case DOUBLE:a_s = "DOUBLE";return true;
678  case STRING:a_s = "STRING";return true;
679  case VOID_STAR:a_s = "VOID_STAR";return true;
680  case DOUBLE_STAR:a_s = "DOUBLE_STAR";return true;
681  case FLOAT_STAR:a_s = "FLOAT_STAR";return true;
682  case INT_STAR:a_s = "INT_STAR";return true;
683  case BOOL:a_s = "BOOL";return true;
684  case SHORT:a_s = "SHORT";return true;
685  case FLOAT:a_s = "FLOAT";return true;
686  //case CHAR:a_s = "CHAR";return true;
687  //case UNSIGNED_CHAR:a_s = "UNSIGNED_CHAR";return true;
688  case UNSIGNED_SHORT:a_s = "UNSIGNED_SHORT";return true;
689  case UNSIGNED_INT:a_s = "UNSIGNED_INT";return true;
690  case UNSIGNED_INT64:a_s = "UNSIGNED_INT64";return true;
691  //case ARRAY_UNSIGNED_CHAR:a_s = "ARRAY_UNSIGNED_CHAR";return true;
692  //case ARRAY_CHAR:a_s = "ARRAY_CHAR";return true;
693  case ARRAY_UNSIGNED_SHORT:a_s = "ARRAY_UNSIGNED_SHORT";return true;
694  case ARRAY_SHORT:a_s = "ARRAY_SHORT";return true;
695  case ARRAY_UNSIGNED_INT:a_s = "ARRAY_UNSIGNED_INT";return true;
696  case ARRAY_INT:a_s = "ARRAY_INT";return true;
697  case ARRAY_UNSIGNED_INT64:a_s = "ARRAY_UNSIGNED_INT64";return true;
698  case ARRAY_INT64:a_s = "ARRAY_INT64";return true;
699  case ARRAY_FLOAT:a_s = "ARRAY_FLOAT";return true;
700  case ARRAY_DOUBLE:a_s = "ARRAY_DOUBLE";return true;
701  case ARRAY_BOOL:a_s = "ARRAY_BOOL";return true;
702  case ARRAY_STRING:a_s = "ARRAY_STRING";return true;
703  default:a_s.clear();return false;
704  }
705 
706  }
707  bool tos(std::string& a_s) const {return tos(*this,a_s);}
708 
709  static bool tos(const value& a_v,std::string& a_s){
710  switch(a_v.m_type) {
711  case NONE:
712  sprintf(a_s,5,"(nil)");
713  return true;
714  case BOOL:
715  sprintf(a_s,5,"%s",a_v.u.m_bool?"true":"false");
716  return true;
717  //case UNSIGNED_CHAR:
718  // sprintf(a_s,32,"%c",a_v.u.m_unsigned_char);
719  // return true;
720  //case CHAR:
721  // sprintf(a_s,32,"%c",a_v.u.m_char);
722  // return true;
723  case UNSIGNED_SHORT:
724  sprintf(a_s,32,"%u",a_v.u.m_unsigned_short);
725  return true;
726  case SHORT:
727  sprintf(a_s,32,"%d",a_v.u.m_short);
728  return true;
729  case UNSIGNED_INT:
730  sprintf(a_s,32,"%u",a_v.u.m_unsigned_int);
731  return true;
732  case INT:
733  sprintf(a_s,32,"%d",a_v.u.m_int);
734  return true;
735  case UNSIGNED_INT64:
736  sprintf(a_s,32,int64_format(),a_v.u.m_unsigned_int64);
737  return true;
738  case INT64:
739  sprintf(a_s,32,int64_format(),a_v.u.m_int64);
740  return true;
741  case FLOAT:
742  sprintf(a_s,32,"%g",a_v.u.m_float);
743  return true;
744  case DOUBLE:
745  sprintf(a_s,32,"%g",a_v.u.m_double);
746  return true;
747  case VOID_STAR:
749  return true;
750  case DOUBLE_STAR:
752  return true;
753  case FLOAT_STAR:
755  return true;
756  case INT_STAR:
758  return true;
759  case STRING:
760  a_s = *a_v.u.m_string;
761  return true;
762 
763  //case ARRAY_UNSIGNED_CHAR:
764  // a_s = tos<unsigned char>(a_v.u.m_array_unsigned_char->vector());
765  // return true;
766  //case ARRAY_CHAR:
767  // a_s = tos<char>(a_v.u.m_array_char->vector());
768  // return true;
769 
771  return nums2s<unsigned short>(a_v.u.m_array_unsigned_short->vector(),a_s);
772  case ARRAY_SHORT:
773  return nums2s<short>(a_v.u.m_array_short->vector(),a_s);
774 
775  case ARRAY_UNSIGNED_INT:
776  return nums2s<unsigned int>(a_v.u.m_array_unsigned_int->vector(),a_s);
777  case ARRAY_INT:
778  return nums2s<int>(a_v.u.m_array_int->vector(),a_s);
779 
781  return nums2s<uint64>(a_v.u.m_array_unsigned_int64->vector(),a_s);
782  case ARRAY_INT64:
783  return nums2s<int64>(a_v.u.m_array_int64->vector(),a_s);
784 
785  case ARRAY_FLOAT:
786  return nums2s<float>(a_v.u.m_array_float->vector(),a_s);
787  case ARRAY_DOUBLE:
788  return nums2s<double>(a_v.u.m_array_double->vector(),a_s);
789  case ARRAY_BOOL:
790  b2s(a_v.u.m_array_bool->vector(),a_s);
791  return true;
792  case ARRAY_STRING:
793  return nums2s<std::string>(a_v.u.m_array_string->vector(),a_s);
794  default:
795  a_s.clear();
796  return false;
797  }
798  }
799 
800 /*
801  size_t header_size() const {return header_size(*this);} //used in base_evaluator::dump()
802  static size_t header_size(const value& a_v){
803  switch(a_v.m_type) {
804  case NONE: return 5;
805 
806  case BOOL: return 5;
807  //case UNSIGNED_CHAR: return 1;
808  //case CHAR: return 1;
809 
810  case INT:
811  case UNSIGNED_SHORT:
812  case SHORT:
813  case FLOAT:
814  case UNSIGNED_INT: return 8;
815 
816 
817  case DOUBLE:
818  case INT64:
819  case UNSIGNED_INT64:
820  case VOID_STAR:
821  case DOUBLE_STAR:
822  case FLOAT_STAR:
823  case INT_STAR:
824  case STRING: return 12;
825 
826  //case ARRAY_UNSIGNED_CHAR:
827  //case ARRAY_CHAR:
828 
829  case ARRAY_UNSIGNED_SHORT:
830  case ARRAY_SHORT:
831  case ARRAY_UNSIGNED_INT:
832  case ARRAY_INT:
833  case ARRAY_UNSIGNED_INT64:
834  case ARRAY_INT64:
835  case ARRAY_FLOAT:
836  case ARRAY_DOUBLE:
837  case ARRAY_BOOL:
838  case ARRAY_STRING: return 5; //size("array")
839  default: return 8;
840  }
841  }
842 */
843 
844  bool to_double(double& a_d) const {
845  switch(m_type) {
846  case INT:
847  a_d = u.m_int;
848  return true;
849  case DOUBLE:
850  a_d = u.m_double;
851  return true;
852  case UNSIGNED_SHORT:
853  a_d = u.m_unsigned_short;
854  return true;
855  case UNSIGNED_INT:
856  a_d = u.m_unsigned_int;
857  return true;
858  case SHORT:
859  a_d = u.m_short;
860  return true;
861  case INT64:
862  a_d = (double)u.m_int64;
863  return true;
864  case UNSIGNED_INT64:
865  a_d = (double)u.m_unsigned_int64;
866  return true;
867  case FLOAT:
868  a_d = u.m_float;
869  return true;
870  //case UNSIGNED_CHAR:
871  // a_d = u.m_unsigned_char;
872  // return true;
873  //case CHAR:
874  // a_d = u.m_char;
875  // return true;
876  case BOOL:
877  a_d = u.m_bool?1:0;
878  return true;
879  case NONE:
880  case STRING:
881  case VOID_STAR:
882  case DOUBLE_STAR:
883  case FLOAT_STAR:
884  case INT_STAR:
885  //case ARRAY_UNSIGNED_CHAR:
886  //case ARRAY_CHAR:
888  case ARRAY_SHORT:
889  case ARRAY_UNSIGNED_INT:
890  case ARRAY_INT:
892  case ARRAY_INT64:
893  case ARRAY_FLOAT:
894  case ARRAY_DOUBLE:
895  case ARRAY_BOOL:
896  case ARRAY_STRING:
897  break;
898  }
899  a_d = 0;
900  return false;
901  }
902 
903  bool is_array() const {
904  switch(m_type) {
905  case INT:
906  case DOUBLE:
907  case UNSIGNED_SHORT:
908  case UNSIGNED_INT:
909  case SHORT:
910  case INT64:
911  case UNSIGNED_INT64:
912  case FLOAT:
913  //case UNSIGNED_CHAR:
914  //case CHAR:
915  case BOOL:
916  case NONE:
917  case STRING:
918  case VOID_STAR:
919  case DOUBLE_STAR:
920  case FLOAT_STAR:
921  case INT_STAR:
922  return false;
923 
924  //case ARRAY_UNSIGNED_CHAR:
925  //case ARRAY_CHAR:
927  case ARRAY_SHORT:
928  case ARRAY_UNSIGNED_INT:
929  case ARRAY_INT:
931  case ARRAY_INT64:
932  case ARRAY_FLOAT:
933  case ARRAY_DOUBLE:
934  case ARRAY_BOOL:
935  case ARRAY_STRING:
936  return true;
937  }
938  return false;
939  }
940 
941  size_t array_size() const {
942  switch(m_type) {
943  case INT:
944  case DOUBLE:
945  case UNSIGNED_SHORT:
946  case UNSIGNED_INT:
947  case SHORT:
948  case INT64:
949  case UNSIGNED_INT64:
950  case FLOAT:
951  //case UNSIGNED_CHAR:
952  //case CHAR:
953  case BOOL:
954  case NONE:
955  case STRING:
956  case VOID_STAR:
957  case DOUBLE_STAR:
958  case FLOAT_STAR:
959  case INT_STAR:
960  return 0;
961 
962  //case ARRAY_UNSIGNED_CHAR:
963  //case ARRAY_CHAR:
965  return u.m_array_unsigned_short->size();
966  case ARRAY_SHORT:
967  return u.m_array_short->size();
968  case ARRAY_UNSIGNED_INT:
969  return u.m_array_unsigned_int->size();
970  case ARRAY_INT:
971  return u.m_array_int->size();
973  return u.m_array_unsigned_int64->size();
974  case ARRAY_INT64:
975  return u.m_array_int64->size();
976  case ARRAY_FLOAT:
977  return u.m_array_float->size();
978  case ARRAY_DOUBLE:
979  return u.m_array_double->size();
980  case ARRAY_BOOL:
981  return u.m_array_bool->size();
982  case ARRAY_STRING:
983  return u.m_array_string->size();
984  }
985  return 0;
986  }
987 
988 #define TOOLS_ARRAY_VEC(a_what,a_get_what,a_m_what) \
989  const std::vector<a_what>& a_get_what() const {return u.a_m_what->vector();}\
990  std::vector<a_what>& a_get_what() {return u.a_m_what->vector();}
991 
992 //TOOLS_ARRAY_VEC(unsigned char,array_unsigned_char,m_array_unsigned_char)
993 //TOOLS_ARRAY_VEC(char,array_char,m_array_char)
994  TOOLS_ARRAY_VEC(unsigned short,array_unsigned_short,m_array_unsigned_short)
995  TOOLS_ARRAY_VEC(short,array_short,m_array_short)
996  TOOLS_ARRAY_VEC(unsigned int,array_unsigned_int,m_array_unsigned_int)
997  TOOLS_ARRAY_VEC(int,array_int,m_array_int)
998  TOOLS_ARRAY_VEC(uint64,array_unsigned_int64,m_array_unsigned_int64)
999  TOOLS_ARRAY_VEC(int64,array_int64,m_array_int64)
1000  TOOLS_ARRAY_VEC(float,array_float,m_array_float)
1001  TOOLS_ARRAY_VEC(double,array_double,m_array_double)
1002  TOOLS_ARRAY_VEC(bool,array_bool,m_array_bool)
1003  TOOLS_ARRAY_VEC(std::string,array_string,m_array_string)
1004 
1005 #undef TOOLS_ARRAY_VEC
1006 
1007 public: // for valop :
1008 
1009  std::string stype() const {
1010  std::string s;
1011  if(!s_type(s)) return "unknown";
1012  return s;
1013  }
1014 
1015  static std::string stype(e_type a_type) {
1016  std::string s;
1017  if(!s_type(a_type,s)) return "unknown";
1018  return s;
1019  }
1020 
1021  static std::string error_div_zero() {return "divide by zero.";}
1022 
1023  static bool assign(value&,const value&,std::string&);
1024 
1025  // operations in Expression.cxx :
1026  static bool minus(value&,std::string&);
1027  static bool do_not(value&,std::string&);
1028 
1029  static bool add(value&,const value&,std::string&);
1030  static bool subtract(value&,const value&,std::string&);
1031  static bool multiply(value&,const value&,std::string&);
1032  static bool divide(value&,const value&,std::string&);
1033 
1034  static bool if_gt(value&,const value&,std::string&);
1035  static bool if_eq(value&,const value&,std::string&);
1036 
1037  static bool if_ne(value& aThis,const value& aV,
1038  std::string& aError) {
1039  if(!if_eq(aThis,aV,aError)) return false;
1040  aThis.u.m_bool = (aThis.u.m_bool?false:true);
1041  return true;
1042  }
1043  static bool if_ge(value& aThis,const value& aV,
1044  std::string& aError){
1045  value tmp(aThis);
1046  if(!if_eq(aThis,aV,aError)) return false;
1047  if(aThis.u.m_bool) return true;
1048  // then not equal, check gt :
1049  if(!if_gt(tmp,aV,aError)) return false;
1050  aThis.u.m_bool = tmp.u.m_bool;
1051  return true;
1052  }
1053 
1054  static bool if_lt(value& aThis,const value& aV,
1055  std::string& aError){
1056  if(!if_ge(aThis,aV,aError)) return false;
1057  aThis.u.m_bool = (aThis.u.m_bool?false:true);
1058  return true;
1059  }
1060 
1061  static bool if_le(value& aThis,const value& aV,
1062  std::string& aError){
1063  if(!if_gt(aThis,aV,aError)) return false;
1064  aThis.u.m_bool = (aThis.u.m_bool?false:true);
1065  return true;
1066  }
1067 
1068  static bool if_and(value&,const value&,std::string&);
1069  static bool if_or(value&,const value&,std::string&);
1070 
1071  static bool to_double(const value&,double&);
1072  static bool cxx_type(const value&,std::string&);
1073 
1074  //static bool i_set(value&,const Slash::Core::Ivalue&);
1075  static std::string to_string(const value&);
1076 
1077 protected:
1078  void reset() {
1079  if(m_type==STRING) {
1080  delete u.m_string;
1081  u.m_string = 0;
1082 
1083  //} else if(m_type==ARRAY_UNSIGNED_CHAR) {
1084  // delete u.m_array_unsigned_char;u.m_array_unsigned_char = 0;
1085 
1086  //} else if(m_type==ARRAY_CHAR) {
1087  // delete u.m_array_char;u.m_array_char = 0;
1088 
1089  } else if(m_type==ARRAY_UNSIGNED_SHORT) {
1090  delete u.m_array_unsigned_short;u.m_array_unsigned_short = 0;
1091 
1092  } else if(m_type==ARRAY_SHORT) {
1093  delete u.m_array_short;u.m_array_short = 0;
1094 
1095  } else if(m_type==ARRAY_UNSIGNED_INT) {
1096  delete u.m_array_unsigned_int;u.m_array_unsigned_int = 0;
1097 
1098  } else if(m_type==ARRAY_INT) {
1099  delete u.m_array_int;u.m_array_int = 0;
1100 
1101  } else if(m_type==ARRAY_UNSIGNED_INT64) {
1102  delete u.m_array_unsigned_int64;u.m_array_unsigned_int64 = 0;
1103 
1104  } else if(m_type==ARRAY_INT64) {
1105  delete u.m_array_int64;u.m_array_int64 = 0;
1106 
1107  } else if(m_type==ARRAY_FLOAT) {
1108  delete u.m_array_float;u.m_array_float = 0;
1109 
1110  } else if(m_type==ARRAY_DOUBLE) {
1111  delete u.m_array_double;u.m_array_double = 0;
1112 
1113  } else if(m_type==ARRAY_BOOL) {
1114  delete u.m_array_bool;u.m_array_bool = 0;
1115 
1116  } else if(m_type==ARRAY_STRING) {
1117  delete u.m_array_string;u.m_array_string = 0;
1118 
1119  } else {
1120  u.m_unsigned_int64 = 0;
1121  }
1122  }
1123 protected:
1124  std::string* m_label;
1125  unsigned int m_itag;
1126 protected:
1128  union {
1129  bool m_bool;
1130  //char m_char;
1131  int m_int;
1132  short m_short;
1134  float m_float;
1135  double m_double;
1136  //unsigned char m_unsigned_char;
1137  unsigned short m_unsigned_short;
1138  unsigned int m_unsigned_int;
1141  double* m_double_star;
1144  std::string* m_string;
1145 
1158  } u;
1159 };
1160 
1161 }
1162 
1163 #include "value.icc"
1164 
1165 #endif
tools::upointer_format_x
const char * upointer_format_x()
Definition: typedefs:80
tools::value::m_string
std::string * m_string
Definition: value:1144
tools::value::ARRAY_SHORT
@ ARRAY_SHORT
Definition: value:51
tools::value::set
void set(int *a_value)
Definition: value:573
tools::value::m_array_unsigned_char
array< unsigned char > * m_array_unsigned_char
Definition: value:1146
tools::uint64
unsigned long long uint64
Definition: typedefs:72
tools::value::operator=
value & operator=(const value &a_from)
Definition: value:337
tools::value::tos
static bool tos(const value &a_v, std::string &a_s)
Definition: value:709
tools::value::set
void set(double *a_value)
Definition: value:563
tools::int64
long long int64
Definition: typedefs:67
tools::value::set
void set(unsigned short a_value)
Definition: value:504
tools::value::m_array_double
array< double > * m_array_double
Definition: value:1155
tools::value::if_eq
static bool if_eq(value &, const value &, std::string &)
tools::value::is_array
bool is_array() const
Definition: value:903
tools::value
Definition: value:18
typedefs
tools::value::value
value(unsigned short a_value)
Definition: value:151
tools::value::value
value(const char *a_value)
Definition: value:194
tools::value::type
e_type type() const
Definition: value:440
num2s
tools::value::do_not
static bool do_not(value &, std::string &)
tools::value::value
value(unsigned int a_value)
Definition: value:158
tools::value::get_float_star
float * get_float_star() const
Definition: value:593
tools::value::reset
void reset()
Definition: value:1078
tools::value::ARRAY_FLOAT
@ ARRAY_FLOAT
Definition: value:56
tools::value::INT_STAR
@ INT_STAR
Definition: value:45
tools::value::if_lt
static bool if_lt(value &aThis, const value &aV, std::string &aError)
Definition: value:1054
tools::value::multiply
static bool multiply(value &, const value &, std::string &)
tools::value::FLOAT
@ FLOAT
Definition: value:36
tools::value::DOUBLE_STAR
@ DOUBLE_STAR
Definition: value:43
tools::value::m_double_star
double * m_double_star
Definition: value:1141
tools::value::get_string
const std::string & get_string() const
Definition: value:597
tools::value::set
void set(float a_value)
Definition: value:529
tools::value::value
value(float a_value)
Definition: value:129
tools::value::UNSIGNED_SHORT
@ UNSIGNED_SHORT
Definition: value:29
tools::value::set
void set(bool a_value)
Definition: value:539
tools::value::subtract
static bool subtract(value &, const value &, std::string &)
tools::value::get_double
double get_double() const
Definition: value:590
tools::value::set
void set(double a_value)
Definition: value:534
tools::value::m_type
e_type m_type
Definition: value:1127
tools::value::to_string
static std::string to_string(const value &)
tools::value::m_short
short m_short
Definition: value:1132
tools::value::~value
virtual ~value()
Definition: value:275
tools::value::m_itag
unsigned int m_itag
Definition: value:1125
tools::value::set
void set(const char *a_value)
Definition: value:550
tools::value::m_array_unsigned_int
array< unsigned int > * m_array_unsigned_int
Definition: value:1152
tools::value::if_ne
static bool if_ne(value &aThis, const value &aV, std::string &aError)
Definition: value:1037
tools::value::if_gt
static bool if_gt(value &, const value &, std::string &)
tools::value::to_double
bool to_double(double &a_d) const
Definition: value:844
tools::value::m_bool
bool m_bool
Definition: value:1129
tools::value::m_array_unsigned_int64
array< uint64 > * m_array_unsigned_int64
Definition: value:1150
tools::value::m_unsigned_int
unsigned int m_unsigned_int
Definition: value:1138
tools::value::m_float_star
float * m_float_star
Definition: value:1142
value.icc
tools::value::value
value(int *a_value)
Definition: value:186
tools::value::e_type
e_type
Definition: value:24
tools::value::get_unsigned_int
unsigned int get_unsigned_int() const
Definition: value:581
tools::value::set_type
void set_type(e_type a_type)
Definition: value:441
tools::value::if_le
static bool if_le(value &aThis, const value &aV, std::string &aError)
Definition: value:1061
tools::value::ARRAY_DOUBLE
@ ARRAY_DOUBLE
Definition: value:57
tools::value::DOUBLE
@ DOUBLE
Definition: value:37
tools::value::ARRAY_STRING
@ ARRAY_STRING
Definition: value:59
tools::value::tos
bool tos(std::string &a_s) const
Definition: value:707
tools::value::value
value(double a_value)
Definition: value:136
tools::value::set
void set(short a_value)
Definition: value:499
tools::value::ARRAY_UNSIGNED_INT
@ ARRAY_UNSIGNED_INT
Definition: value:52
tools::value::value
value(const std::string &a_value)
Definition: value:201
mem
tools::value::ARRAY_INT64
@ ARRAY_INT64
Definition: value:55
tools::value::u
union tools::value::@0 u
tools::value::ARRAY_INT
@ ARRAY_INT
Definition: value:53
tools::value::FLOAT_STAR
@ FLOAT_STAR
Definition: value:44
tools::value::set
void set(const std::string &a_value)
Definition: value:545
tools::value::VOID_STAR
@ VOID_STAR
Definition: value:42
tools::b2s
void b2s(bool a_value, std::string &a_s)
Definition: b2s:11
tools::value::set_label
void set_label(const std::string &a_s)
Definition: value:434
tools::value::value
value(const value &a_from)
Definition: value:283
tools::value::error_div_zero
static std::string error_div_zero()
Definition: value:1021
array
tools::value::set
void set(void *a_value)
Definition: value:557
tools::value::set
void set(int64 a_value)
Definition: value:519
tools::value::m_array_unsigned_short
array< unsigned short > * m_array_unsigned_short
Definition: value:1148
tools::value::set_none
void set_none()
Definition: value:484
tools::value::stype
static std::string stype(e_type a_type)
Definition: value:1015
tools::value::get_int_star
int * get_int_star() const
Definition: value:594
TOOLS_VALUE_CSTOR
#define TOOLS_VALUE_CSTOR(a_what, a_m_what, a_type)
Definition: value:220
tools::value::STRING
@ STRING
Definition: value:40
tools::value::m_array_int64
array< int64 > * m_array_int64
Definition: value:1151
tools::value::minus
static bool minus(value &, std::string &)
tools::value::value
value(uint64 a_value)
Definition: value:122
tools::value::value
value(double *a_value)
Definition: value:172
tools::value::get_bool
bool get_bool() const
Definition: value:595
tools::upointer
unsigned long upointer
Definition: typedefs:78
tools::int64_format
const char * int64_format()
Definition: typedefs:69
tools::value::if_ge
static bool if_ge(value &aThis, const value &aV, std::string &aError)
Definition: value:1043
tools::value::divide
static bool divide(value &, const value &, std::string &)
tools::value::stype
std::string stype() const
Definition: value:1009
TOOLS_VALUE_CSTORA
#define TOOLS_VALUE_CSTORA(a_what, a_m_what, a_type)
Definition: value:253
tools::value::value
value(short a_value)
Definition: value:101
tools
inlined C code : ///////////////////////////////////
Definition: aida_ntuple:26
tools::value::get_short
short get_short() const
Definition: value:588
tools::value::m_label
std::string * m_label
Definition: value:1124
tools::value::UNSIGNED_INT
@ UNSIGNED_INT
Definition: value:31
tools::value::cxx_type
static bool cxx_type(const value &, std::string &)
tools::value::get_void_star
void * get_void_star() const
Definition: value:591
tools::value::m_int
int m_int
Definition: value:1131
tools::value::set
void set(unsigned int a_value)
Definition: value:514
tools::value::to_double
static bool to_double(const value &, double &)
tools::value::m_array_char
array< char > * m_array_char
Definition: value:1147
tools::value::m_unsigned_int64
uint64 m_unsigned_int64
Definition: value:1139
tools::value::get_float
float get_float() const
Definition: value:589
tools::value::get_int
int get_int() const
Definition: value:582
tools::value::value
value(int a_value)
Definition: value:108
tools::array< unsigned short >
tools::value::label
const std::string & label() const
Definition: value:438
tools::sprintf
bool sprintf(std::string &a_string, int a_length, const char *a_format,...)
Definition: sprintf:34
tools::value::array_size
size_t array_size() const
Definition: value:941
tools::value::m_array_bool
array< bool > * m_array_bool
Definition: value:1156
tools::value::get_unsigned_short
unsigned short get_unsigned_short() const
Definition: value:587
tools::value::m_int64
int64 m_int64
Definition: value:1133
tools::value::m_array_string
array< std::string > * m_array_string
Definition: value:1157
tools::value::s_type
static bool s_type(value::e_type a_type, std::string &a_s)
Definition: value:672
tools::value::ARRAY_BOOL
@ ARRAY_BOOL
Definition: value:58
tools::value::UNSIGNED_INT64
@ UNSIGNED_INT64
Definition: value:33
tools::value::get_int64
int64 get_int64() const
Definition: value:584
b2s
tools::value::add
static bool add(value &, const value &, std::string &)
tools::value::set_itag
void set_itag(unsigned int a_itag)
Definition: value:432
tools::value::itag
unsigned int itag() const
Definition: value:433
TOOLS_VALUE_SET
#define TOOLS_VALUE_SET(a_what, a_m_what, a_type)
Definition: value:599
TOOLS_VALUE_GET
#define TOOLS_VALUE_GET(a_what, a_get_what, a_m_what)
Definition: value:647
tools::value::ARRAY_UNSIGNED_INT64
@ ARRAY_UNSIGNED_INT64
Definition: value:54
tools::value::if_or
static bool if_or(value &, const value &, std::string &)
tools::value::m_array_int
array< int > * m_array_int
Definition: value:1153
tools::value::SHORT
@ SHORT
Definition: value:30
tools::value::ARRAY_UNSIGNED_SHORT
@ ARRAY_UNSIGNED_SHORT
Definition: value:50
tools::value::if_and
static bool if_and(value &, const value &, std::string &)
tools::value::m_float
float m_float
Definition: value:1134
tools::value::value
value(void *a_value)
Definition: value:165
tools::value::INT
@ INT
Definition: value:32
tools::value::value
value(int64 a_value)
Definition: value:115
tools::value::get_double_star
double * get_double_star() const
Definition: value:592
tools::value::value
value(float *a_value)
Definition: value:179
tools::value::m_unsigned_short
unsigned short m_unsigned_short
Definition: value:1137
tools::value::set
void set(float *a_value)
Definition: value:568
tools::value::value
value(bool a_value)
Definition: value:87
tools::value::s_type
bool s_type(std::string &a_s) const
Definition: value:670
tools::value::set
void set(uint64 a_value)
Definition: value:524
tools::value::value
value()
Definition: value:79
tools::value::assign
static bool assign(value &, const value &, std::string &)
TOOLS_VALUE_SET2
#define TOOLS_VALUE_SET2(a_what, a_m_what, a_type)
Definition: value:622
TOOLS_ARRAY_VEC
#define TOOLS_ARRAY_VEC(a_what, a_get_what, a_m_what)
Definition: value:988
tools::value::m_array_float
array< float > * m_array_float
Definition: value:1154
tools::value::m_double
double m_double
Definition: value:1135
tools::value::m_array_short
array< short > * m_array_short
Definition: value:1149
tools::value::m_int_star
int * m_int_star
Definition: value:1143
tools::value::INT64
@ INT64
Definition: value:34
tools::value::BOOL
@ BOOL
Definition: value:39
tools::array::vector
const std::vector< T > & vector() const
Definition: array:161
tools::value::get_unsigned_int64
uint64 get_unsigned_int64() const
Definition: value:585
tools::value::NONE
@ NONE
Definition: value:25
tools::value::set
void set(int a_value)
Definition: value:509
tools::value::m_void_star
void * m_void_star
Definition: value:1140