Pol  Revision:4b29d2b
fmodule.h
Go to the documentation of this file.
1 
7 #ifndef FMODULE_H
8 #define FMODULE_H
9 
10 #include <map>
11 #include <stddef.h>
12 #include <string>
13 #include <vector>
14 
15 #include "../clib/boostutils.h"
16 #include "../clib/maputil.h"
17 
18 namespace Pol
19 {
20 namespace Bscript
21 {
22 class UserFunction;
23 
25 {
26 public:
28  unsigned nargs;
29  int funcidx; // according to the executor, what's its function index
30 
31  // compiler only:
32  UserFunction* uf; // compiler only
33  bool used; // compiler only
34 
35  ModuleFunction( const char* fname, int nargs, UserFunction* uf );
37 };
38 
40 {
41 public:
43  std::vector<ModuleFunction*> functions;
44 
45  // compiler only:
46  typedef std::map<std::string, ModuleFunction*, Clib::ci_cmp_pred> FunctionsByName;
47  FunctionsByName functionsByName;
48  std::vector<ModuleFunction*> used_functions;
49  std::vector<UserFunction*> owned_userfuncs;
50 
52 
53  bool isFunc( const char* funcName, ModuleFunction** pmf, int* funcidx );
54  explicit FunctionalityModule( const char* modname );
56 
57  void addFunction( const char* funcname, int nparams, UserFunction* uf = NULL );
58  void fillFunctionsByName();
59 
60 private:
62 };
63 }
64 }
65 #endif
std::vector< UserFunction * > owned_userfuncs
Definition: fmodule.h:49
boost_utils::function_name_flystring name
Definition: fmodule.h:27
std::map< std::string, ModuleFunction *, Clib::ci_cmp_pred > FunctionsByName
Definition: fmodule.h:46
FunctionsByName functionsByName
Definition: fmodule.h:47
std::vector< ModuleFunction * > used_functions
Definition: fmodule.h:48
std::vector< ModuleFunction * > functions
Definition: fmodule.h:43
boost_utils::function_name_flystring modulename
Definition: fmodule.h:51
ModuleFunction(const char *fname, int nargs, UserFunction *uf)
Definition: fmodule.cpp:16
Definition: berror.cpp:12
boost::flyweight< std::string, boost::flyweights::tag< function_name_tag >, FLYWEIGHT_HASH_FACTORY > function_name_flystring
Definition: boostutils.h:160