diff options
author | pixel <pixel> | 2008-03-17 17:18:30 +0000 |
---|---|---|
committer | pixel <pixel> | 2008-03-17 17:18:30 +0000 |
commit | 6b637fa40e97409d70d28aef19d42e093700f5a7 (patch) | |
tree | b6303fc707058792b7f4eefde813abe2d20f473d /include | |
parent | 0be6869498b4fda7ddf1b419b2a7086c1e30bc4f (diff) |
Adding first version of the Lua <--> OCCI bindings.
Diffstat (limited to 'include')
-rw-r--r-- | include/LuaOCCI.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/include/LuaOCCI.h b/include/LuaOCCI.h new file mode 100644 index 0000000..683d60e --- /dev/null +++ b/include/LuaOCCI.h @@ -0,0 +1,43 @@ +#ifndef __LUAOCCI_H__ +#define __LUAOCCI_H__ + +#include <occi.h> + +#include <Exceptions.h> +#include <BLua.h> + +#define DECLARE_OCCI_ENCAP(clname) \ +class EncapOCCI_##clname : public Base { \ + public: \ + EncapOCCI_##clname(oracle::occi::clname * _o) : o(_o) { } \ + ~EncapOCCI_##clname() { } \ + oracle::occi::clname * Get() { return o; } \ + private: \ + oracle::occi::clname * o; \ +}; \ +\ +class LuaOCCI_##clname : public LuaObject { \ + public: \ + static void pushstatics(Lua *) throw (GeneralException); \ + LuaOCCI_##clname(EncapOCCI_##clname * _o) : o(_o) { } \ + ~LuaOCCI_##clname() { } \ + private: \ + virtual void pushmembers(Lua *); \ + EncapOCCI_##clname * o; \ +}; + +DECLARE_OCCI_ENCAP(Environment); +DECLARE_OCCI_ENCAP(Connection); +DECLARE_OCCI_ENCAP(Statement); +DECLARE_OCCI_ENCAP(ResultSet); +DECLARE_OCCI_ENCAP(Stream); + +#define LuaOCCI_pushstatics(L) {\ + LuaOCCI_Environment::pushstatics(L);\ + LuaOCCI_Connection::pushstatics(L);\ + LuaOCCI_Statement::pushstatics(L);\ + LuaOCCI_ResultSet::pushstatics(L);\ + LuaOCCI_Stream::pushstatics(L);\ +} + +#endif |