Visualization Library 2.0.0-b3

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

VL     Star     Watch     Fork     Issue

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