| 
 | 
Go to the documentation of this file.
   55 typedef void *(*swig_converter_func)( void *,  int *);  
   93     if(iter-> type == from) {  
   94       if(iter == ty-> cast)  break;  
  118   if(!lua_isuserdata(L,index))  return NULL;  
  120   if(!lua_getmetatable(L,index))  return NULL;  
  122   lua_pushstring(L, ".type");  
  124   if(!lua_isstring(L,-1)) { lua_pop(L,2);  return NULL;};  
  125   const char* ftype = lua_tostring(L,-1);  
  126   if(!ftype) {lua_pop(L,2);  return NULL;};  
  150   while(src<res.length()) {  
  151     if(isalnum(res.at(src))) {res[dst++]=res[src++];  continue;}  
  153     for(;src<res.length();src++)   
  154       if(isalnum(res.at(src)))  break;  
  185   FD_DLB( "LuaFunctionDefinition::LuaFunctionDefinition("<< this<< "): name   " << name);  
  186   FD_DLB( "LuaFunctionDefinition::LuaFunctionDefinition("<< this<< "): proto   " << mpFunction);  
  187   FD_DLB( "LuaFunctionDefinition::LuaFunctionDefinition("<< this<< "): has def " << mpFunction->Definition());  
  195   FD_DLB( "LuaFunctionDefinition::LuaFunctionDefinition(copy)");  
  201   FD_DLB( "LuaFunctionDefinition::DoAssign()");  
  210   FD_DLB( "LuaFunctionDefinition::DoAssign("<< this<< "): name   " <<  mName);  
  211   FD_DLB( "LuaFunctionDefinition::DoAssign("<< this<< "): proto   " <<  mpFunction);  
  227   FD_DLB( "LuaFunctionDefinition::Clear(): " <<  Name());  
  268     FD_DLB( "LuaFunctionDefinition::SyntaxCheck(): no variants defined, evaluate");  
  274   std::string err =  "";  
  278     FD_DLB( "LuaFunctionDefinition::SyntaxCheck(): variant " <<   
  293       err =  "cannot allocate parameters for variant " + lfnct-> Variant()->Name();  
  308   std::string err =  "";  
  327   FD_DLB( "LuaFunctionDefinition::Install(): " <<  Name());  
  331     FD_DLB( "LuaFunctionDefinition::Install(): no signatures for fnct " <<  Name());  
  336   std::string lfname =  Name();    
  338     size_t pos= CType().find( "faudes::");  
  339     if(pos!=std::string::npos)   
  340     lfname= CType().substr(std::string( "faudes::").length());  
  344   std::vector< std::string > lffnct;                            
  345   std::vector< int > lfparcnt;                                  
  346   std::vector< std::vector<std::string> > lfparams;             
  347   std::vector< std::vector<Parameter::ParamAttr> > lfattrib;    
  348   std::vector< std::vector<bool> > lfretval;                    
  349   std::vector< std::vector<bool> > lfparval;                    
  359     for( int j=0; j<sigi. Size(); j++) {  
  361       std::string ftype=sigi. At(j). Type();  
  389       lfparams.at(i).push_back(ftype);  
  390       lfattrib.at(i).push_back(fattr);  
  391       lfretval.at(i).push_back(fcret);  
  392       lfparval.at(i).push_back(fcpar);  
  395     if(( int) lfparams.at(i).size()!=sigi. Size()) {  
  396       FD_WARN( "LuaFunctionDefinition::Install(): cannot interpret signature \"" << sigi. Name() <<  "\"");  
  402     lfparcnt.at(i)=parcnt;  
  404   FD_DLB( "LuaFunctionDefinition::Install(): #" << lffnct.size() <<  " valid signatures");  
  408   std::vector< std::string > lftest1;  
  409   std::vector< std::string > lftest2;  
  410   std::vector< std::string > lfcall;  
  411   std::vector< std::string > lfsig;  
  412   for( unsigned int i=0; i<lffnct.size(); i++) {  
  416     for( unsigned int j=0; j<lfparams.at(i).size(); j++) {  
  417       if(!lfparval.at(i).at(j))  continue;  
  420       std::string ltype= "userdata";  
  421       if(lfparams.at(i).at(j) ==  "Integer") ltype= "number";  
  422       if(lfparams.at(i).at(j) ==  "Boolean") ltype= "bool";  
  423       if(lfparams.at(i).at(j) ==  "String") ltype= "string";  
  424       test1=test1 +  "(type(arg[" +  ToStringInteger(pj) +  "])=='" + ltype +  "')";  
  426     lftest1.push_back(test1);  
  428     std::string test2= "";  
  430     for( unsigned int j=0; j<lfparams.at(i).size(); j++) {  
  431       if(!lfparval.at(i).at(j))  continue;  
  433       if(lfparams.at(i).at(j) ==  "Integer")  continue;  
  434       if(lfparams.at(i).at(j) ==  "Boolean")  continue;  
  435       if(lfparams.at(i).at(j) ==  "String")  continue;  
  436       if(test2.size()>0) test2=test2+ " and ";  
  437       test2=test2 +  "faudes.TypeTest(\"" + lfparams.at(i).at(j) +  "\", arg[" +  ToStringInteger(pj) +  "])";  
  439     lftest2.push_back(test2);  
  441     std::string call= lffnct.at(i) +  "(";  
  443     for( unsigned int j=0; j<lfparams.at(i).size(); j++) {  
  444       if(!lfparval.at(i).at(j))  continue;  
  446       if(pj>1) call = call +  ", ";  
  450     lfcall.push_back(call);  
  452     std::string nsig =  " " + lfname +  "(";  
  453     bool leftcomma =  false;  
  454     bool rightcomma =  false;  
  455     for( unsigned int j=0; j<lfparams.at(i).size(); j++) {  
  457       if(lfretval.at(i).at(j)) {  
  458         if(leftcomma) nsig =  "," + nsig;  
  459   nsig=lfparams.at(i).at(j) + nsig;  
  463       if(lfparval.at(i).at(j)) {  
  464         if(rightcomma) nsig +=  ", ";  
  466         nsig += sigi. At(j). Str();  
  471     lfsig.push_back(nsig);  
  476     for( unsigned int i=0; i< lfsig.size(); i++) {  
  477       std::string topic=  PlugIn();  
  479       if(topic.length()>0) topic.at(0)=toupper(topic.at(0));  
  480       if(key1.length()>0) key1.at(0)=toupper(key1.at(0));  
  487   std::stringstream lfwrap;  
  488   lfwrap <<  "-- LuaFunctionDefinition.Install() " <<  Name() << std::endl;  
  493   lfwrap <<  "-- LuaFunctionDefinition.Install(): dispatch / typecheck" << std::endl;  
  494   lfwrap <<  "function faudes." << lfname <<  "(...)" << std::endl;  
  495   lfwrap <<  "  local arg  = {...}" << std::endl;   
  496   lfwrap <<  "  local argn = #arg" << std::endl;    
  497   for( unsigned int i=0; i< lftest1.size(); i++) {  
  498     lfwrap <<  "  if (" << lftest1.at(i) <<  ") then " << std::endl;  
  499     lfwrap <<  "  if (" << lftest2.at(i) <<  ") then " << std::endl;  
  500     lfwrap <<  "    return faudes." << lfcall.at(i) << std::endl;  
  501     lfwrap <<  "  end" << std::endl;  
  502     lfwrap <<  "  end" << std::endl;  
  504   lfwrap <<  "  faudes.Error([[" << lfname <<  ": parameter mismatch: expected signature(s): " << std::endl;  
  505   for( unsigned int i=0; i< lfsig.size(); i++) {  
  506     lfwrap << lfsig.at(i) << std::endl;  
  508   lfwrap <<  "]])" << std::endl;  
  509   lfwrap <<  "end" << std::endl;  
  513   FD_DLB( "LuaFunctionDefinition:Install(): code:" << std::endl << lfwrap.str());  
  514   FD_DLB( "LuaFunctionDefinition:Install(): code: done");  
  517   int errexec=luaL_dostring(pLL,lfwrap.str().c_str());    
  519     std::string lerr= std::string(lua_tostring(pLL, -1));  
  520     int c1 = lerr.find_first_of( ':');  
  522     int c2 = lerr.find_first_of( ':',c1+1);  
  524     std::string line = lerr.substr(c1+1,c2-c1-1);    
  526       lerr= "error in Lua script: line " + line +  ": " + lerr.substr(c2+2);  
  528     throw Exception( "LuaFunctionDefinition::Install(): " +  Name(), lerr, 49);  
  534   FD_DLB( "LuaFunctionDefinition::DoRead()");  
  538   std::string label=rLabel;  
  539   if(label== "") label= "LuaFunctionDefinition";  
  549   FD_DLB( "LuaFunctionDefinition::Register(): file " << rFilename);  
  550   TokenReader tr(rFilename);  
  552   while(tr.Peek(token)) {  
  553     if(!token.IsBegin( "LuaFunctionDefinition")) {  
  559     FD_DLB( "LuaFunctionDefinition::Register(): found " << plfd->Name());  
  561       FD_DLB( "LuaFunctionDefinition::Register(): skipping doublet " << plfd->Name());  
  573   FD_DLB( "LuaFunctionDefinition::DoReadCore()");  
  581   if(token.StringValue()== "LuaCode") {  
  583     rTr.ReadVerbatim( "LuaCode", mLuaCode);  
  587   if(token.StringValue()== "LuaFile") {  
  588     rTr.ReadBegin( "LuaFile");  
  589     std::string  mLuaFile=rTr.ReadString();  
  591     rTr.ReadEnd( "LuaFile");  
  599   std::string label=rLabel;  
  600   if(label== "") label= "LuaFunctionDefinition";  
  607   FD_DLB( "LuaFunctionDefinition::DoWriteCore(): file " << rTw.FileName());  
  612     rTw.WriteVerbatim( "LuaCode", mLuaCode);  
  616     rTw.WriteBegin( "LuaFile");  
  618     rTw.WriteEnd( "LuaFile");  
  642   FD_DLB( "LuaFunction::LuaFunction(): fdef  " << pFuncDef);  
  653   pLuaFuncDef =  dynamic_cast<const LuaFunctionDefinition* >(fdef);  
  680     FD_DLB( "LuaFunction::DoTypeCheck("<< n <<  "): unknown type");  
  684     FD_DLB( "LuaFunction::DoTypeCheck("<< n <<  "): could not cast param value");  
  705   FD_DLB( "LuaFunction::DoExecute()");  
  724   FD_DLB( "LuaFunction::DoExecute(): done");  
  729   FD_DLB( "LuaFunction::SyntaxCheck()");  
  731     std::stringstream errstr;  
  732     errstr <<  "no valid variant";  
  733     throw Exception( "LuaFunction::Syntaxcheck()", errstr.str(), 47);  
  744   FD_DLB( "LuaFunction::SyntaxCheck(): done");  
  749   FD_DLB( "LuaFunction::SyntaxCheck()");  
  758   FD_DLB( "LuaFunction::SyntaxCheck(): done");  
  763   FD_DLB( "LuaFunction::DoExecuteA()");  
  768   int errload=luaL_loadbuffer( pLL, script, script_len,  "luafaudes");  
  770     std::string lerr= std::string(lua_tostring( pLL, -1));  
  771     int c1 = lerr.find_first_of( ':');  
  773     int c2 = lerr.find_first_of( ':',c1+1);  
  775     std::string line = lerr.substr(c1+1,c2-c1-1);    
  777       lerr= "error in Lua script: line " + line +  ": " + lerr.substr(c2+2);  
  780     throw Exception( "LuaFunction::DoExecuteA()", lerr, 49);  
  784   int errrun=lua_pcall( pLL, 0, 0, 0);   
  786     std::stringstream errstr;  
  787     errstr <<  "failed to run script: ";  
  788     errstr << std::string(lua_tostring( pLL, -1));  
  790     throw Exception( "LuaFunction::DoExecuteA()", errstr.str(), 49);  
  797   FD_DLB( "LuaFunction::DoExecuteB()");  
  800   lua_getglobal( pLL, "faudes");  
  802   if(!lua_istable( pLL,-1)) {  
  804     throw Exception( "LuaFunction::DoExecuteB()",  "failed to load faudes table", 49);  
  809   lua_pushstring( pLL,fname.c_str());  
  811   if(!lua_isfunction( pLL,-1)) {  
  813     lua_getglobal( pLL,fname.c_str());   
  814     if(!lua_isfunction( pLL,-1)) {  
  815       std::stringstream errstr;  
  816       errstr <<  "missing function \"" << fname <<  "\"";  
  818       throw Exception( "LuaFunction::DoExecuteB()", errstr.str(), 49);  
  823   lua_pushstring( pLL, "Type");  
  825   if(!lua_isfunction( pLL,-1))   
  826   if(!lua_istable( pLL,-1)) {     
  828     throw Exception( "LuaFunction::DoExecuteB():",  "failed to construct plain Type (1)", 49);  
  831   if(lua_pcall( pLL, 0, 1, 0) != 0) {   
  833     throw Exception( "LuaFunction::DoExecuteB():",  "failed to construct plain Type (2)", 49);  
  836   swig_lua_userdata* susr = (swig_lua_userdata*) lua_touserdata ( pLL, -1);  
  839     throw Exception( "LuaFunction::DoExecuteB():",  "failed to construct plain Type (3)", 49);  
  841   FD_DLB( "LuaFunction::DoExecuteB(): plain type is " << susr->type->name);  
  852   FD_DLB( "LuaFunction::DoExecuteC()");  
  866     if((ftype== "Integer") || (ftype== "Boolean") || (ftype== "String")) {  
  896       FD_DLB( "LuaFunction::DoExecuteC(): skip nonparameter value pos " << i);  
  900     if(ftype== "Integer") {  
  902       FD_DLB( "LuaFunction::DoExecuteC(): created ftype " << ftype);  
  906     if(ftype== "Boolean") {  
  908       FD_DLB( "LuaFunction::DoExecuteC(): created ftype " << ftype);  
  912     if(ftype== "String") {  
  913       lua_pushstring( pLL,((String*) ParamValue(i))->CValue().c_str());  
  914       FD_DLB( "LuaFunction::DoExecuteC(): created ftype " << ftype);  
  918     lua_pushstring( pLL,ftype.c_str());  
  920     if(!lua_isfunction( pLL,-1))   
  921     if(!lua_istable( pLL,-1)) {     
  922       std::stringstream errstr;  
  923       errstr <<  "failed to load constructor for \"" << ftype <<  "\"";  
  925       throw Exception( "LuaFunction::DoExecuteC()", errstr.str(), 49);  
  928     if(lua_pcall( pLL, 0, 1, 0) != 0) {   
  929       std::stringstream errstr;  
  930       errstr <<  "failed to construct for \"" << ftype <<  "\" (1)";  
  932       throw Exception( "LuaFunction::DoExecuteC()", errstr.str(), 49);  
  935     swig_lua_userdata* susr = (swig_lua_userdata*) lua_touserdata ( pLL, -1);  
  937       std::stringstream errstr;  
  938       errstr <<  "failed to construct for\"" << ftype <<  "\" (2)";  
  940       throw Exception( "LuaFunction::DoExecuteB()", errstr.str(), 49);  
  943     FD_DLB( "LuaFunction::DoExecuteC(): created stype " << susr->type->name <<  " for ftype " << ftype);  
  945     FD_DLB( "LuaFunction::DoExecuteC(): swig usrdata ptr  " << susr->ptr);  
  946     FD_DLB( "LuaFunction::DoExecuteC(): swig usrdata own flag  " << susr->own);  
  957     if(susr->own) free(susr->ptr);  
  959     susr->ptr =  dynamic_cast<void* >( ParamValue(i));   
  962   FD_DLB( "LuaFunction::DoExecuteC(): done");  
  967   FD_DLB( "LuaFunction::DoExecuteD()");  
  973   int t2=lua_gettop( pLL);  
  974   for( int i= t1; i<=t2; i++) {  
  975     lua_pushvalue( pLL,i);  
  976 #ifdef  FAUDES_DEBUG_LUABINDINGS 
  978     swig_lua_userdata* susr = (swig_lua_userdata*) lua_touserdata ( pLL, -1);  
  981     FD_DLB( "LuaFunction::DoExecuteD(): inspect stype " << susr->type->name);  
  982     FD_DLB( "LuaFunction::DoExecuteD(): swig usrdata ptr  " << susr->ptr);  
  983     FD_DLB( "LuaFunction::DoExecuteD(): swig usrdata own flag  " << susr->own);  
  985     FD_DLB( "LuaFunction::DoExecuteD(): faudes::Type converted ptr " << fptr);  
  991     FD_DLB( "LuaFunction::DoExecuteD(): detect error");  
  992     std::string lerr= std::string(lua_tostring( pLL, -1));  
  994     if(lerr.find( "break on application request")!=std::string::npos) {  
  995       lerr= "break on application request";  
  998     else if(lerr.find( "luafaudes script:")!=std::string::npos) {  
  999       std::size_t c1=lerr.find( "luafaudes script:");  
 1000       lerr=lerr.substr(c1);  
 1003     else if(lerr.size()>=2) {  
 1004       std::size_t c1 = lerr.find_first_of( ':');  
 1005       if(c1==std::string::npos) c1=0;  
 1006       if(c1+1>=lerr.size()) c1=0;  
 1007       std::size_t c2 = lerr.find_first_of( ':',c1+1);  
 1008       if(c2==std::string::npos) c2=c1+1;  
 1010         std::string line = lerr.substr(c1+1,c2-c1-1);    
 1011         lerr= "error in Lua script: line " + line +  ": " + lerr.substr(c2+2);  
 1016     throw Exception( "LuaFunction::DoExecuteD()", lerr, 49);  
 1018   FD_DLB( "LuaFunction::DoExecuteD():done ");  
 1024   FD_DLB( "LuaFunction::DoExecuteE()");  
 1027   for( int i= Variant()->Size()-1; i>=0; i--) {  
 1033     if(ftype== "Integer" && lua_isnumber( pLL,-1)) {  
 1034       FD_DLB( "LuaFunction::DoExecuteE(): retrieve type " << ftype);  
 1040     if(ftype== "Boolean" && lua_isboolean( pLL,-1)) {  
 1042       FD_DLB( "LuaFunction::DoExecuteE(): retrieved type " << ftype);  
 1047     if(ftype== "String" && lua_isstring( pLL,-1)) {  
 1049       FD_DLB( "LuaFunction::DoExecuteE(): retrieved type " << ftype);  
 1054     std::stringstream errstr;  
 1055     errstr <<  "invalid return values in \"" <<  Variant()-> Name() <<  "\"";  
 1057     throw Exception( "LuaFunction::DoExecuteE()", errstr.str(), 49);  
 1105   for( int i= Variant()->Size()-1; i>=0; i--) {  
 1145     const LuaFunctionDefinition* lfd= dynamic_cast<const LuaFunctionDefinition* >(fit->second);  
 1166   FD_DLB( "LuaState::Open()");  
 1167   mpLL=luaL_newstate();  
 1171   FD_DLB( "LuaState::Done()");  
 1177   FD_DLB( "LuaState::Close()");  
 1184   lua_gc(pLL, LUA_GCSTOP, 0);       
 1186   luaopen_faudes_allplugins(pLL);   
 1187   lua_gc(pLL, LUA_GCRESTART, 0);    
 1194   FD_DLB( "LuaState::Insatll(): file " << rFilename);  
 1195   TokenReader tr(rFilename);  
 1197   while(tr.Peek(token)) {  
 1199     if(!token.IsBegin( "LuaFunctionDefinition")) {  
 1203     LuaFunctionDefinition lfd;  
 1205     FD_DLB( "LuaState::Install(): found " << lfd.Name());  
 1217   FD_DLB( "LuaFunction::Push()");  
 1218   int savetop=lua_gettop(pLL);  
 1221   lua_getglobal(pLL, "faudes");  
 1222   int ftable=lua_gettop(pLL);  
 1223   if(!lua_istable(pLL,-1)) {  
 1224     lua_settop(pLL,savetop);  
 1225     throw Exception( "LuaState::Push()",  "failed to load faudes table", 49);  
 1228   lua_pushstring(pLL, "Type");  
 1229   lua_gettable(pLL,ftable);  
 1230   if(!lua_isfunction(pLL,-1))   
 1231   if(!lua_istable(pLL,-1)) {     
 1232     lua_settop(pLL,savetop);  
 1233     throw Exception( "LuaState::Push()",  "failed to construct plain Type (1)", 49);  
 1236   if(lua_pcall(pLL, 0, 1, 0) != 0) {   
 1237     lua_settop(pLL,savetop);  
 1238     throw Exception( "LuaState::Push()",  "failed to construct plain Type (2)", 49);  
 1241   swig_lua_userdata* susr = (swig_lua_userdata*) lua_touserdata (pLL, -1);  
 1243     lua_settop(pLL,savetop);  
 1244     throw Exception( "LuaState::Push()",  "failed to construct plain Type (3)", 49);  
 1246   FD_DLB( "LuaState::Push(): plain type is " << susr->type->name);  
 1254   if(ftype== "Integer") {  
 1255     lua_pushnumber(pLL,(( const Integer&)*fdata));  
 1256     FD_DLB( "LuaState::Push(): created ftype " << ftype);  
 1259   else if(ftype== "Boolean") {  
 1260     lua_pushboolean(pLL,(( const Boolean&)*fdata));  
 1261     FD_DLB( "LuaState::Push(): created ftype " << ftype);  
 1264   else if(ftype== "String") {  
 1265     lua_pushstring(pLL,(( const String&)*fdata).CValue().c_str());  
 1266     FD_DLB( "LuaState::Push(): created ftype " << ftype);  
 1271     lua_pushstring(pLL,ftype.c_str());  
 1272     lua_gettable(pLL,ftable);  
 1273     if(!lua_isfunction(pLL,-1))   
 1274     if(!lua_istable(pLL,-1)) {     
 1275       std::stringstream errstr;  
 1276       errstr <<  "failed to load constructor for \"" << ftype <<  "\"";  
 1277       lua_settop(pLL,savetop);  
 1278       throw Exception( "LuaState::Push()", errstr.str(), 49);  
 1281     if(lua_pcall(pLL, 0, 1, 0) != 0) {   
 1282       std::stringstream errstr;  
 1283       errstr <<  "failed to construct for \"" << ftype <<  "\" (1)";  
 1284       lua_settop(pLL,savetop);  
 1285       throw Exception( "LuaState::Push()", errstr.str(), 49);  
 1288     swig_lua_userdata* susr = (swig_lua_userdata*) lua_touserdata (pLL, -1);  
 1290       std::stringstream errstr;  
 1291       errstr <<  "failed to construct for\"" << ftype <<  "\" (2)";  
 1292       lua_settop(pLL,savetop);  
 1293       throw Exception( "LuaState::Push()", errstr.str(), 49);  
 1296     FD_DLB( "LuaState::Push(): created stype " << susr->type->name <<  " for ftype " << ftype);  
 1297     FD_DLB( "LuaState::Push(): faudes parameter at " << fdata);  
 1298     FD_DLB( "LuaState::Push(): swig usrdata ptr  " << susr->ptr);  
 1299     FD_DLB( "LuaState::Push(): swig usrdata own flag  " << susr->own);  
 1301     void* fptr= SwigCastPtr(susr->ptr,susr->type,stype);  
 1302     FD_DLB( "LuaState::Push(): faudes plain Type converted ptr " << fptr);  
 1304       std::stringstream errstr;  
 1305       errstr <<  "failed cast from " << ftype;  
 1306       lua_settop(pLL,savetop);  
 1307       throw Exception( "LuaState::Push()", errstr.str(), 49);  
 1309     ((Type*)fptr)->Assign(*fdata);  
 1312   lua_replace(pLL,-2);  
 1313   FD_DLB( "LuaFunction::DoExecuteB(): done");  
 1323   FD_DLB( "LuaFunction::Pop()");  
 1324   int savetop=lua_gettop(pLL);  
 1328   if(lua_isnumber(pLL,-1)) {  
 1329     res=  new Integer(lua_tointeger(pLL,-1));  
 1334   if(lua_isstring(pLL,-1)) {  
 1335     res=  new String(lua_tostring(pLL,-1));  
 1340   if(lua_isboolean(pLL,-1)) {  
 1341     res=  new Boolean(lua_toboolean(pLL,-1));  
 1347   lua_getglobal(pLL, "faudes");  
 1348   int ftable=lua_gettop(pLL);  
 1349   if(!lua_istable(pLL,-1)) {  
 1350     lua_settop(pLL,savetop);  
 1351     throw Exception( "LuaState::Pop()",  "failed to load faudes table", 49);  
 1355   lua_pushstring(pLL, "Type");  
 1356   lua_gettable(pLL,ftable);  
 1357   if(!lua_isfunction(pLL,-1))   
 1358   if(!lua_istable(pLL,-1)) {     
 1359     lua_settop(pLL,savetop);  
 1360     throw Exception( "LuaState::Pop()",  "failed to construct plain Type (1)", 49);  
 1363   if(lua_pcall(pLL, 0, 1, 0) != 0) {   
 1364     lua_settop(pLL,savetop);  
 1365     throw Exception( "LuaState::Pop()",  "failed to construct plain Type (2)", 49);  
 1368   swig_lua_userdata* susr = (swig_lua_userdata*) lua_touserdata (pLL, -1);  
 1370     lua_settop(pLL,savetop);  
 1371     throw Exception( "LuaState::Pop()",  "failed to construct plain Type (3)", 49);  
 1373   FD_DLB( "LuaState::Pop(): plain type is " << susr->type->name);  
 1381     std::stringstream errstr;  
 1382     errstr <<  "unknown data type";  
 1383     lua_settop(pLL,savetop);  
 1384     throw Exception( "LuaState::Pop()", errstr.str(), 49);  
 1387   void* fptr= SwigCastPtr(susr->ptr,susr->type,stype);  
 1388   FD_DLB( "LuaState::Pop(): swig  usrdata ptr " << susr->ptr);  
 1389   FD_DLB( "LuaState::Pop(): swig stype " << susr->type->name);  
 1390   FD_DLB( "LuaState::Pop(): faudes::Type converted ptr " << fptr);  
 1392     std::stringstream errstr;  
 1393     errstr <<  "faild to cast stype \"" << susr->type->name <<  "\" to plain Type";  
 1394     lua_settop(pLL,savetop);  
 1395     throw Exception( "LuaState::Pop()", errstr.str(), 49);  
 1398   res=((Type*)fptr)->Copy();  
 1401   FD_DLB( "LuaFunction::Pop(): done");  
 1411 Type*  LuaState::Global(lua_State* pLL,  const std::string& gname,  const Type* fdata) {  
 1414     lua_getglobal(pLL,gname.c_str());  
 1420     lua_setglobal(pLL,gname.c_str());  
 1433   FD_DLB( "LuaFunction::Evaluate()");  
 1436   int top = lua_gettop(pLL);  
 1441   if(luaL_loadbuffer(pLL, expr.c_str(), expr.size(),  "string")) {  
 1442     cerr=std::string(lua_tostring(pLL, -1));  
 1448   if(lua_pcall(pLL, 0, LUA_MULTRET, 0)){  
 1449     cerr=std::string(lua_tostring(pLL, -1));  
 1454   lua_settop(pLL,top);  
 1455   lua_gc(pLL, LUA_GCCOLLECT, 0);  
 1459     lua_settop(pLL,top);  
 1460     throw Exception( "LuaState::Evaluate()", cerr, 49);  
 1473 std::list< std::string >   LuaState::Complete(lua_State* pLL,  const std::string& word) {  
 1474   FD_DLB( "LuaFunction::Complete(" << word << ")");  
#define FAUDES_TYPE_IMPLEMENTATION(ftype, ctype, cbase)  
const std::string & Name(void) const  
std::string KeywordAt(int pos) const  
const std::string & PlugIn(void) const  
virtual void DoWrite(TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const  
const std::string & TextDoc(void) const  
const std::string & CType(void) const  
virtual const char * What() const  
const Signature & Variant(const std::string &rName) const  
void DoAssign(const FunctionDefinition &rSrc)  
int VariantsSize(void) const  
const Function * Prototype(void) const  
virtual void DoRead(TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)  
virtual void DoReadCore(TokenReader &rTr)  
bool DoEqual(const FunctionDefinition &rOther) const  
virtual void DoWriteCore(TokenWriter &rTw) const  
static FunctionRegistry * G()  
std::map< std::string, FunctionDefinition * >::const_iterator Iterator  
void Insert(FunctionDefinition *pFunctionDef)  
Iterator Begin(void) const  
virtual void Definition(const FunctionDefinition *fdef)  
const Signature * Variant(void) const  
const FunctionDefinition * Definition(void) const  
void AllocateValues(void)  
virtual void DoVariant(int n)  
std::vector< Type * > mParameterValues  
void ParamValue(int n, Type *param)  
int VariantsSize(void) const  
virtual void DoRead(TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)  
virtual void DoWriteCore(TokenWriter &rTw) const  
void Install(LuaState *pL=NULL) const  
std::string SyntaxCheck(void)  
virtual void DoReadCore(TokenReader &rTr)  
LuaState * DefaultL(void) const  
virtual void DoWrite(TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const  
LuaFunction * pLuaFunction  
std::string Evaluate(LuaState *pL=NULL)  
void DefaultL(LuaState *pL)  
LuaFunctionDefinition(const std::string &name="")  
static void Register(const std::string &rFilename)  
const std::string & LuaCode(void) const  
virtual bool DoEqual(const LuaFunctionDefinition &rOther) const  
virtual void DoAssign(const LuaFunctionDefinition &rSrc)  
virtual void DoExecuteC()  
std::vector< bool > mLParameter  
virtual void DoExecuteB()  
virtual void DoExecuteD()  
LuaFunction(const LuaFunctionDefinition *fdef)  
virtual void DoExecuteE()  
virtual bool DoTypeCheck(int n)  
virtual LuaFunction * New() const  
const LuaFunctionDefinition * pLuaFuncDef  
std::vector< bool > mLReturn  
virtual void DoVariant(int n)  
const LuaFunctionDefinition * Definition(void) const  
virtual void DoExecuteA()  
static void Initialize(lua_State *pLL)  
Type * Global(const std::string &gname, const Type *fdata=0)  
static LuaState * G(void)  
void Install(const std::string &rFilename)  
void Evaluate(const std::string &expr)  
std::list< std::string > Complete(const std::string &word)  
void Push(const Type *fdata)  
std::string Str(void) const  
const std::string & Type(void) const  
const ParamAttr & Attribute(void) const  
const std::string & Name(void) const  
const Parameter & At(int n) const  
const Type * Prototype(const std::string &rTypeName) const  
static TypeRegistry * G()  
virtual const std::string & Name(void) const  
const std::string & FaudesTypeName(const Type &rObject)  
static std::list< std::string > faudes_rl_complete(lua_State *L, const std::string &word)  
struct faudes::swig_type_info swig_type_info  
struct swig_type_info *(* swig_dycast_func)(void **)  
void * SwigCastPtr(void *ptr, swig_type_info *from, swig_type_info *ty)  
void faudes_hook_register(lua_State *L)  
struct faudes::swig_cast_info swig_cast_info  
swig_lua_userdata * SwigUserData(lua_State *L, int index)  
void faudes_dict_insert_entry(const std::string &topic, const std::string &key, const std::string &entry)  
std::string ToStringInteger(Int number)  
void faudes_print_register(lua_State *L)  
void *(* swig_converter_func)(void *, int *)  
std::string MangleString(const std::string &str)  
swig_converter_func converter  
struct swig_cast_info * prev  
struct swig_cast_info * next  
struct swig_cast_info * cast  
  
 
 
libFAUDES 2.33l 
--- 2025.09.16  
--- c++ api documentaion by doxygen
 
 |