Pol  Revision:cb584c9
syshookscript.h
Go to the documentation of this file.
1 
7 #ifndef SYSHOOKSCRIPT_H
8 #define SYSHOOKSCRIPT_H
9 
10 #include <string>
11 #include <vector>
12 
13 #include "../bscript/bobject.h"
14 #include "scrdef.h"
15 #include "uoexec.h"
16 
17 namespace Pol
18 {
19 namespace Bscript
20 {
21 struct BackupStruct;
22 } // namespace Bscript
23 } // namespace Pol
24 
25 namespace Pol
26 {
27 namespace Plib
28 {
29 class Package;
30 }
31 namespace Core
32 {
34 {
35 public:
36  ExportScript( const Plib::Package* pkg, std::string scriptname );
37  ExportScript( const ScriptDef& isd );
38  bool Initialize();
39  const std::string& scriptname() const;
40  bool FindExportedFunction( const std::string& name, unsigned args, unsigned& PC ) const;
41  bool FindExportedFunction( const char* name, unsigned args, unsigned& PC ) const;
42 
43  bool call( unsigned PC, Bscript::BObjectImp* p0 ); // throw()
44  bool call( unsigned PC, Bscript::BObjectImp* p0, Bscript::BObjectImp* p1 ); // throw()
45  bool call( unsigned PC, Bscript::BObjectImp* p0, Bscript::BObjectImp* p1,
46  Bscript::BObjectImp* p2 ); // throw()
47  bool call( unsigned PC, Bscript::BObjectImp* p0, Bscript::BObjectImp* p1, Bscript::BObjectImp* p2,
48  Bscript::BObjectImp* p3 ); // throw()
49 
50  std::string call_string( unsigned PC, Bscript::BObjectImp* p0,
51  Bscript::BObjectImp* p1 ); // throw()
52  std::string call_string( unsigned PC, Bscript::BObjectImp* p0, Bscript::BObjectImp* p1,
53  Bscript::BObjectImp* p2 ); // throw()
54 
55  int call_long( unsigned PC, Bscript::BObjectImp* p0 ); // throw()
56  int call_long( unsigned PC, Bscript::BObjectImp* p0, Bscript::BObjectImp* p1 ); // throw()
57 
58  Bscript::BObjectImp* call( unsigned PC, Bscript::BObjectImp* p0,
59  std::vector<Bscript::BObjectRef>& pmore );
60  Bscript::BObject call( unsigned PC, Bscript::BObjectImp* p0, Bscript::BObjectImpRefVec& pmore );
61 
62  Bscript::BObject call_object( unsigned PC, Bscript::BObjectImp* p0, Bscript::BObjectImp* p1 );
63  Bscript::BObject call_object( unsigned PC, Bscript::BObjectImp* p0, Bscript::BObjectImp* p1,
64  Bscript::BObjectImp* p2 );
65 
66  void SaveStack( Bscript::BackupStruct& backup );
67  void LoadStack( Bscript::BackupStruct& backup );
68 
69  size_t estimateSize() const;
70  friend class SystemHook;
71 
72 private:
75 };
76 }
77 }
78 
79 #endif
std::string name
Definition: osmod.cpp:943
ExportedFunction * FindExportedFunction(Clib::ConfigElem &elem, const Plib::Package *pkg, const std::string &descriptor, unsigned nargs, bool complain_if_missing)
Definition: syshook.cpp:344
std::vector< ref_ptr< BObjectImp > > BObjectImpRefVec
Definition: bobject.h:409
Definition: berror.cpp:12