sqrat  0.9
sqrat
 All Classes Functions Variables Enumerations Enumerator Pages
sqratTypes.h
1 //
2 // SqratTypes: Type Translators
3 //
4 
5 //
6 // Copyright (c) 2009 Brandon Jones
7 //
8 // This software is provided 'as-is', without any express or implied
9 // warranty. In no event will the authors be held liable for any damages
10 // arising from the use of this software.
11 //
12 // Permission is granted to anyone to use this software for any purpose,
13 // including commercial applications, and to alter it and redistribute it
14 // freely, subject to the following restrictions:
15 //
16 // 1. The origin of this software must not be misrepresented; you must not
17 // claim that you wrote the original software. If you use this software
18 // in a product, an acknowledgment in the product documentation would be
19 // appreciated but is not required.
20 //
21 // 2. Altered source versions must be plainly marked as such, and must not be
22 // misrepresented as being the original software.
23 //
24 // 3. This notice may not be removed or altered from any source
25 // distribution.
26 //
27 
28 #if !defined(_SCRAT_TYPES_H_)
29 #define _SCRAT_TYPES_H_
30 
31 #ifdef SQUNICODE
32 #include <cstdlib>
33 #include <cstring>
34 #endif
35 
36 #include <squirrel.h>
37 #include <string>
38 
39 #include "sqratClassType.h"
40 #include "sqratUtil.h"
41 
42 namespace Sqrat {
43 
45 
46 // copied from http://www.experts-exchange.com/Programming/Languages/CPP/A_223-Determing-if-a-C-type-is-convertable-to-another-at-compile-time.html
47 template <typename T1, typename T2>
48 struct is_convertible
49 {
50 private:
51  struct True_ { char x[2]; };
52  struct False_ { };
53 
54  static True_ helper(T2 const &);
55  static False_ helper(...);
56 
57  static T1* dummy;
58 
59 public:
60  static bool const YES = (
61  sizeof(True_) == sizeof(is_convertible::helper(*dummy))
62  );
63 };
64 
65 template <typename T, bool b>
66 struct popAsInt
67 {
68  T value;
69  popAsInt(HSQUIRRELVM vm, SQInteger idx)
70  {
71  SQObjectType value_type = sq_gettype(vm, idx);
72  switch(value_type) {
73  case OT_BOOL:
74  SQBool sqValueb;
75  sq_getbool(vm, idx, &sqValueb);
76  value = static_cast<T>(sqValueb);
77  break;
78  case OT_INTEGER:
79  SQInteger sqValue;
80  sq_getinteger(vm, idx, &sqValue);
81  value = static_cast<T>(sqValue);
82  break;
83  case OT_FLOAT:
84  SQFloat sqValuef;
85  sq_getfloat(vm, idx, &sqValuef);
86  value = static_cast<T>(sqValuef);
87  break;
88  default:
89 #if !defined (SCRAT_NO_ERROR_CHECKING)
90  Error::Instance().Throw(vm, Sqrat::Error::FormatTypeError(vm, idx, _SC("integer")));
91 #endif
92  value = static_cast<T>(0);
93  break;
94  }
95  }
96 };
97 
98 template <typename T>
99 struct popAsInt<T, false>
100 {
101  T value; // cannot be initialized because unknown constructor parameters
102  popAsInt(HSQUIRRELVM /*vm*/, SQInteger /*idx*/)
103  {
104  // keep the current error message already set previously, do not touch that here
105  }
106 };
107 
108 template <typename T>
109 struct popAsFloat
110 {
111  T value;
112  popAsFloat(HSQUIRRELVM vm, SQInteger idx)
113  {
114  SQObjectType value_type = sq_gettype(vm, idx);
115  switch(value_type) {
116  case OT_BOOL:
117  SQBool sqValueb;
118  sq_getbool(vm, idx, &sqValueb);
119  value = static_cast<T>(sqValueb);
120  break;
121  case OT_INTEGER:
122  SQInteger sqValue; \
123  sq_getinteger(vm, idx, &sqValue);
124  value = static_cast<T>(sqValue);
125  break;
126  case OT_FLOAT:
127  SQFloat sqValuef;
128  sq_getfloat(vm, idx, &sqValuef);
129  value = static_cast<T>(sqValuef);
130  break;
131  default:
132 #if !defined (SCRAT_NO_ERROR_CHECKING)
133  Error::Instance().Throw(vm, Sqrat::Error::FormatTypeError(vm, idx, _SC("float")));
134 #endif
135  value = 0;
136  break;
137  }
138  }
139 };
140 
142 
149 template<class T>
150 struct Var {
151 
152  T value;
153 
164  Var(HSQUIRRELVM vm, SQInteger idx) {
165 #if !defined (SCRAT_NO_ERROR_CHECKING)
166  // don't want to override previous errors
167  if (!Sqrat::Error::Instance().Occurred(vm)) {
168 #endif
169  // check if return is NULL here because copying (not referencing)
170  T* ptr = ClassType<T>::GetInstance(vm, idx);
171  if (ptr != NULL) {
172  value = *ptr;
173 #if !defined (SCRAT_NO_ERROR_CHECKING)
174  } else if (is_convertible<T, SQInteger>::YES) { /* value is likely of integral type like enums */
176  value = popAsInt<T, is_convertible<T, SQInteger>::YES>(vm, idx).value;
177  } else
178  // initialize value to avoid warnings
179  value = popAsInt<T, is_convertible<T, SQInteger>::YES>(vm, idx).value;
180 #endif
181  } else
182  // initialize value to avoid warnings
183  value = popAsInt<T, is_convertible<T, SQInteger>::YES>(vm, idx).value;
184  }
185 
193  static void push(HSQUIRRELVM vm, const T& value) {
194  if (ClassType<T>::hasClassTypeData(vm))
195  ClassType<T>::PushInstanceCopy(vm, value);
196  else /* try integral type */
197  pushAsInt<T, is_convertible<T, SQInteger>::YES>().push(vm, (value));
198  }
199 
200 private:
201  template <class T2, bool b>
202  struct pushAsInt {
203  void push(HSQUIRRELVM vm, const T2& /*value*/) {
204  sq_pushnull(vm);
205  }
206  };
207 
208  template <class T2>
209  struct pushAsInt<T2, true> {
210  void push(HSQUIRRELVM vm, const T2& value) {
211  sq_pushinteger(vm, static_cast<SQInteger>(value));
212  }
213  };
214 };
215 
222 template<class T>
223 struct Var<T&> {
224 
225  T& value;
226 
237  Var(HSQUIRRELVM vm, SQInteger idx) : value(*ClassType<T>::GetInstance(vm, idx)) {
238  }
239 
247  static void push(HSQUIRRELVM vm, T& value) {
248  ClassType<T>::PushInstance(vm, &value);
249  }
250 };
251 
258 template<class T>
259 struct Var<T*> {
260 
261  T* value;
262 
273  Var(HSQUIRRELVM vm, SQInteger idx) : value(ClassType<T>::GetInstance(vm, idx)) {
274  }
275 
283  static void push(HSQUIRRELVM vm, T* value) {
284  ClassType<T>::PushInstance(vm, value);
285  }
286 };
287 
294 template<class T>
295 struct Var<T* const> {
296 
297  T* const value;
298 
309  Var(HSQUIRRELVM vm, SQInteger idx) : value(ClassType<T>::GetInstance(vm, idx)) {
310  }
311 
319  static void push(HSQUIRRELVM vm, T* const value) {
320  ClassType<T>::PushInstance(vm, value);
321  }
322 };
323 
330 template<class T>
331 struct Var<const T&> {
332 
333  const T& value;
334 
345  Var(HSQUIRRELVM vm, SQInteger idx) : value(*ClassType<T>::GetInstance(vm, idx)) {
346  }
347 
355  static void push(HSQUIRRELVM vm, const T& value) {
356  ClassType<T>::PushInstanceCopy(vm, value);
357  }
358 };
359 
366 template<class T>
367 struct Var<const T*> {
368 
369  const T* value;
370 
381  Var(HSQUIRRELVM vm, SQInteger idx) : value(ClassType<T>::GetInstance(vm, idx)) {
382  }
383 
391  static void push(HSQUIRRELVM vm, const T* value) {
392  ClassType<T>::PushInstance(vm, const_cast<T*>(value));
393  }
394 };
395 
402 template<class T>
403 struct Var<const T* const> {
404 
405  const T* const value;
406 
417  Var(HSQUIRRELVM vm, SQInteger idx) : value(ClassType<T>::GetInstance(vm, idx)) {
418  }
419 
427  static void push(HSQUIRRELVM vm, const T* const value) {
428  ClassType<T>::PushInstance(vm, const_cast<T*>(value));
429  }
430 };
431 
438 template<class T>
439 struct Var<SharedPtr<T> > {
440 
442 
453  Var(HSQUIRRELVM vm, SQInteger idx) {
454  const T& instance = Var<const T&>(vm, idx).value;
455 #if !defined (SCRAT_NO_ERROR_CHECKING)
456  if (!Error::Instance().Occurred(vm)) {
457 #endif
458  value.Init(new T(instance));
459 #if !defined (SCRAT_NO_ERROR_CHECKING)
460  }
461 #endif
462  }
463 
471  static void push(HSQUIRRELVM vm, SharedPtr<T> value) {
472  PushVarR(vm, value.Get());
473  }
474 };
475 
476 // Integer types
477 #define SCRAT_INTEGER( type ) \
478  template<> \
479  struct Var<type> { \
480  type value; \
481  Var(HSQUIRRELVM vm, SQInteger idx) { \
482  value = popAsInt<type, true>(vm, idx).value; \
483  } \
484  static void push(HSQUIRRELVM vm, const type& value) { \
485  sq_pushinteger(vm, static_cast<SQInteger>(value)); \
486  } \
487  };\
488  \
489  template<> \
490  struct Var<const type> { \
491  type value; \
492  Var(HSQUIRRELVM vm, SQInteger idx) { \
493  value = popAsInt<type, true>(vm, idx).value; \
494  } \
495  static void push(HSQUIRRELVM vm, const type& value) { \
496  sq_pushinteger(vm, static_cast<SQInteger>(value)); \
497  } \
498  }; \
499  \
500  template<> \
501  struct Var<const type&> { \
502  type value; \
503  Var(HSQUIRRELVM vm, SQInteger idx) { \
504  value = popAsInt<type, true>(vm, idx).value; \
505  } \
506  static void push(HSQUIRRELVM vm, const type& value) { \
507  sq_pushinteger(vm, static_cast<SQInteger>(value)); \
508  } \
509  };
510 
511 SCRAT_INTEGER(unsigned int)
512 SCRAT_INTEGER(signed int)
513 SCRAT_INTEGER(unsigned long)
514 SCRAT_INTEGER(signed long)
515 SCRAT_INTEGER(unsigned short)
516 SCRAT_INTEGER(signed short)
517 SCRAT_INTEGER(unsigned char)
518 SCRAT_INTEGER(signed char)
519 SCRAT_INTEGER(unsigned long long)
520 SCRAT_INTEGER(signed long long)
521 
522 #ifdef _MSC_VER
523 #if defined(__int64)
524 SCRAT_INTEGER(unsigned __int64)
525 SCRAT_INTEGER(signed __int64)
526 #endif
527 #endif
528 
529 // Float types
530 #define SCRAT_FLOAT( type ) \
531  template<> \
532  struct Var<type> { \
533  type value; \
534  Var(HSQUIRRELVM vm, SQInteger idx) { \
535  value = popAsFloat<type>(vm, idx).value; \
536  } \
537  static void push(HSQUIRRELVM vm, const type& value) { \
538  sq_pushfloat(vm, static_cast<SQFloat>(value)); \
539  } \
540  }; \
541  \
542  template<> \
543  struct Var<const type> { \
544  type value; \
545  Var(HSQUIRRELVM vm, SQInteger idx) { \
546  value = popAsFloat<type>(vm, idx).value; \
547  } \
548  static void push(HSQUIRRELVM vm, const type& value) { \
549  sq_pushfloat(vm, static_cast<SQFloat>(value)); \
550  } \
551  }; \
552  template<> \
553  struct Var<const type&> { \
554  type value; \
555  Var(HSQUIRRELVM vm, SQInteger idx) { \
556  value = popAsFloat<type>(vm, idx).value; \
557  } \
558  static void push(HSQUIRRELVM vm, const type& value) { \
559  sq_pushfloat(vm, static_cast<SQFloat>(value)); \
560  } \
561  };
562 
563 SCRAT_FLOAT(float)
564 SCRAT_FLOAT(double)
565 
569 template<>
570 struct Var<bool> {
571 
572  bool value;
573 
581  Var(HSQUIRRELVM vm, SQInteger idx) {
582  SQBool sqValue;
583  sq_tobool(vm, idx, &sqValue);
584  value = (sqValue != 0);
585  }
586 
594  static void push(HSQUIRRELVM vm, const bool& value) {
595  sq_pushbool(vm, static_cast<SQBool>(value));
596  }
597 };
598 
602 template<>
603 struct Var<const bool> {
604 
605  bool value;
606 
614  Var(HSQUIRRELVM vm, SQInteger idx) {
615  SQBool sqValue;
616  sq_tobool(vm, idx, &sqValue);
617  value = (sqValue != 0);
618  }
619 
627  static void push(HSQUIRRELVM vm, const bool& value) {
628  sq_pushbool(vm, static_cast<SQBool>(value));
629  }
630 };
631 
635 template<>
636 struct Var<const bool&> {
637 
638  bool value;
639 
647  Var(HSQUIRRELVM vm, SQInteger idx) {
648  SQBool sqValue;
649  sq_tobool(vm, idx, &sqValue);
650  value = (sqValue != 0);
651  }
652 
660  static void push(HSQUIRRELVM vm, const bool& value) {
661  sq_pushbool(vm, static_cast<SQBool>(value));
662  }
663 };
664 
668 template<>
669 struct Var<SQChar*> {
670 private:
671 
672  HSQOBJECT obj; /* hold a reference to the object holding value during the Var struct lifetime*/
673  HSQUIRRELVM v;
674 
675 public:
676 
677  SQChar* value;
678 
686  Var(HSQUIRRELVM vm, SQInteger idx) {
687  sq_tostring(vm, idx);
688  sq_getstackobj(vm, -1, &obj);
689  sq_getstring(vm, -1, (const SQChar**)&value);
690  sq_addref(vm, &obj);
691  sq_pop(vm,1);
692  v = vm;
693  }
694 
700  {
701  if(v && !sq_isnull(obj)) {
702  sq_release(v, &obj);
703  }
704  }
705 
713  static void push(HSQUIRRELVM vm, const SQChar* value) {
714  sq_pushstring(vm, value, -1);
715  }
716 };
717 
721 template<>
722 struct Var<const SQChar*> {
723 private:
724 
725  HSQOBJECT obj; /* hold a reference to the object holding value during the Var struct lifetime*/
726  HSQUIRRELVM v;
727 
728 public:
729 
730  const SQChar* value;
731 
739  Var(HSQUIRRELVM vm, SQInteger idx) {
740  sq_tostring(vm, idx);
741  sq_getstackobj(vm, -1, &obj);
742  sq_getstring(vm, -1, &value);
743  sq_addref(vm, &obj);
744  sq_pop(vm,1);
745  v = vm;
746  }
747 
753  {
754  if(v && !sq_isnull(obj)) {
755  sq_release(v, &obj);
756  }
757  }
758 
766  static void push(HSQUIRRELVM vm, const SQChar* value) {
767  sq_pushstring(vm, value, -1);
768  }
769 };
770 
774 template<>
775 struct Var<string> {
776 
777  string value;
778 
786  Var(HSQUIRRELVM vm, SQInteger idx) {
787  const SQChar* ret;
788  sq_tostring(vm, idx);
789  sq_getstring(vm, -1, &ret);
790  value = string(ret);
791  sq_pop(vm,1);
792  }
793 
801  static void push(HSQUIRRELVM vm, const string & value) {
802  sq_pushstring(vm, value.c_str(), -1);
803  }
804 };
805 
809 template<>
810 struct Var<string&> {
811 
812  string value;
813 
821  Var(HSQUIRRELVM vm, SQInteger idx) {
822  const SQChar* ret;
823  sq_tostring(vm, idx);
824  sq_getstring(vm, -1, &ret);
825  value = string(ret);
826  sq_pop(vm,1);
827  }
828 
836  static void push(HSQUIRRELVM vm, const string & value) {
837  sq_pushstring(vm, value.c_str(), -1);
838  }
839 };
840 
844 template<>
845 struct Var<const string&> {
846 
847  string value;
848 
856  Var(HSQUIRRELVM vm, SQInteger idx) {
857  const SQChar* ret;
858  sq_tostring(vm, idx);
859  sq_getstring(vm, -1, &ret);
860  value = string(ret);
861  sq_pop(vm,1);
862  }
863 
871  static void push(HSQUIRRELVM vm, const string & value) {
872  sq_pushstring(vm, value.c_str(), -1);
873  }
874 };
875 
876 #ifdef SQUNICODE
877 template<>
881 struct Var<std::string> {
882 
883  std::string value;
884 
892  Var(HSQUIRRELVM vm, SQInteger idx) {
893  const SQChar* ret;
894  sq_tostring(vm, idx);
895  sq_getstring(vm, -1, &ret);
896  value = wstring_to_string(string(ret));
897  sq_pop(vm,1);
898  }
899 
907  static void push(HSQUIRRELVM vm, const std::string & value) {
908  sq_pushstring(vm, string_to_wstring(value).c_str(), -1);
909  }
910 };
911 
915 template<>
916 struct Var<std::string&> {
917 
918  std::string value;
919 
927  Var(HSQUIRRELVM vm, SQInteger idx) {
928  const SQChar* ret;
929  sq_tostring(vm, idx);
930  sq_getstring(vm, -1, &ret);
931  value = wstring_to_string(string(ret));
932  sq_pop(vm,1);
933  }
934 
942  static void push(HSQUIRRELVM vm, const std::string & value) {
943  sq_pushstring(vm, string_to_wstring(value).c_str(), -1);
944  }
945 };
946 
950 template<>
951 struct Var<const std::string&> {
952 
953  std::string value;
954 
962  Var(HSQUIRRELVM vm, SQInteger idx) {
963  const SQChar* ret;
964  sq_tostring(vm, idx);
965  sq_getstring(vm, -1, &ret);
966  value = wstring_to_string(string(ret));
967  sq_pop(vm,1);
968  }
969 
977  static void push(HSQUIRRELVM vm, const std::string & value) {
978  sq_pushstring(vm, string_to_wstring(value).c_str(), -1);
979  }
980 };
981 
985 template<>
986 struct Var<char*> {
987 private:
988 
989  HSQOBJECT obj;/* hold a reference to the object holding value during the Var struct lifetime*/
990  HSQUIRRELVM v;
991 
992 public:
993 
994  char* value;
995 
1003  Var(HSQUIRRELVM vm, SQInteger idx) {
1004  std::string holder;
1005  const SQChar *sv;
1006  sq_tostring(vm, idx);
1007  sq_getstackobj(vm, -1, &obj);
1008  sq_getstring(vm, -1, &sv);
1009  sq_addref(vm, &obj);
1010  sq_pop(vm,1);
1011  v = vm;
1012  holder = wstring_to_string(string(sv));
1013  value = strdup(holder.c_str());
1014  }
1015 
1020  ~Var()
1021  {
1022  if(v && !sq_isnull(obj)) {
1023  sq_release(v, &obj);
1024  free(value);
1025  }
1026  }
1027 
1035  static void push(HSQUIRRELVM vm, const char* value) {
1036  sq_pushstring(vm, string_to_wstring(std::string(value)).c_str(), -1);
1037  }
1038 };
1039 
1043 template<>
1044 struct Var<const char*> {
1045 private:
1046 
1047  HSQOBJECT obj; /* hold a reference to the object holding value during the Var struct lifetime*/
1048  HSQUIRRELVM v;
1049 
1050 public:
1051 
1052  char* value;
1053 
1061  Var(HSQUIRRELVM vm, SQInteger idx) {
1062  std::string holder;
1063  const SQChar *sv;
1064  sq_tostring(vm, idx);
1065  sq_getstackobj(vm, -1, &obj);
1066  sq_getstring(vm, -1, &sv);
1067  sq_addref(vm, &obj);
1068  sq_pop(vm,1);
1069  v = vm;
1070  holder = wstring_to_string(string(sv));
1071  value = strdup(holder.c_str());
1072  }
1073 
1078  ~Var()
1079  {
1080  if(v && !sq_isnull(obj)) {
1081  sq_release(v, &obj);
1082  free(value);
1083  }
1084  }
1085 
1093  static void push(HSQUIRRELVM vm, const char* value) {
1094  sq_pushstring(vm, string_to_wstring(std::string(value)).c_str(), -1);
1095  }
1096 };
1097 #endif
1098 
1112 template<class T>
1113 inline void PushVar(HSQUIRRELVM vm, T value) {
1114  Var<T>::push(vm, value);
1115 }
1116 
1121 template<>
1122 inline void PushVar<int>(HSQUIRRELVM vm, int value) {
1123  Var<int>::push(vm, value);
1124 }
1126 
1140 template<class T>
1141 inline void PushVarR(HSQUIRRELVM vm, T & value) {
1142  Var<T&>::push(vm, value);
1143 }
1144 
1145 }
1146 
1147 #endif
Var(HSQUIRRELVM vm, SQInteger idx)
Definition: sqratTypes.h:821
static void push(HSQUIRRELVM vm, SharedPtr< T > value)
Definition: sqratTypes.h:471
string value
The actual value of get operations.
Definition: sqratTypes.h:847
bool value
The actual value of get operations.
Definition: sqratTypes.h:605
static void push(HSQUIRRELVM vm, const T &value)
Definition: sqratTypes.h:193
static void push(HSQUIRRELVM vm, const string &value)
Definition: sqratTypes.h:871
T value
The actual value of get operations.
Definition: sqratTypes.h:152
static void push(HSQUIRRELVM vm, T *const value)
Definition: sqratTypes.h:319
~Var()
Definition: sqratTypes.h:699
Var(HSQUIRRELVM vm, SQInteger idx)
Definition: sqratTypes.h:345
static void push(HSQUIRRELVM vm, const string &value)
Definition: sqratTypes.h:836
Definition: sqratTypes.h:150
Var(HSQUIRRELVM vm, SQInteger idx)
Definition: sqratTypes.h:614
Var(HSQUIRRELVM vm, SQInteger idx)
Definition: sqratTypes.h:686
Var(HSQUIRRELVM vm, SQInteger idx)
Definition: sqratTypes.h:309
T * Get() const
Definition: sqratUtil.h:665
static void push(HSQUIRRELVM vm, T &value)
Definition: sqratTypes.h:247
static string FormatTypeError(HSQUIRRELVM vm, SQInteger idx, const string &expectedType)
Definition: sqratUtil.h:149
void Clear(HSQUIRRELVM vm)
Definition: sqratUtil.h:170
Var(HSQUIRRELVM vm, SQInteger idx)
Definition: sqratTypes.h:381
static void push(HSQUIRRELVM vm, const SQChar *value)
Definition: sqratTypes.h:766
Var(HSQUIRRELVM vm, SQInteger idx)
Definition: sqratTypes.h:581
static void push(HSQUIRRELVM vm, const bool &value)
Definition: sqratTypes.h:594
Var(HSQUIRRELVM vm, SQInteger idx)
Definition: sqratTypes.h:647
Definition: sqratTypes.h:331
T & value
The actual value of get operations.
Definition: sqratTypes.h:225
Var(HSQUIRRELVM vm, SQInteger idx)
Definition: sqratTypes.h:856
Var(HSQUIRRELVM vm, SQInteger idx)
Definition: sqratTypes.h:739
static void push(HSQUIRRELVM vm, const T *const value)
Definition: sqratTypes.h:427
static void push(HSQUIRRELVM vm, const string &value)
Definition: sqratTypes.h:801
Definition: sqratUtil.h:291
bool value
The actual value of get operations.
Definition: sqratTypes.h:638
Var(HSQUIRRELVM vm, SQInteger idx)
Definition: sqratTypes.h:453
Var(HSQUIRRELVM vm, SQInteger idx)
Definition: sqratTypes.h:164
const SQChar * value
The actual value of get operations.
Definition: sqratTypes.h:730
Var(HSQUIRRELVM vm, SQInteger idx)
Definition: sqratTypes.h:273
string value
The actual value of get operations.
Definition: sqratTypes.h:777
T * value
The actual value of get operations.
Definition: sqratTypes.h:261
static Error & Instance()
Definition: sqratUtil.h:134
void Throw(HSQUIRRELVM vm, const string &err)
Definition: sqratUtil.h:210
const T & value
The actual value of get operations.
Definition: sqratTypes.h:333
const T *const value
The actual value of get operations.
Definition: sqratTypes.h:405
static void push(HSQUIRRELVM vm, const bool &value)
Definition: sqratTypes.h:627
static void push(HSQUIRRELVM vm, const T &value)
Definition: sqratTypes.h:355
const T * value
The actual value of get operations.
Definition: sqratTypes.h:369
Var(HSQUIRRELVM vm, SQInteger idx)
Definition: sqratTypes.h:417
Var(HSQUIRRELVM vm, SQInteger idx)
Definition: sqratTypes.h:237
static void push(HSQUIRRELVM vm, const bool &value)
Definition: sqratTypes.h:660
bool value
The actual value of get operations.
Definition: sqratTypes.h:572
static void push(HSQUIRRELVM vm, const SQChar *value)
Definition: sqratTypes.h:713
SQChar * value
The actual value of get operations.
Definition: sqratTypes.h:677
Var(HSQUIRRELVM vm, SQInteger idx)
Definition: sqratTypes.h:786
static void push(HSQUIRRELVM vm, T *value)
Definition: sqratTypes.h:283
static void push(HSQUIRRELVM vm, const T *value)
Definition: sqratTypes.h:391
string value
The actual value of get operations.
Definition: sqratTypes.h:812
~Var()
Definition: sqratTypes.h:752
SharedPtr< T > value
The actual value of get operations.
Definition: sqratTypes.h:441
T *const value
The actual value of get operations.
Definition: sqratTypes.h:297
bool Occurred(HSQUIRRELVM vm)
Definition: sqratUtil.h:198