lbp_function.h
Go to the documentation of this file.
1 /** @file lbp_function.h luafaudes class to run scripts as rti functions */
2 
3 /* FAU Discrete Event Systems Library (libfaudes)
4 
5 Copyright (C) 2010 Thomas Moor
6 
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
11 
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16 
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
20 
21 
22 #ifndef FAUDES_LBPFUNCTION_H
23 #define FAUDES_LBPFUNCTION_H
24 
25 #include "corefaudes.h"
26 
27 // forward
28 struct lua_State;
29 
30 namespace faudes{
31 
32 // forward
33 class LuaFunction;
34 class LuaState;
35 
36 /**
37  * A LuaFunctionDefinition is derived from FunctionDefinition to
38  * define a faudes-function by a Lua script. It has
39  * the Lua code as an additional member variable and uses a LuaFunction as a
40  * prototype object. In particular, LuaFunctionDefinitions are allways
41  * valid in the sense that hey have a prototype. The LuaFunction object
42  * implements DoTypeCheck and DoExecute to run the specifed Lua code.
43  * Thus, a LuaFunction can be tranparently accessed via the run-time interface
44  * and bahves like any other registered faudes function.
45  *
46  * Alternatively,
47  * you can use the Install() method to install a LuaFunctionDefinition to
48  * a LuaState. Then, the function can be accessed by the Lua interpreter.
49  * Install() will generate code to dispatch the function variants with the
50  * same semantics as the SWIG generated interface for other faudes functions.
51  * Again, integeration is transparent from the perspective of the Lua interpreter.
52  *
53  *
54  * The token io format is demonstrated by the
55  * following example:
56  *
57  * @code
58  * <LuaFunctionDefinition name="LuaExtension::LargeGenerator">
59  *
60  * <Documentation>
61  * Construct a generator by random.
62  * </Documentation>
63  * <Keywords> "luaextension" "example" </Keywords>
64  *
65  * <VariantSignatures>
66  * <Signature name="LargeGen(#Q,#Sigma,GRes)">
67  * <Parameter name="SizeQ" ftype="Integer" access="In"/>
68  * <Parameter name="SizeSigma" ftype="Integer" access="In"/>
69  * <Parameter name="Res" ftype="Generator" access="Out" />
70  * </Signature>
71  * </VariantSignatures>
72  *
73  * <LuaCode>
74  * <[CDATA[
75  *
76  * -- Extension reports on loading
77  * print('loading luaextension "LargeGenerator"')
78  *
79  * -- Define my function (mangled version of variant name)
80  * function faudes.LargeGen_Q_Sigma_GRes(qn,sn,gen)
81  *
82  * -- Function reports on execution
83  * print(string.format('LargeGen(...): qn=%d sn=%d',qn,sn))
84  *
85  * -- Exeution code
86  * gen:Clear()
87  * for i=1,qn do
88  * gen:InsState(i)
89  * end
90  * for i=1,sn do
91  * gen:InsEvent(string.format('ev_%d',i))
92  * end
93  *
94  * -- Done
95  * return
96  *
97  * -- End of function definition
98  * end
99  *
100  * -- Extension reports on loading
101  * print('loading luaextension: done')
102  *
103  * ]]>
104  * </LuaCode>
105  *
106  * </LuaFunctionDefinition>
107  * @endcode
108  *
109  * Restrictions and conventions:
110  * - Type-checking is done via the Cast() function of the faudes Type interface. As a
111  * consequence, you may only use types that are registered with the run-time-interface.
112  * - On execution, the LuaFunction instance has to locate the respective function
113  * in the supplied lua code. In order to allow for multiple variants, the convention is
114  * to have one lua function each with the name of the corresponding variant. Since
115  * variant names may contain funny characters, name matching is performed after
116  * so called mangeling: any sequence of non-alpha-numerics is replaced by a single "_",
117  * a trailing "_" is dropped. E.g. the variant <tt>res=a+b</tt> matches the Lua function <tt>res_a_b</tt>.
118  * - Parameters other than elementary (integer, boolean and string) are passed to
119  * the Lua function by reference. However, Lua will consistently interpret the reference itself
120  * as a parameter value. Thus, to assign a value to an <tt>access="Out"</tt> or <tt>access="InOut"</tt>
121  * parameter, you must use the assigment memberfunction Assign (as opposed to the assignment operator "=").
122  * - Elementary types (i.e. integers, booleans and strings) are passed to the Lua function by value.
123  * Thus, it would be pointless to have an elementary typed parameter with access attribute other than
124  * <tt>access="In"</tt>. In order to implement elementary typed return values, the respective
125  * Lua function must return the corresponding values by an approriate return statement. The signature
126  * should indicate this by the attribute <tt>creturn="true"</tt>. The current implementation
127  * will automatically imply <tt>creturn="true"</tt> for any <tt>access="Out"</tt> or
128  * <tt>access="InOut"</tt>.
129  * - Since luafaudes has no concept of const references, it is the responsability of the
130  * script programer to respect parameter <tt>access</tt> attributes.
131  * - When using Install() to install the function to a LuaState, a single wrapper function will be
132  * defined to dispatch variants. By convention, this function is located in <tt>faudes.name_of_fdef</tt>,
133  * where <tt>name_of_fdef</tt> is the name of the respective LuaFunctionDefinition.
134  *
135  *
136  *
137  * @ingroup LuabindingsPlugin
138  */
139 
141 
142  // faudes type
144 
145 public:
146 
147  /**
148  * Constructor.
149  *
150  * In contrast to the std FunctionDefinition, the default constructor
151  * sets up a valid lua function definition with a newly created LuaFunction
152  * as prototype.
153  * Of course, you will need to set the signatures and the lua code
154  * to obtain an operational function.
155  */
156  LuaFunctionDefinition(const std::string& name="");
157 
158  /**
159  * Copy constructor
160  */
162 
163  /**
164  * Destructor
165  */
166  virtual ~LuaFunctionDefinition(void){};
167 
168 
169  /**
170  * Clear documentation-data, signature and script (keep prototype)
171  */
172  void Clear(void);
173 
174  /**
175  * Get Lua code
176  *
177  * @return
178  * Lua code as std string
179  */
180  const std::string& LuaCode(void) const;
181 
182  /**
183  * Set Lua code
184  *
185  * @param rCode
186  * Lua code as std string
187  */
188  void LuaCode(const std::string& rCode);
189 
190  /**
191  * Set default lua state.
192  *
193  * Sets the default lua state on which functions that refer to
194  * this function definition will use for execution.
195  * If set to NULL (e.g. on consruction), the
196  * global state is used. However, the function object
197  * itself may overwrite the default.
198  *
199  * @param pL
200  * Lua state
201  */
202  void DefaultL(LuaState* pL);
203 
204  /**
205  * Get default lua state.
206  *
207  * @return
208  * Lua state
209  */
210  LuaState* DefaultL(void) const;
211 
212  /**
213  * Syntax check lua code.
214  *
215  * This routine instantiates a LuaFunction from this function definition
216  * and does all it needs to run the script, except to invoke the any of the
217  * variant functions. The reasoning is, that the script may hang and, thus,
218  * never return. Errors are indicated returned as an error string.
219  *
220  * @return
221  * Error message as string, or empty string on success
222  */
223  std::string SyntaxCheck(void);
224 
225  /**
226  * Evaluate lua code.
227  *
228  * This routine evaluates the LuaCode literally. This method is used to execute
229  * LuaCode that is not part of any particular variant. To execute a
230  * particular variant, instantiate a LuaFunction and invoke Execute().
231  *
232  * If you pass NULL as destination state, the global state will be used.
233  *
234  * @param pL
235  * Reference to the Lua state
236  * @return
237  * Error message as string, or empty string on success
238  */
239  std::string Evaluate(LuaState* pL=NULL);
240 
241  /**
242  * Install this function to a Lua state
243  *
244  * This routine installs the Lua code of this function
245  * definition to the table "faudes" of the specified Lua state.
246  * It also constructs a wrapper function
247  * to dispatch signatures and palces this in the table "faudes".
248  * Effectively, the resulting Lua state is prepared to execute the
249  * Lua function with the same semantics as used for SWIG generated wrappers
250  * of C++ functions.
251  *
252  * If you pass NULL as destination state, the global state will be used.
253  *
254  * @param pL
255  * Reference to the Lua state
256  */
257  void Install(LuaState* pL=NULL) const;
258 
259  /**
260  * Install this function to a Lua state.
261  *
262  * Alternative signature for applications that do not use the
263  * the LuaState wrapper class. See also Install(LuaState*).
264  *
265  * @param pLL
266  * Reference to the Lua state
267  */
268  void Install(lua_State* pLL) const;
269 
270 
271  /*
272  * Register LuaExtension with the run-time-interface.
273  *
274  * This static convenience method registers all LuaFunctionDefinitions found
275  * in an extension file with the FunctionRegistry. Thus, after registration
276  * you can use the Lua function via the run-time-interface as if they
277  * where C++ functions.
278  *
279  * Note: if you also want to use the provided functions within a Lua interpreter,
280  * you must also install the extension to a lua state. This can be done on
281  * a per-file basis by LuaState::Install(const std::string&) or for the any
282  * functions registered by LuaState::Reset().
283  *
284  *
285  * @param rFilename
286  * Source file (typically .flx)
287  */
288  static void Register(const std::string& rFilename);
289 
290 
291 protected:
292 
293  /**
294  * Std faudes type interface: assignment.
295  *
296  * @param rSrc
297  * Source to copy from
298  */
299  virtual void DoAssign(const LuaFunctionDefinition& rSrc);
300 
301  /**
302  * Std faudes type interface: test equality
303  *
304  * @param rOther
305  * Other object to compare with.
306  * @return
307  * True on match.
308  */
309  virtual bool DoEqual(const LuaFunctionDefinition& rOther) const;
310 
311  /**
312  * Read configuration data of this object from TokenReader.
313  * Actual reading is done by DoReadCore.
314  *
315  * The section defaults to "LuaFunctionDefinition", context ignored.
316  *
317  * @param rTr
318  * TokenReader to read from
319  * @param rLabel
320  * Section to read
321  * @param pContext
322  * Read context to provide contextual information (ignored)
323  *
324  * @exception Exception
325  * - Token mismatch (id 50, 51, 52)
326  * - IO error (id 1)
327  */
328  virtual void DoRead(TokenReader& rTr, const std::string& rLabel = "", const Type* pContext=0);
329 
330  /**
331  * Read configuration data of this object from TokenReader.
332  *
333  * This method reads members only, it does not read the section.
334  *
335  * @param rTr
336  * TokenReader to read from
337  *
338  * @exception Exception
339  * - Token mismatch (id 50, 51, 52)
340  * - IO error (id 1)
341  */
342  virtual void DoReadCore(TokenReader& rTr);
343 
344  /**
345  * Write configuration data of this object to TokenWriter.
346  *
347  * The section defaults to "LuaFunctionDefinition", context ignored.
348  *
349  * @param rTw
350  * Reference to TokenWriter
351  * @param rLabel
352  * Label of section to write
353  * @param pContext
354  * Write context to provide contextual information
355  *
356  * @exception Exception
357  * - IO errors (id 2)
358  */
359  virtual void DoWrite(TokenWriter& rTw, const std::string& rLabel="",const Type* pContext=0) const;
360 
361  /**
362  * Write configuration data of this object to TokenWriter.
363  *
364  * This method writes plain member data, the section lables are not
365  * written.
366  *
367  * @param rTw
368  * Reference to TokenWriter
369  *
370  * @exception Exception
371  * - IO errors (id 2)
372  */
373  virtual void DoWriteCore(TokenWriter& rTw) const;
374 
375 
376  /**
377  * Assign prototype object
378  *
379  * @param pFunc
380  * Function instance
381  *
382  */
383  virtual void Prototype(Function* pFunc);
384 
385  /** Typed prototype instance */
387 
388  /** Lua code */
389  std::string mLuaCode;
390 
391  /** Lua file */
392  std::string mLuaFile;
393 
394  /** Default lua state*/
396 
397 };
398 
399 
400 /**
401  * Wrapper class to maintain a Lua state.
402  *
403  * This class is still under construction. It aims for a sensible collection
404  * of operations that we may want to execute on a Lua state from the libFAUDES
405  * perspective. The current implementation provides static members that directly
406  * operate on a lua_State as well as a more comfortable interface that
407  * operates on thre wrapped faudes::LusState.
408  *
409  * @ingroup LuabindingsPlugin
410  */
411 
413 public:
414  /**
415  * Constructor
416  */
417  LuaState(void);
418 
419  /**
420  * Destructor
421  */
422  ~LuaState(void);
423 
424  /**
425  * Access Lua state.
426  */
427  lua_State* LL(void);
428 
429  /**
430  * Convenience global Lua state.
431  */
432  static LuaState* G(void);
433 
434  /**
435  * Reinitialize Lua state.
436  *
437  * This method reconstructs the internal Lua state.
438  * Any references become invalid. Any LuaFunctiondefinitions from
439  * the FunctionRegistry will be (re-)installed to the new state.
440  */
441  void Reset(void);
442 
443  /**
444  * Install LuaExtension to Lua state.
445  *
446  * This function instantiates a LuaFunctionDefinition objects from
447  * the file and uses the Install member function to install each function
448  * to the specified lua state. Thus, after the extension has been installed,
449  * the respective Lua functions can be invoked within Lua as if they where
450  * C++ function with SWIG generated wrappers.
451  *
452  * Note: if you want to use the extension via the run-time-interface, you
453  * must also register them with the FunctionRegistry; see also the static method
454  * LuaFunctionDefinition::Register(const std::string&).
455  *
456  * @param rFilename
457  * Source file (typically .flx)
458  */
459  void Install(const std::string& rFilename);
460 
461  /**
462  * Initialze.
463  *
464  * Loads std libraries and libFAUDES wrappers.
465  *
466  * Note: this static version is provided for applications
467  * that maintain their lua state themselves. If yo use
468  * the wrapper class LuaState, you dont need explicit
469  * initialisation.
470  *
471  * @param pLL
472  * Lua state
473  */
474  static void Initialize(lua_State* pLL);
475 
476  /**
477  * Install LuaExtension to Lua state.
478  *
479  * Note: this static version is provided for applications
480  * that maintain their lua state themselves. If yo use
481  * the wrapper class LuaState, you should use the Install(const std::string&) method.
482  *
483  * @param pLL
484  * Target lua state
485  * @param rFilename
486  * Source file
487  * @ingroup LuabindingsPlugin
488  */
489  static void Install(lua_State* pLL, const std::string& rFilename);
490 
491  /**
492  * Push faudes typed object on the Lua stack.
493  *
494  * This method uses SWIG generated constructors to instantiate new Lua userdata
495  * object of the same type as the specified data. It than invokes
496  * the faudes Assign method to assign a copy.
497  *
498  * @param fdata
499  * Data to push
500  * @exception Exception
501  * - Lua Error (id 49)
502  *
503  */
504  void Push(const Type* fdata);
505 
506  /**
507  * Push faudes typed object on the Lua stack.
508  *
509  * This static version is meant for applications that maintain
510  * their Lus state themselves. See also Push(const Type&)
511  *
512  * @param pLL
513  * Lua state
514  * @param fdata
515  * Data to push
516  * @exception Exception
517  * - Lua Error (id 49)
518  *
519  */
520  static void Push(lua_State* pLL, const Type* fdata);
521 
522  /**
523  * Pop faudes typed object from Lua stack.
524  *
525  * This method uses SWIG generated type casts to retrieve the
526  * faudes object from the userdata on the top of the stack.
527  * It then uses the faudes Copy() method to instantiate a copy,
528  * to be owned by the caller.
529  *
530  *
531  * @return
532  * Destination for pop data
533  * @exception Exception
534  * - Lua Error (id 49)
535  *
536  */
537  Type* Pop(void);
538 
539  /**
540  * Pop faudes typed object from Lua stack.
541  *
542  * This static version is meant for applications that maintain
543  * their Lua state themselves. See also Pop(const Type&)
544  *
545  * @param pLL
546  * Lua state
547  * @return
548  * Destination for pop data
549  * @exception Exception
550  * - Lua Error (id 49)
551  *
552  */
553  static Type* Pop(lua_State* pLL);
554 
555  /**
556  * Get/set global data
557  *
558  * This method provides access to global variables.
559  * To set a variable, provide a non-NULL fdata parameter.
560  * If you obmitt the fdata paraneter, the default will indicate a
561  * get operation. Here, the value is returned as a copy and
562  * owned by the caller.
563  *
564  * An expection is thrown if the variable either does not exist,
565  * or cannot be converted to a faudes::Type.
566  *
567  * @param gname
568  * Name of global variable
569  * @param fdata
570  * Data to set
571  * @exception Exception
572  * - Lua Error (id 49)
573  *
574  */
575  Type* Global(const std::string& gname, const Type* fdata=0);
576 
577  /**
578  * Get/set global data
579  *
580  * This static version is meant for applications that maintain
581  * their Lua state themselves. See also Globat(const std::string&, const Type*)
582  *
583  * @param pLL
584  * Lua state
585  * @param gname
586  * Name of global variable
587  * @param fdata
588  * Data to set
589  * @exception Exception
590  * - Lua Error (id 49)
591  *
592  */
593  static Type* Global(lua_State* pLL, const std::string& gname, const Type* fdata=0);
594 
595  /**
596  * Evaluate Lua expression.
597  *
598  * This method runs the Lua-interpreter on the specified expression.
599  * In the case of an error, an exception will be thrown.
600  *
601  * @exception Exception
602  * - Lua Error (id 49)
603  *
604  */
605  void Evaluate(const std::string& expr);
606 
607  /**
608  * Evaluate Lua expression.
609  *
610  * This static version is meant for applications that maintain
611  * their Lua state themselves. See also Evaluate(const std::string&)
612  *
613  * @param pLL
614  * Lua state
615  * @param expr
616  * Expression to evaluate
617  * @exception Exception
618  * - Lua Error (id 49)
619  *
620  */
621  static void Evaluate(lua_State* pLL, const std::string& expr);
622 
623  /**
624  * Complete Lua identifier
625  *
626  * This method uses a variation of Mike Pall's advaced readline
627  * support patch to fugure possible completions if a string
628  * to match a valid identifyer.
629  *
630  * @param word
631  * String to complete
632  * @return
633  * List of completions, first entry is longest common prefix.
634  */
635  std::list< std::string > Complete(const std::string& word);
636 
637  /**
638  * Complete Lua identifier
639  *
640  * This static version is meant for applications that maintain
641  * their Lua state themselves. See also Evaluate(const std::string&)
642  *
643  * @param pLL
644  * Lua state
645  * @param word
646  * String to complete
647  * @return
648  * List of completions, first entry is longest common prefix.
649  */
650  static std::list< std::string > Complete(lua_State* pLL, const std::string& word);
651 
652 
653 private:
654 
655  // disable copy constructor
656  LuaState(const LuaState&){};
657  // lua state
658  lua_State* mpLL;
659  // open/close lua state
660  void Open(void);
661  void Close(void);
662 };
663 
664 
665 /**
666  * A LuaFunction is a faudes-function that executes a luafaudes script.
667  *
668  * LuaFunction is derived from Function and implements the DoTypeCheck and DoExecute
669  * interface to run the lua code as supplied by the corresponding function defintion.
670  * Thus, it is considered an error to set the function definition to an object that
671  * does not cast to a LuaFunctionDefinition.
672  *
673  * @ingroup LuabindingsPlugin
674  */
675 
677 
678  public:
679  /**
680  * Constructor.
681  * For the function to be operational, a valid reference to the corresponding
682  * LuaFunctionDefinition is required. The only exception is the prototype function
683  * object used in the LuaFunctionDefinition itself.
684  */
686 
687  /** Destructor */
688  ~LuaFunction(void){};
689 
690  /**
691  * Construct on heap.
692  * Create a new instance of this function class and return pointer.
693  * The new instance will use the same function definition as this instance.
694  *
695  * @return
696  * Pointer to faudes::Function instance.
697  *
698  */
699  virtual LuaFunction* New() const;
700 
701 
702  /**
703  * Set function definition.
704  * Normally, functions are provided with a function definition on construction.
705  * The only exception are prototype objects used in function definitions themselfs
706  * and in the function registry.
707  *
708  * @param fdef
709  * Function definition to set.
710  *
711  */
712  void Definition(const FunctionDefinition* fdef);
713 
714 
715  /**
716  * Get function definition.
717  *
718  * @return
719  * Function definition used by this function.
720  *
721  */
722  const LuaFunctionDefinition* Definition(void) const;
723 
724 
725  /**
726  * Syntax check lua code.
727  *
728  * This routine does all it needs to run the script,
729  * except to invoke the specified function. The reasoning is, that
730  * the script may hang and, thus, never return. A consequence
731  * is, that you must set a variant and you must supply parameter
732  * values befor checking. You may use AllocateValues() and FreeValues()
733  * for this purpose. Errors are indicated by an exception.
734  *
735  * Note that the LuaFunctionDefinition provides a convenience wrapper
736  * that runs the check on all variants and cares about value allocation.
737  *
738  * @exception Exception
739  * - No such variant (id 47)
740  * - Error in Lua script (id 49)
741  */
742  void SyntaxCheck(void);
743 
744  /**
745  * Evaluate lua code.
746  *
747  * This routine avaluates the associated Lua code literally, i.e.
748  * no arguments are passed, no specific function is invoked.
749  * See also Execute().
750  *
751  * @exception Exception
752  * - Error in Lua script (id 49)
753  */
754  void Evaluate(void);
755 
756 
757  /**
758  * Set lua state
759  *
760  * Sets the lua state which this function will use for execution.
761  * If set to NULL (e.g. on consruction), the
762  * function definition's default state will be used. If
763  * this is not set either, the global state is used.
764  *
765  * @param l
766  * Lua state
767  */
768  void L(LuaState* l);
769 
770  /**
771  * Get default lua state
772  *
773  * @return
774  * Lua state
775  */
776  LuaState* L(void);
777 
778  protected:
779 
780  /*
781  * Do set variant from function definition.
782  *
783  * For LuaFunctions, we accept the special variant -1 for
784  * as "no variant", just run the script on execution.
785  *
786  * @param n
787  * Variant index
788  *
789  * @exception Exception
790  * - No function definition available (id 47)
791  * - No such variant (id 48)
792  */
793  virtual void DoVariant(int n);
794 
795 
796  /**
797  * Method to test the type of an assigned parameter with the
798  * specified faudes::Signature (i.e. their TypeDefinition label).
799  *
800  * Note: this method is called by Function::Execute() before actual function
801  * execution via DoExecute(). It may be used to perform a dynamic cast in
802  * preparation of DoExecute(). The latter is only called, if all types match.
803  *
804  * @param n
805  * Position of parameter to check
806  * @return
807  * True if type matches signature.
808  *
809  * @exception Exception
810  * - Signature undefined (id 48)
811  * - Parameter number out of range (id 48)
812  */
813  virtual bool DoTypeCheck(int n);
814 
815  /**
816  * Executes code as supplied by FunctionDefinition
817  *
818  * @exception Exception
819  * - Exception during lua setup (id 49)
820  * - Any exception during execution of script
821  */
822  virtual void DoExecute();
823 
824  /**
825  * Execute stages
826  *
827  * @exception Exception
828  * - Exception during lua setup (id 49)
829  */
830  virtual void DoExecuteA();
831 
832  /**
833  * Execute stages
834  *
835  * @exception Exception
836  * - Exception during lua setup (id 49)
837  */
838  virtual void DoExecuteB();
839 
840  /**
841  * Execute stages
842  *
843  * @exception Exception
844  * - Exception during lua setup (id 49)
845  * - Any exception during execution of script
846  */
847  virtual void DoExecuteC();
848 
849  /**
850  * Execute stages
851  *
852  * @exception Exception
853  * - Exception during lua setup (id 49)
854  */
855  virtual void DoExecuteD();
856 
857 
858  /**
859  * Execute stages
860  *
861  * @exception Exception
862  * - Exception during lua setup (id 49)
863  */
864  virtual void DoExecuteE();
865 
866 
867  /** Typed reference to definition */
869 
870  /** State of Lua interpreter */
872  lua_State* pLL;
873  int mFtable;
875  void* mFType;
876  std::vector<bool> mLReturn;
877  std::vector<bool> mLParameter;
880 };
881 
882 
883 
884 
885 
886 } // namespace
887 #endif
#define FAUDES_API
Definition: cfl_platform.h:80
#define FAUDES_TYPE_DECLARATION(ftype, ctype, cbase)
Definition: cfl_types.h:880
virtual void DoRead(TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)
virtual void DoWriteCore(TokenWriter &rTw) const
virtual void DoReadCore(TokenReader &rTr)
virtual void DoWrite(TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
static void Register(const std::string &rFilename)
virtual ~LuaFunctionDefinition(void)
Definition: lbp_function.h:166
void Definition(const FunctionDefinition *fdef)
LuaState * L(void)
virtual void DoExecuteC()
std::vector< bool > mLParameter
Definition: lbp_function.h:877
void SyntaxCheck(void)
virtual void DoExecuteB()
void L(LuaState *l)
virtual void DoExecuteD()
virtual void DoExecute()
LuaFunction(const LuaFunctionDefinition *fdef)
virtual void DoExecuteE()
virtual bool DoTypeCheck(int n)
virtual LuaFunction * New() const
const LuaFunctionDefinition * pLuaFuncDef
Definition: lbp_function.h:868
std::vector< bool > mLReturn
Definition: lbp_function.h:876
virtual void DoVariant(int n)
const LuaFunctionDefinition * Definition(void) const
virtual void DoExecuteA()
lua_State * mpLL
Definition: lbp_function.h:656
static void Initialize(lua_State *pLL)
Type * Global(const std::string &gname, const Type *fdata=0)
static Type * Global(lua_State *pLL, const std::string &gname, const Type *fdata=0)
Type * Pop(void)
static LuaState * G(void)
static void Evaluate(lua_State *pLL, const std::string &expr)
static Type * Pop(lua_State *pLL)
static void Push(lua_State *pLL, const Type *fdata)
LuaState(const LuaState &)
Definition: lbp_function.h:656
void Install(const std::string &rFilename)
void Close(void)
void Evaluate(const std::string &expr)
void Open(void)
void Reset(void)
lua_State * LL(void)
std::list< std::string > Complete(const std::string &word)
void Push(const Type *fdata)
static std::list< std::string > Complete(lua_State *pLL, const std::string &word)
static void Install(lua_State *pLL, const std::string &rFilename)

libFAUDES 2.33h --- 2025.06.18 --- c++ api documentaion by doxygen