Visualization Library 2.1.0

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Value.hpp
Go to the documentation of this file.
1 /**************************************************************************************/
2 /* */
3 /* Visualization Library */
4 /* http://visualizationlibrary.org */
5 /* */
6 /* Copyright (c) 2005-2020, Michele Bosi */
7 /* All rights reserved. */
8 /* */
9 /* Redistribution and use in source and binary forms, with or without modification, */
10 /* are permitted provided that the following conditions are met: */
11 /* */
12 /* - Redistributions of source code must retain the above copyright notice, this */
13 /* list of conditions and the following disclaimer. */
14 /* */
15 /* - Redistributions in binary form must reproduce the above copyright notice, this */
16 /* list of conditions and the following disclaimer in the documentation and/or */
17 /* other materials provided with the distribution. */
18 /* */
19 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND */
20 /* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED */
21 /* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
22 /* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR */
23 /* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES */
24 /* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
25 /* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */
26 /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
27 /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */
28 /* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
29 /* */
30 /**************************************************************************************/
31 
32 #ifndef VLXValue_INCLUDE_ONCE
33 #define VLXValue_INCLUDE_ONCE
34 
35 #include <vlX/link_config.hpp>
36 #include <vlX/Visitor.hpp>
37 #include <vector>
38 
39 namespace vlX
40 {
42  class VLXTaggedValue: public vl::Object
43  {
44  VL_INSTRUMENT_ABSTRACT_CLASS(vlX::TaggedValue, vl::Object)
45 
46  public:
47  VLXTaggedValue(const char* tag=NULL): mLineNumber(0)
48  {
49  if (tag)
50  mTag = tag;
51  }
52 
53  virtual ~VLXTaggedValue() {}
54 
55  int lineNumber() const { return mLineNumber; }
56 
57  void setLineNumber(int line) { mLineNumber = line; }
58 
59  virtual void acceptVisitor(Visitor*) = 0;
60 
61  void setTag(const char* tag) { mTag = tag; }
62 
63  const std::string& tag() const { return mTag; }
64 
65  private:
66  std::string mTag;
67  int mLineNumber; // the line number coming from the tokenizer
68  };
69  //-----------------------------------------------------------------------------
72  {
73  VL_INSTRUMENT_CLASS(vlX::RawtextBlock, VLXTaggedValue)
74 
75  public:
76  VLXRawtextBlock(const char* tag=NULL, const char* value=NULL): VLXTaggedValue(tag)
77  {
78  if (value)
79  mValue = value;
80  }
81 
82  virtual void acceptVisitor(Visitor* v) { v->visitRawtextBlock(this); }
83 
84  std::string& value() { return mValue; }
85 
86  const std::string& value() const { return mValue; }
87 
88  void setValue(const char* value) { mValue = value; }
89 
90  private:
91  std::string mValue;
92  };
93  //-----------------------------------------------------------------------------
95  class VLXArray: public VLXTaggedValue
96  {
98 
99  public:
100  VLXArray(const char* tag=NULL): VLXTaggedValue(tag) {}
101 
102  };
103  //-----------------------------------------------------------------------------
105  template<typename T>
107  {
108  VL_INSTRUMENT_ABSTRACT_CLASS(vlX::ArrayTemplate<T>, VLXArray)
109 
110  public:
111  typedef T scalar_type;
112 
113  public:
114  VLXArrayTemplate(const char* tag=NULL): VLXArray(tag) { }
115 
116  std::vector<T>& value() { return mValue; }
117 
118  const std::vector<T>& value() const { return mValue; }
119 
120  T* ptr() { if (mValue.empty()) return NULL; else return &mValue[0]; }
121 
122  const T* ptr() const { if (mValue.empty()) return NULL; else return &mValue[0]; }
123 
124  template<typename T2> void copyTo(T2*ptr) const { for(size_t i=0; i<mValue.size(); ++i, ++ptr) *ptr = (T2)mValue[i]; }
125 
126  template<typename T2> void copyFrom(const T2*ptr) { for(size_t i=0; i<mValue.size(); ++i, ++ptr) mValue[i] = (scalar_type)*ptr; }
127 
128  private:
129  std::vector<T> mValue;
130  };
131  //-----------------------------------------------------------------------------
133  class VLXArrayInteger: public VLXArrayTemplate<long long>
134  {
136 
137  public:
138  VLXArrayInteger(const char* tag=NULL): VLXArrayTemplate<long long>(tag) { }
139 
140  virtual void acceptVisitor(Visitor* v) { v->visitArray(this); }
141  };
142  //-----------------------------------------------------------------------------
144  class VLXArrayReal: public VLXArrayTemplate<double>
145  {
147 
148  public:
149  VLXArrayReal(const char* tag=NULL): VLXArrayTemplate<double>(tag) { }
150 
151  virtual void acceptVisitor(Visitor* v) { v->visitArray(this); }
152  };
153  //-----------------------------------------------------------------------------
154  /*
155  class VLXArrayString: public VLXArray
156  {
157  VL_INSTRUMENT_CLASS(vlX::ArrayString, VLXArray)
158 
159  public:
160  VLXArrayString(const char* tag=NULL): VLXArray(tag) { }
161 
162  virtual void acceptVisitor(Visitor* v) { v->visitArray(this); }
163 
164  std::vector<std::string>& value() { return mValue; }
165 
166  const std::vector<std::string>& value() const { return mValue; }
167 
168  std::string* ptr() { if (mValue.empty()) return NULL; else return &mValue[0]; }
169 
170  const std::string* ptr() const { if (mValue.empty()) return NULL; else return &mValue[0]; }
171 
172  public:
173  std::vector<std::string> mValue;
174  };
175  //-----------------------------------------------------------------------------
176  class VLXArrayIdentifier: public VLXArray
177  {
178  VL_INSTRUMENT_CLASS(vlX::ArrayIdentifier, VLXArray)
179 
180  public:
181  VLXArrayIdentifier(const char* tag=NULL): VLXArray(tag) { }
182 
183  virtual void acceptVisitor(Visitor* v) { v->visitArray(this); }
184 
185  std::vector<std::string>& value() { return mValue; }
186 
187  const std::vector<std::string>& value() const { return mValue; }
188 
189  std::string* ptr() { if (mValue.empty()) return NULL; else return &mValue[0]; }
190 
191  const std::string* ptr() const { if (mValue.empty()) return NULL; else return &mValue[0]; }
192 
193  public:
194  std::vector<std::string> mValue;
195  };
196  //-----------------------------------------------------------------------------
197  class VLXArrayID: public VLXArray
198  {
199  VL_INSTRUMENT_CLASS(vlX::ArrayID, VLXArray)
200 
201  public:
202  VLXArrayID(const char* tag=NULL): VLXArray(tag) { }
203 
204  virtual void acceptVisitor(Visitor* v) { v->visitArray(this); }
205 
206  class VLXValue
207  {
208  public:
209  VLXValue(const char* uid): mID(uid) {}
210 
211  void setID(const char* uid) { mID = uid; }
212 
213  const char* uid() const { return mID.c_str(); }
214 
215  void setStructure(VLXStructure* obj) { mObj = obj; }
216 
217  VLXStructure* object() { return mObj.get(); }
218 
219  const VLXStructure* object() const { return mObj.get(); }
220 
221  private:
222  std::string mID; // the ID string
223  ref<VLXStructure> mObj; // the linked object
224  };
225 
226  std::vector<VLXValue>& value() { return mValue; }
227 
228  const std::vector<VLXValue>& value() const { return mValue; }
229 
230  VLXValue* ptr() { if (mValue.empty()) return NULL; else return &mValue[0]; }
231 
232  const VLXValue* ptr() const { if (mValue.empty()) return NULL; else return &mValue[0]; }
233 
234  public:
235  std::vector<VLXValue> mValue;
236  };
237  */
238  //-----------------------------------------------------------------------------
240  class VLXValue
241  {
242  public:
243  enum EType
244  {
250  ID,
255  ArrayReal
256  /*
257  ArrayString,
258  ArrayIdentifier,
259  ArrayID,
260  */
261  };
262 
263  private:
264  VLX_EXPORT void release();
265 
266  public:
268  {
269  mLineNumber = 0;
270  mType = Integer;
271  mUnion.mInteger = 0;
272  }
273 
275  {
276  mLineNumber = 0;
277  mType = Integer;
278  mUnion.mInteger = 0;
279 
280  setStructure(obj);
281  }
282 
284  {
285  mLineNumber = 0;
286  mType = Integer;
287  mUnion.mInteger = 0;
288 
289  setList(list);
290  }
291 
293  {
294  mLineNumber = 0;
295  mType = Integer;
296  mUnion.mInteger = 0;
297 
298  setRawtextBlock(rawtext);
299  }
300 
302  {
303  mLineNumber = 0;
304  mType = Integer;
305  mUnion.mInteger = 0;
306  setArrayInteger(arr);
307  }
308 
310  {
311  mLineNumber = 0;
312  mType = Integer;
313  mUnion.mInteger = 0;
314  setArrayReal(arr);
315  }
316 
317  /*
318  VLXValue(VLXArrayString* arr)
319  {
320  mLineNumber = 0;
321  mType = Integer;
322  mUnion.mInteger = 0;
323  setArrayString(arr);
324  }
325 
326  VLXValue(VLXArrayIdentifier* arr)
327  {
328  mLineNumber = 0;
329  mType = Integer;
330  mUnion.mInteger = 0;
331  setArrayIdentifier(arr);
332  }
333 
334  VLXValue(VLXArrayID* arr)
335  {
336  mLineNumber = 0;
337  mType = Integer;
338  mUnion.mInteger = 0;
339  setArrayID(arr);
340  }
341  */
342 
343  VLXValue(long long i)
344  {
345  mLineNumber = 0;
346  mType = Integer;
347  mUnion.mInteger = i;
348  }
349 
350  VLXValue(double d)
351  {
352  mLineNumber = 0;
353  mType = Real;
354  mUnion.mReal = d;
355  }
356 
357  VLXValue(const char* str, EType type)
358  {
359  mLineNumber = 0;
360  mType = Integer;
361  mUnion.mInteger = 0;
362 
363  switch(type)
364  {
365  case String: setString(str); break;
366  case Identifier: setIdentifier(str); break;
367  case ID: setID(str); break;
368  default:
369  VL_TRAP();
370  break;
371  }
372  }
373 
374  VLXValue(bool boolean)
375  {
376  mLineNumber = 0;
377  mType = Integer;
378  mUnion.mInteger = 0;
379 
380  setBool(boolean);
381  }
382 
383  VLXValue(const VLXValue& other)
384  {
385  mType = Integer;
386  mUnion.mInteger = 0;
387  mLineNumber = 0;
388 
389  *this = other;
390  }
391 
392  ~VLXValue() { release(); }
393 
394  VLX_EXPORT VLXValue& operator=(const VLXValue& other);
395 
396  EType type() const { return mType; }
397 
398  // object
399 
400  VLX_EXPORT VLXStructure* setStructure(VLXStructure*);
401 
402  VLXStructure* getStructure() { VL_CHECK(mType == Structure); return mUnion.mStructure; }
403 
404  const VLXStructure* getStructure() const { VL_CHECK(mType == Structure); return mUnion.mStructure; }
405 
406  // list
407 
408  VLX_EXPORT VLXList* setList(VLXList*);
409 
410  VLXList* getList() { VL_CHECK(mType == List); return mUnion.mList; }
411 
412  const VLXList* getList() const { VL_CHECK(mType == List); return mUnion.mList; }
413 
414  // rawtext block
415 
416  VLX_EXPORT VLXRawtextBlock* setRawtextBlock(VLXRawtextBlock*);
417 
418  VLXRawtextBlock* getRawtextBlock() { VL_CHECK(mType == RawtextBlock); return mUnion.mRawtextBlock; }
419 
420  const VLXRawtextBlock* getRawtextBlock() const { VL_CHECK(mType == RawtextBlock); return mUnion.mRawtextBlock; }
421 
422  // array
423 
424  VLX_EXPORT VLXArray* setArray(VLXArray*);
425  VLX_EXPORT VLXArrayInteger* setArrayInteger(VLXArrayInteger*);
426  VLX_EXPORT VLXArrayReal* setArrayReal(VLXArrayReal*);
427  /*
428  VLX_EXPORT VLXArrayString* setArrayString(VLXArrayString*);
429  VLX_EXPORT VLXArrayIdentifier* setArrayIdentifier(VLXArrayIdentifier*);
430  VLX_EXPORT VLXArrayID* setArrayID(VLXArrayID*);
431  */
432 
433  /*
434  VLXArrayString* getArrayString() { VL_CHECK(mType == ArrayString); return mUnion.mArray->as<VLXArrayString>(); }
435  const VLXArrayString* getArrayString() const { VL_CHECK(mType == ArrayString); return mUnion.mArray->as<VLXArrayString>(); }
436 
437  VLXArrayIdentifier* getArrayIdentifier() { VL_CHECK(mType == ArrayIdentifier); return mUnion.mArray->as<VLXArrayIdentifier>(); }
438  const VLXArrayIdentifier* getArrayIdentifier() const { VL_CHECK(mType == ArrayIdentifier); return mUnion.mArray->as<VLXArrayIdentifier>(); }
439 
440  VLXArrayID* getArrayID() { VL_CHECK(mType == ArrayID); return mUnion.mArray->as<VLXArrayID>(); }
441  const VLXArrayID* getArrayID() const { VL_CHECK(mType == ArrayID); return mUnion.mArray->as<VLXArrayID>(); }
442  */
443 
444  VLXArrayInteger* getArrayInteger() { VL_CHECK(mType == ArrayInteger); return mUnion.mArray->as<VLXArrayInteger>(); }
445  const VLXArrayInteger* getArrayInteger() const { VL_CHECK(mType == ArrayInteger); return mUnion.mArray->as<VLXArrayInteger>(); }
446 
447  VLXArrayReal* getArrayReal() { VL_CHECK(mType == ArrayReal); return mUnion.mArray->as<VLXArrayReal>(); }
448  const VLXArrayReal* getArrayReal() const { VL_CHECK(mType == ArrayReal); return mUnion.mArray->as<VLXArrayReal>(); }
449 
450  // string
451 
452  const std::string& setString(const char* str)
453  {
454  release();
455  mType = String;
456  mUnion.mString = new std::string(str);
457  return *mUnion.mString;
458  }
459 
460  const std::string& getString() const { VL_CHECK(mType == String); return *mUnion.mString; }
461 
462  // identifier
463 
464  const std::string& setIdentifier(const char* str)
465  {
466  release();
467  mType = Identifier;
468  mUnion.mString = new std::string(str);
469  return *mUnion.mString;
470  }
471 
472  const std::string& getIdentifier() const { VL_CHECK(mType == Identifier); return *mUnion.mString; }
473 
474  // uid
475 
476  const std::string& setID(const char* str)
477  {
478  release();
479  mType = ID;
480  mUnion.mString = new std::string(str);
481  return *mUnion.mString;
482  }
483 
484  const std::string& getID() const { VL_CHECK(mType == ID); return *mUnion.mString; }
485 
486  // integer
487 
488  long long setInteger(long long val)
489  {
490  release();
491  mType = Integer;
492  return mUnion.mInteger = val;
493  }
494 
495  long long getInteger() const { VL_CHECK(mType == Integer); return mUnion.mInteger; }
496 
497  // floating point
498 
499  double setReal(double val)
500  {
501  release();
502  mType = Real;
503  return mUnion.mReal = val;
504  }
505 
506  double getReal() const { VL_CHECK(mType == Real); return mUnion.mReal; }
507 
508  // bool
509 
510  bool setBool(bool val)
511  {
512  release();
513  mType = Bool;
514  return mUnion.mBool = val;
515  }
516 
517  bool getBool() const { VL_CHECK(mType == Bool); return mUnion.mBool; }
518 
519  int lineNumber() const { return mLineNumber; }
520 
521  void setLineNumber(int line) { mLineNumber = line; }
522 
523  private:
524  union
525  {
526  bool mBool;
527  long long mInteger;
528  double mReal;
529  std::string* mString;
534  } mUnion;
535 
536  EType mType;
537  int mLineNumber; // the line number coming from the tokenizer
538  };
539  //-----------------------------------------------------------------------------
542  {
543  VL_INSTRUMENT_CLASS(vlX::Structure, VLXTaggedValue)
544 
545  public:
547  {
548  mKeyValue.reserve(16);
549  setID("#NULL");
550  }
551 
552  VLXStructure(const char* tag)
553  {
554  mKeyValue.reserve(16);
555  setID("#NULL");
556  setTag(tag);
557  }
558 
559  VLXStructure(const char* tag, const std::string& uid)
560  {
561  mKeyValue.reserve(16);
562  setID(uid.c_str());
563  setTag(tag);
564  }
565 
566  virtual void acceptVisitor(Visitor* v) { v->visitStructure(this); }
567 
568  VLXStructure& operator<<(const char* str)
569  {
570  value().resize( value().size() + 1 );
571  value().back().setKey(str);
572  return *this;
573  }
574 
576  {
577  value().back().setValue(val);
578  return *this;
579  }
580 
582  class KeyValue
583  {
584  friend class VLXStructure;
585 
586  public:
587  KeyValue() {}
588  KeyValue(const char* key, vlX::VLXValue value): mKey(key), mValue(value) {}
589 
590  std::string& key() { return mKey; }
591  const std::string& key() const { return mKey; }
592  void setKey(const char* key) { mKey = key; }
593 
594  vlX::VLXValue& value() { return mValue; }
595  const vlX::VLXValue& value() const { return mValue; }
596  void setValue(const vlX::VLXValue& value) { mValue = value; }
597 
598  private:
599  std::string mKey;
600  vlX::VLXValue mValue;
601  };
602 
603  void setID(const char* uid) { mID = uid; }
604 
605  const std::string& uid() const { return mID; }
606 
607  std::vector<KeyValue>& value() { return mKeyValue; }
608 
609  const std::vector<KeyValue>& value() const { return mKeyValue; }
610 
611  // mic fixme: we can speed this guys up with multimaps if we really want
612  vlX::VLXValue* getValue(const char* key)
613  {
614  for(size_t i=0; i<mKeyValue.size(); ++i)
615  if (mKeyValue[i].key() == key)
616  return &mKeyValue[i].value();
617  return NULL;
618  }
619 
620  const vlX::VLXValue* getValue(const char* key) const
621  {
622  for(size_t i=0; i<mKeyValue.size(); ++i)
623  if (mKeyValue[i].key() == key)
624  return &mKeyValue[i].value();
625  return NULL;
626  }
627 
628  private:
629  std::string mID;
630  std::vector<KeyValue> mKeyValue;
631  };
632  //-----------------------------------------------------------------------------
634  class VLXList: public VLXTaggedValue
635  {
637 
638  public:
640  {
641  mValue.reserve(16);
642  }
643 
645  {
646  value().push_back( val );
647  return *this;
648  }
649 
650  virtual void acceptVisitor(Visitor* v) { v->visitList(this); }
651 
652  std::vector< VLXValue >& value() { return mValue; }
653 
654  const std::vector< VLXValue >& value() const { return mValue; }
655 
656  private:
657  std::vector< VLXValue > mValue;
658  };
659 }
660 
661 #endif
VLXList(const char *tag=NULL)
Definition: Value.hpp:639
double setReal(double val)
Definition: Value.hpp:499
const std::vector< VLXValue > & value() const
Definition: Value.hpp:654
void setKey(const char *key)
Definition: Value.hpp:592
VLXValue(VLXArrayInteger *arr)
Definition: Value.hpp:301
VLXArray * mArray
Definition: Value.hpp:532
VLXRawtextBlock * getRawtextBlock()
Definition: Value.hpp:418
VLXStructure * mStructure
Definition: Value.hpp:530
VLXRawtextBlock(const char *tag=NULL, const char *value=NULL)
Definition: Value.hpp:76
Wrapper for all VLX value types.
Definition: Value.hpp:240
VLXValue(VLXStructure *obj)
Definition: Value.hpp:274
const std::vector< KeyValue > & value() const
Definition: Value.hpp:609
virtual void acceptVisitor(Visitor *v)
Definition: Value.hpp:151
vlX::VLXValue * getValue(const char *key)
Definition: Value.hpp:612
vlX::VLXValue & value()
Definition: Value.hpp:594
bool mBool
Definition: Value.hpp:526
void setValue(const char *value)
Definition: Value.hpp:88
VLXStructure(const char *tag)
Definition: Value.hpp:552
Key/value pair used by VLXStructure.
Definition: Value.hpp:582
VLXList * getList()
Definition: Value.hpp:410
A templated VLXArray.
Definition: Value.hpp:106
long long setInteger(long long val)
Definition: Value.hpp:488
VLXValue(VLXList *list)
Definition: Value.hpp:283
void setLineNumber(int line)
Definition: Value.hpp:521
std::string & value()
Definition: Value.hpp:84
void setTag(const char *tag)
Definition: Value.hpp:61
VLXValue(double d)
Definition: Value.hpp:350
void copyTo(T2 *ptr) const
Definition: Value.hpp:124
VLXTaggedValue(const char *tag=NULL)
Definition: Value.hpp:47
void copyFrom(const T2 *ptr)
Definition: Value.hpp:126
An array of 64 bits floating point numbers, can also have a tag.
Definition: Value.hpp:144
const VLXArrayInteger * getArrayInteger() const
Definition: Value.hpp:445
double getReal() const
Definition: Value.hpp:506
const std::string & value() const
Definition: Value.hpp:86
VLXArray(const char *tag=NULL)
Definition: Value.hpp:100
const std::string & getID() const
Definition: Value.hpp:484
virtual void acceptVisitor(Visitor *v)
Definition: Value.hpp:650
VLXStructure * getStructure()
Definition: Value.hpp:402
#define VL_INSTRUMENT_CLASS(ClassName, BaseClass)
Definition: TypeInfo.hpp:122
std::string & key()
Definition: Value.hpp:590
VLXValue(VLXArrayReal *arr)
Definition: Value.hpp:309
const VLXList * getList() const
Definition: Value.hpp:412
const std::string & setIdentifier(const char *str)
Definition: Value.hpp:464
std::vector< VLXValue > & value()
Definition: Value.hpp:652
VLXValue(long long i)
Definition: Value.hpp:343
const std::string & setString(const char *str)
Definition: Value.hpp:452
long long getInteger() const
Definition: Value.hpp:495
long long mInteger
Definition: Value.hpp:527
A list of key/VLXValue pairs, can also have a tag.
Definition: Value.hpp:541
void setID(const char *uid)
Definition: Value.hpp:603
const std::vector< T > & value() const
Definition: Value.hpp:118
const vlX::VLXValue & value() const
Definition: Value.hpp:595
int lineNumber() const
Definition: Value.hpp:55
VLXArrayReal(const char *tag=NULL)
Definition: Value.hpp:149
const std::string & key() const
Definition: Value.hpp:591
void setValue(const vlX::VLXValue &value)
Definition: Value.hpp:596
VLXArrayInteger(const char *tag=NULL)
Definition: Value.hpp:138
#define VL_TRAP()
Definition: checks.hpp:70
A simple sequence of VLXValue objects, can also have a tag.
Definition: Value.hpp:634
std::string * mString
Definition: Value.hpp:529
The base class for all the reference counted objects.
Definition: Object.hpp:158
double mReal
Definition: Value.hpp:528
virtual ~VLXTaggedValue()
Definition: Value.hpp:53
const std::string & tag() const
Definition: Value.hpp:63
VLXValue(VLXRawtextBlock *rawtext)
Definition: Value.hpp:292
virtual void acceptVisitor(Visitor *v)
Definition: Value.hpp:82
VLXValue(bool boolean)
Definition: Value.hpp:374
bool setBool(bool val)
Definition: Value.hpp:510
virtual void acceptVisitor(Visitor *v)
Definition: Value.hpp:566
void setLineNumber(int line)
Definition: Value.hpp:57
std::vector< KeyValue > & value()
Definition: Value.hpp:607
#define NULL
Definition: OpenGLDefs.hpp:81
VLXStructure & operator<<(const vlX::VLXValue &val)
Definition: Value.hpp:575
const VLXRawtextBlock * getRawtextBlock() const
Definition: Value.hpp:420
VLXList * mList
Definition: Value.hpp:531
virtual void visitList(VLXList *)
Definition: Visitor.hpp:59
An array of 64 bits integers, can also have a tag.
Definition: Value.hpp:133
A block of raw text.
Definition: Value.hpp:71
std::vector< T > & value()
Definition: Value.hpp:116
Base class for all visitors visiting a VLX hierarchy.
Definition: Visitor.hpp:53
const VLXStructure * getStructure() const
Definition: Value.hpp:404
#define VL_INSTRUMENT_ABSTRACT_CLASS(ClassName, BaseClass)
Definition: TypeInfo.hpp:145
virtual void acceptVisitor(Visitor *)=0
const std::string & setID(const char *str)
Definition: Value.hpp:476
Base class for VLX values with a tag.
Definition: Value.hpp:42
const std::string & uid() const
Definition: Value.hpp:605
bool getBool() const
Definition: Value.hpp:517
VLXValue(const char *str, EType type)
Definition: Value.hpp:357
VLXValue(const VLXValue &other)
Definition: Value.hpp:383
const T * ptr() const
Definition: Value.hpp:122
int lineNumber() const
Definition: Value.hpp:519
VLXArrayTemplate(const char *tag=NULL)
Definition: Value.hpp:114
Base class for all arrays of VLX values.
Definition: Value.hpp:95
const VLXArrayReal * getArrayReal() const
Definition: Value.hpp:448
const vlX::VLXValue * getValue(const char *key) const
Definition: Value.hpp:620
VLXArrayInteger * getArrayInteger()
Definition: Value.hpp:444
KeyValue(const char *key, vlX::VLXValue value)
Definition: Value.hpp:588
EType type() const
Definition: Value.hpp:396
VLXRawtextBlock * mRawtextBlock
Definition: Value.hpp:533
VLXStructure & operator<<(const char *str)
Definition: Value.hpp:568
const std::string & getString() const
Definition: Value.hpp:460
virtual void acceptVisitor(Visitor *v)
Definition: Value.hpp:140
virtual void visitArray(VLXArrayInteger *)
Definition: Visitor.hpp:61
#define VL_CHECK(expr)
Definition: checks.hpp:73
VLXArrayReal * getArrayReal()
Definition: Value.hpp:447
Object & operator=(const Object &other)
Copy operator: copies the object&#39;s name, ref count mutex and user data.
Definition: Object.hpp:201
virtual void visitRawtextBlock(VLXRawtextBlock *)
Definition: Visitor.hpp:60
VLXList & operator<<(const VLXValue &val)
Definition: Value.hpp:644
VLXStructure(const char *tag, const std::string &uid)
Definition: Value.hpp:559
const std::string & getIdentifier() const
Definition: Value.hpp:472
virtual void visitStructure(VLXStructure *)
Definition: Visitor.hpp:58