ReFRACtor
lua_callback.h
Go to the documentation of this file.
1 #ifndef LUA_CALLBACK_H
2 #define LUA_CALLBACK_H
3 #include "printable.h"
4 #include "lua_state.h"
5 
6 namespace FullPhysics {
7 /****************************************************************/
11 class LuaCallback : public Printable<LuaCallback> {
12 public:
13  LuaCallback(const LuaState& Ls) : ls(new LuaState(Ls)) {}
14  virtual ~LuaCallback() {}
15  virtual void print(std::ostream& Os) const { Os << "LuaCallback"; }
26  const boost::shared_ptr<LuabindObject>& Obj10) = 0;
27  luabind::object __call(const luabind::object& obj1,
28  const luabind::object& obj2,
29  const luabind::object& obj3,
30  const luabind::object& obj4,
31  const luabind::object& obj5,
32  const luabind::object& obj6,
33  const luabind::object& obj7,
34  const luabind::object& obj8,
35  const luabind::object& obj9,
36  const luabind::object& obj10)
37  { boost::shared_ptr<LuabindObject> lobj1(new LuabindObject(obj1, ls));
46  boost::shared_ptr<LuabindObject> lobj10(new LuabindObject(obj10, ls));
47  return call(lobj1, lobj2, lobj3, lobj4, lobj5, lobj6,
48  lobj7, lobj8, lobj9, lobj10)->object();
49  }
50  luabind::object __call(const luabind::object& obj1,
51  const luabind::object& obj2,
52  const luabind::object& obj3,
53  const luabind::object& obj4,
54  const luabind::object& obj5,
55  const luabind::object& obj6,
56  const luabind::object& obj7,
57  const luabind::object& obj8,
58  const luabind::object& obj9)
59  { boost::shared_ptr<LuabindObject> lobj1(new LuabindObject(obj1, ls));
68  boost::shared_ptr<LuabindObject> nil(new LuabindObject(luabind::object(), ls));
69  return call(lobj1, lobj2, lobj3, lobj4, lobj5, lobj6,
70  lobj7, lobj8, lobj9, nil)->object();
71  }
72  luabind::object __call(const luabind::object& obj1,
73  const luabind::object& obj2,
74  const luabind::object& obj3,
75  const luabind::object& obj4,
76  const luabind::object& obj5,
77  const luabind::object& obj6,
78  const luabind::object& obj7,
79  const luabind::object& obj8)
80  { boost::shared_ptr<LuabindObject> lobj1(new LuabindObject(obj1, ls));
88  boost::shared_ptr<LuabindObject> nil(new LuabindObject(luabind::object(), ls));
89  return call(lobj1, lobj2, lobj3, lobj4, lobj5, lobj6,
90  lobj7, lobj8, nil, nil)->object();
91  }
92  luabind::object __call(const luabind::object& obj1,
93  const luabind::object& obj2,
94  const luabind::object& obj3,
95  const luabind::object& obj4,
96  const luabind::object& obj5,
97  const luabind::object& obj6,
98  const luabind::object& obj7
99  )
100  { boost::shared_ptr<LuabindObject> lobj1(new LuabindObject(obj1, ls));
101  boost::shared_ptr<LuabindObject> lobj2(new LuabindObject(obj2, ls));
102  boost::shared_ptr<LuabindObject> lobj3(new LuabindObject(obj3, ls));
103  boost::shared_ptr<LuabindObject> lobj4(new LuabindObject(obj4, ls));
104  boost::shared_ptr<LuabindObject> lobj5(new LuabindObject(obj5, ls));
105  boost::shared_ptr<LuabindObject> lobj6(new LuabindObject(obj6, ls));
106  boost::shared_ptr<LuabindObject> lobj7(new LuabindObject(obj7, ls));
107  boost::shared_ptr<LuabindObject> nil(new LuabindObject(luabind::object(), ls));
108  return call(lobj1, lobj2, lobj3, lobj4, lobj5, lobj6,
109  lobj7, nil, nil, nil)->object();
110  }
111  luabind::object __call(const luabind::object& obj1,
112  const luabind::object& obj2,
113  const luabind::object& obj3,
114  const luabind::object& obj4,
115  const luabind::object& obj5,
116  const luabind::object& obj6
117  )
118  { boost::shared_ptr<LuabindObject> lobj1(new LuabindObject(obj1, ls));
119  boost::shared_ptr<LuabindObject> lobj2(new LuabindObject(obj2, ls));
120  boost::shared_ptr<LuabindObject> lobj3(new LuabindObject(obj3, ls));
121  boost::shared_ptr<LuabindObject> lobj4(new LuabindObject(obj4, ls));
122  boost::shared_ptr<LuabindObject> lobj5(new LuabindObject(obj5, ls));
123  boost::shared_ptr<LuabindObject> lobj6(new LuabindObject(obj6, ls));
124  boost::shared_ptr<LuabindObject> nil(new LuabindObject(luabind::object(), ls));
125  return call(lobj1, lobj2, lobj3, lobj4, lobj5, lobj6,
126  nil, nil, nil, nil)->object();
127  }
128  luabind::object __call(const luabind::object& obj1,
129  const luabind::object& obj2,
130  const luabind::object& obj3,
131  const luabind::object& obj4,
132  const luabind::object& obj5
133  )
134  { boost::shared_ptr<LuabindObject> lobj1(new LuabindObject(obj1, ls));
135  boost::shared_ptr<LuabindObject> lobj2(new LuabindObject(obj2, ls));
136  boost::shared_ptr<LuabindObject> lobj3(new LuabindObject(obj3, ls));
137  boost::shared_ptr<LuabindObject> lobj4(new LuabindObject(obj4, ls));
138  boost::shared_ptr<LuabindObject> lobj5(new LuabindObject(obj5, ls));
139  boost::shared_ptr<LuabindObject> nil(new LuabindObject(luabind::object(), ls));
140  return call(lobj1, lobj2, lobj3, lobj4, lobj5, nil,
141  nil, nil, nil, nil)->object();
142  }
143  luabind::object __call(const luabind::object& obj1,
144  const luabind::object& obj2,
145  const luabind::object& obj3,
146  const luabind::object& obj4
147  )
148  { boost::shared_ptr<LuabindObject> lobj1(new LuabindObject(obj1, ls));
149  boost::shared_ptr<LuabindObject> lobj2(new LuabindObject(obj2, ls));
150  boost::shared_ptr<LuabindObject> lobj3(new LuabindObject(obj3, ls));
151  boost::shared_ptr<LuabindObject> lobj4(new LuabindObject(obj4, ls));
152  boost::shared_ptr<LuabindObject> nil(new LuabindObject(luabind::object(), ls));
153  return call(lobj1, lobj2, lobj3, lobj4, nil, nil,
154  nil, nil, nil, nil)->object();
155  }
156  luabind::object __call(const luabind::object& obj1,
157  const luabind::object& obj2,
158  const luabind::object& obj3
159  )
160  { boost::shared_ptr<LuabindObject> lobj1(new LuabindObject(obj1, ls));
161  boost::shared_ptr<LuabindObject> lobj2(new LuabindObject(obj2, ls));
162  boost::shared_ptr<LuabindObject> lobj3(new LuabindObject(obj3, ls));
163  boost::shared_ptr<LuabindObject> nil(new LuabindObject(luabind::object(), ls));
164  return call(lobj1, lobj2, lobj3, nil, nil, nil,
165  nil, nil, nil, nil)->object();
166  }
167  luabind::object __call(const luabind::object& obj1,
168  const luabind::object& obj2
169  )
170  { boost::shared_ptr<LuabindObject> lobj1(new LuabindObject(obj1, ls));
171  boost::shared_ptr<LuabindObject> lobj2(new LuabindObject(obj2, ls));
172  boost::shared_ptr<LuabindObject> nil(new LuabindObject(luabind::object(), ls));
173  return call(lobj1, lobj2, nil, nil, nil, nil,
174  nil, nil, nil, nil)->object();
175  }
176  luabind::object __call(const luabind::object& obj1
177  )
178  { boost::shared_ptr<LuabindObject> lobj1(new LuabindObject(obj1, ls));
179  boost::shared_ptr<LuabindObject> nil(new LuabindObject(luabind::object(), ls));
180  return call(lobj1, nil, nil, nil, nil, nil,
181  nil, nil, nil, nil)->object();
182  }
183  luabind::object __call()
184  {
185  boost::shared_ptr<LuabindObject> nil(new LuabindObject(luabind::object(), ls));
186  return call(nil, nil, nil, nil, nil, nil,
187  nil, nil, nil, nil)->object();
188  }
189 private:
191 };
192 
193 }
194 #endif
195 
luabind::object __call(const luabind::object &obj1, const luabind::object &obj2)
Definition: lua_callback.h:167
LuaCallback(const LuaState &Ls)
Definition: lua_callback.h:13
luabind::object __call(const luabind::object &obj1, const luabind::object &obj2, const luabind::object &obj3, const luabind::object &obj4, const luabind::object &obj5, const luabind::object &obj6, const luabind::object &obj7, const luabind::object &obj8)
Definition: lua_callback.h:72
virtual boost::shared_ptr< LuabindObject > call(const boost::shared_ptr< LuabindObject > &Obj1, const boost::shared_ptr< LuabindObject > &Obj2, const boost::shared_ptr< LuabindObject > &Obj3, const boost::shared_ptr< LuabindObject > &Obj4, const boost::shared_ptr< LuabindObject > &Obj5, const boost::shared_ptr< LuabindObject > &Obj6, const boost::shared_ptr< LuabindObject > &Obj7, const boost::shared_ptr< LuabindObject > &Obj8, const boost::shared_ptr< LuabindObject > &Obj9, const boost::shared_ptr< LuabindObject > &Obj10)=0
luabind::object __call(const luabind::object &obj1, const luabind::object &obj2, const luabind::object &obj3, const luabind::object &obj4)
Definition: lua_callback.h:143
luabind::object __call(const luabind::object &obj1, const luabind::object &obj2, const luabind::object &obj3, const luabind::object &obj4, const luabind::object &obj5)
Definition: lua_callback.h:128
luabind::object __call(const luabind::object &obj1, const luabind::object &obj2, const luabind::object &obj3, const luabind::object &obj4, const luabind::object &obj5, const luabind::object &obj6, const luabind::object &obj7, const luabind::object &obj8, const luabind::object &obj9, const luabind::object &obj10)
Definition: lua_callback.h:27
luabind::object __call()
Definition: lua_callback.h:183
luabind::object __call(const luabind::object &obj1, const luabind::object &obj2, const luabind::object &obj3, const luabind::object &obj4, const luabind::object &obj5, const luabind::object &obj6, const luabind::object &obj7, const luabind::object &obj8, const luabind::object &obj9)
Definition: lua_callback.h:50
luabind::object __call(const luabind::object &obj1, const luabind::object &obj2, const luabind::object &obj3, const luabind::object &obj4, const luabind::object &obj5, const luabind::object &obj6, const luabind::object &obj7)
Definition: lua_callback.h:92
This is a light wrapper around the luabind::object.
This is a Mixin for classes that can be printed.
Definition: printable.h:24
virtual void print(std::ostream &Os) const
Definition: lua_callback.h:15
This is a simple object to call a callback that can be used in Lua.
Definition: lua_callback.h:11
luabind::object __call(const luabind::object &obj1)
Definition: lua_callback.h:176
luabind::object __call(const luabind::object &obj1, const luabind::object &obj2, const luabind::object &obj3, const luabind::object &obj4, const luabind::object &obj5, const luabind::object &obj6)
Definition: lua_callback.h:111
Contains classes to abstract away details in various Spurr Radiative Transfer software.
Definition: doxygen_python.h:1
This is a light wrapper around the lua_state object.
Definition: lua_state.h:25
luabind::object __call(const luabind::object &obj1, const luabind::object &obj2, const luabind::object &obj3)
Definition: lua_callback.h:156

Copyright © 2017, California Institute of Technology.
ALL RIGHTS RESERVED.
U.S. Government Sponsorship acknowledged.
Generated Fri Aug 24 2018 15:44:10