luaFunctionDataItem.cpp
Go to the documentation of this file.
1 // Copyright 2006-2016 Coppelia Robotics GmbH. All rights reserved.
2 // marc@coppeliarobotics.com
3 // www.coppeliarobotics.com
4 //
5 // -------------------------------------------------------------------
6 // THIS FILE IS DISTRIBUTED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
7 // WARRANTY. THE USER WILL USE IT AT HIS/HER OWN RISK. THE ORIGINAL
8 // AUTHORS AND COPPELIA ROBOTICS GMBH WILL NOT BE LIABLE FOR DATA LOSS,
9 // DAMAGES, LOSS OF PROFITS OR ANY OTHER KIND OF LOSS WHILE USING OR
10 // MISUSING THIS SOFTWARE.
11 //
12 // You are free to use/modify/distribute this file for whatever purpose!
13 // -------------------------------------------------------------------
14 //
15 // This file was automatically created for V-REP release V3.3.2 on August 29th 2016
16 
17 #include "luaFunctionDataItem.h"
18 
20 {
21  _nilTableSize=0;
22  _isTable=false;
23  _type=-1; // nil
24 }
25 
27 {
28  _nilTableSize=0;
29  _isTable=false;
30  _type=0;
31  boolData.push_back(v);
32 }
33 
35 {
36  _nilTableSize=0;
37  _isTable=false;
38  _type=1;
39  intData.push_back(v);
40 }
41 
43 {
44  _nilTableSize=0;
45  _isTable=false;
46  _type=2;
47  floatData.push_back(v);
48 }
49 
51 {
52  _nilTableSize=0;
53  _isTable=false;
54  _type=5;
55  doubleData.push_back(v);
56 }
57 
59 {
60  _nilTableSize=0;
61  _isTable=false;
62  _type=3;
63  stringData.push_back(v);
64 }
65 
66 CLuaFunctionDataItem::CLuaFunctionDataItem(const char* bufferPtr,unsigned int bufferLength)
67 {
68  _nilTableSize=0;
69  _isTable=false;
70  _type=4;
71  std::string v(bufferPtr,bufferLength);
72  stringData.push_back(v);
73 }
74 
75 CLuaFunctionDataItem::CLuaFunctionDataItem(const std::vector<bool>& v)
76 {
77  _nilTableSize=0;
78  _isTable=true;
79  _type=0;
80  boolData.assign(v.begin(),v.end());
81 }
82 
84 {
85  _nilTableSize=0;
86  _isTable=true;
87  _type=1;
88  intData.assign(v.begin(),v.end());
89 }
90 
91 CLuaFunctionDataItem::CLuaFunctionDataItem(const std::vector<float>& v)
92 {
93  _nilTableSize=0;
94  _isTable=true;
95  _type=2;
96  floatData.assign(v.begin(),v.end());
97 }
98 
99 CLuaFunctionDataItem::CLuaFunctionDataItem(const std::vector<double>& v)
100 {
101  _nilTableSize=0;
102  _isTable=true;
103  _type=5;
104  doubleData.assign(v.begin(),v.end());
105 }
106 
107 CLuaFunctionDataItem::CLuaFunctionDataItem(const std::vector<std::string>& v)
108 {
109  _nilTableSize=0;
110  _isTable=true;
111  _type=3;
112  stringData.assign(v.begin(),v.end());
113 }
114 
116 {
117 }
118 
120 {
121  return(_isTable);
122 }
123 
125 {
126  return(_type);
127 }
128 
130 {
131  if (_type==-1)
132  {
133  _isTable=true;
134  _nilTableSize=size;
135  }
136 }
137 
139 {
140  return(_nilTableSize);
141 }
std::vector< bool > boolData
std::vector< std::string > stringData
std::vector< double > doubleData
std::vector< int > intData
std::vector< float > floatData