32 outDat.push_back(dat[0]);
33 for (
int i=0;i<dat[0];i++)
52 if (argCnt<requiredArgumentCount)
65 for (
int i=0;i<argCnt;i++)
67 if (i>=expectedArguments[0])
81 if (
int(
_inData.size())<requiredArgumentCount)
83 std::ostringstream str;
84 str <<
"Argument " << i+1 <<
" is not correct.";
95 std::ostringstream str;
96 str <<
"Argument " << i+1 <<
" is not correct.";
102 if ( (p->
inputArgTypeAndSize[i*2+1]<expectedArguments[1+i*2+1])&&(expectedArguments[1+i*2+1]!=0) )
104 std::ostringstream str;
105 str <<
"Argument " << i+1 <<
" is not correct (wrong table size).";
124 std::vector<bool> vect;
125 for (
int j=0;j<itemCnt;j++)
126 vect.push_back(p->
inputBool[boolArgInd++]!=0);
132 std::vector<int> vect;
133 for (
int j=0;j<itemCnt;j++)
134 vect.push_back(p->
inputInt[intArgInd++]);
140 std::vector<float> vect;
141 for (
int j=0;j<itemCnt;j++)
148 std::vector<double> vect;
149 for (
int j=0;j<itemCnt;j++)
156 std::vector<std::string> vect;
157 for (
int j=0;j<itemCnt;j++)
159 std::string str(p->
inputChar+charArgInd);
161 charArgInd+=int(strlen(p->
inputChar+charArgInd))+1;
168 std::ostringstream str;
169 str <<
"Argument " << i+1 <<
" cannot be a table.";
206 charArgInd+=int(strlen(p->
inputChar+charArgInd))+1;
211 if ( (p->
inputArgTypeAndSize[i*2+1]<expectedArguments[1+i*2+1])&&(expectedArguments[1+i*2+1]!=0) )
213 std::ostringstream str;
214 str <<
"Argument " << i+1 <<
" is not correct (wrong buffer size).";
236 if (argCnt<requiredArgumentCount)
247 int charBuffArgInd=0;
249 for (
int i=0;i<argCnt;i++)
251 if (i>=expectedArguments[0])
265 if (
int(
_outData.size())<requiredArgumentCount)
267 std::ostringstream str;
268 str <<
"Return argument " << i+1 <<
" is not correct.";
279 std::ostringstream str;
280 str <<
"Return argument " << i+1 <<
" is not correct.";
286 if ( (p->
outputArgTypeAndSize[i*2+1]<expectedArguments[1+i*2+1])&&(expectedArguments[1+i*2+1]!=0) )
288 std::ostringstream str;
289 str <<
"Return argument " << i+1 <<
" is not correct (wrong table size).";
308 std::vector<bool> vect;
309 for (
int j=0;j<itemCnt;j++)
310 vect.push_back(p->
outputBool[boolArgInd++]!=0);
316 std::vector<int> vect;
317 for (
int j=0;j<itemCnt;j++)
318 vect.push_back(p->
outputInt[intArgInd++]);
324 std::vector<float> vect;
325 for (
int j=0;j<itemCnt;j++)
332 std::vector<double> vect;
333 for (
int j=0;j<itemCnt;j++)
340 std::vector<std::string> vect;
341 for (
int j=0;j<itemCnt;j++)
345 charArgInd+=int(strlen(p->
outputChar+charArgInd))+1;
352 std::ostringstream str;
353 str <<
"Return argument " << i+1 <<
" cannot be a table.";
390 charArgInd+=int(strlen(p->
outputChar+charArgInd))+1;
395 if ( (p->
outputArgTypeAndSize[i*2+1]<expectedArguments[1+i*2+1])&&(expectedArguments[1+i*2+1]!=0) )
397 std::ostringstream str;
398 str <<
"Return argument " << i+1 <<
" is not correct (wrong buffer size).";
440 int charBuffDataCnt=0;
442 for (
int i=0;i<itemCnt;i++)
479 for (
int j=0;j<int(
_outData[i].stringData.size());j++)
480 charDataCnt+=
int(
_outData[i].stringData[j].length())+1;
518 charDataCnt+=int(
_outData[i].stringData[0].length())+1;
524 charBuffDataCnt+=int(
_outData[i].stringData[0].length());
543 int charBuffDataOff=0;
545 for (
int i=0;i<itemCnt;i++)
551 for (
int j=0;j<int(
_outData[i].boolData.size());j++)
556 for (
int j=0;j<int(
_outData[i].intData.size());j++)
561 for (
int j=0;j<int(
_outData[i].floatData.size());j++)
566 for (
int j=0;j<int(
_outData[i].doubleData.size());j++)
571 for (
int j=0;j<int(
_outData[i].stringData.size());j++)
573 for (
int k=0;k<int(
_outData[i].stringData[j].length());k++)
591 for (
int j=0;j<int(
_outData[i].stringData[0].length());j++)
597 for (
int j=0;j<int(
_outData[i].stringData[0].length());j++)
629 int itemCnt=
int(
_inData.size());
640 int charBuffDataCnt=0;
642 for (
int i=0;i<itemCnt;i++)
679 for (
int j=0;j<int(
_inData[i].stringData.size());j++)
680 charDataCnt+=
int(
_inData[i].stringData[j].length())+1;
718 charDataCnt+=int(
_inData[i].stringData[0].length())+1;
724 charBuffDataCnt+=int(
_inData[i].stringData[0].length());
743 int charBuffDataOff=0;
745 for (
int i=0;i<itemCnt;i++)
751 for (
int j=0;j<int(
_inData[i].boolData.size());j++)
756 for (
int j=0;j<int(
_inData[i].intData.size());j++)
761 for (
int j=0;j<int(
_inData[i].floatData.size());j++)
766 for (
int j=0;j<int(
_inData[i].doubleData.size());j++)
771 for (
int j=0;j<int(
_inData[i].stringData.size());j++)
773 for (
int k=0;k<int(
_inData[i].stringData[j].length());k++)
791 for (
int j=0;j<int(
_inData[i].stringData[0].length());j++)
797 for (
int j=0;j<int(
_inData[i].stringData[0].length());j++)
#define SIM_LUA_ARG_NIL_ALLOWED
std::vector< CLuaFunctionDataItem > * getOutDataPtr_luaFunctionCall()
ptrSimCreateBuffer simCreateBuffer
bool readDataFromLua(const SLuaCallBack *p, const int *expectedArguments, int requiredArgumentCount, const char *functionName)
simInt * outputArgTypeAndSize
bool readDataFromLua_luaFunctionCall(const SLuaCallBack *p, const int *expectedArguments, int requiredArgumentCount, const char *functionName)
void pushOutData(const CLuaFunctionDataItem &dataItem)
void writeDataToLua(SLuaCallBack *p)
simInt * inputArgTypeAndSize
virtual ~CLuaFunctionData()
std::vector< CLuaFunctionDataItem > _outData
ptrSimReleaseBuffer simReleaseBuffer
void writeDataToLua_luaFunctionCall(SLuaCallBack *p, const int *expectedArguments)
if(EXISTS "${PROJECT_DOC_DIR}/CMakeLists.txt") option(BUILD_DOCUMENTATION "Request build and/or installation of documentation." OFF) endif() if(EXISTS "$
static void getInputDataForFunctionRegistration(const int *dat, std::vector< int > &outDat)
void setNilTable(int size)
ptrSimSetLastError simSetLastError
std::vector< CLuaFunctionDataItem > _inData
void pushOutData_luaFunctionCall(const CLuaFunctionDataItem &dataItem)
void releaseBuffers_luaFunctionCall(SLuaCallBack *p)
std::vector< CLuaFunctionDataItem > * getInDataPtr()