Skip to content
Snippets Groups Projects

DRAFT: ENH: Include libcaosdb and a minimal wrapper

Closed Florian Spreckelsen requested to merge f-cxx-include into dev
1 unresolved thread
Files
2
+ 20
2
@@ -29,6 +29,15 @@
#include "caosdb/constants.h"
#include "caosdb/exceptions.h"
namespace jlcxx
{
template<>
struct SuperType<caosdb::authentication::PlainPasswordAuthenticator>
{
typedef caosdb::authentication::Authenticator type;
};
}
JLCXX_MODULE define_julia_module(jlcxx::Module& mod)
{
// Version info of libcaosdb against which this is built.
@@ -37,10 +46,19 @@ JLCXX_MODULE define_julia_module(jlcxx::Module& mod)
mod.method("get_libcaosdb_version_patch", []() {return caosdb::LIBCAOSDB_VERSION_PATCH;});
// exceptions inherit from abstract Julia exception types:
mod.add_type<caosdb::exceptions::AuthenticationError>("AuthenticationError", jlcxx::julia_type("AbstractAuthenticationError"))
mod.add_type<caosdb::exceptions::AuthenticationError>("AuthenticationError",
jlcxx::julia_type("AbstractAuthenticationError"))
.constructor<const std::string&>()
.method("what", &caosdb::exceptions::AuthenticationError::what);
mod.add_type<caosdb::exceptions::ConnectionError>("ConnectionError", jlcxx::julia_type("AbstractConnectionError"))
mod.add_type<caosdb::exceptions::ConnectionError>("ConnectionError",
jlcxx::julia_type("AbstractConnectionError"))
.constructor<const std::string&>()
.method("what", &caosdb::exceptions::ConnectionError::what);
// authenticators
mod.add_type<caosdb::authentication::Authenticator>("CaosDBAuthenticator");
mod.add_type<caosdb::authentication::PlainPasswordAuthenticator>("PlainPasswordAuthenticator",
jlcxx::julia_base_type<caosdb::authentication::Authenticator>())
.constructor<const std::string&, const std::string&>()
.method("getCallCredentials", &caosdb::authentication::PlainPasswordAuthenticator::getCallCredentials);
}
Loading