diff --git a/jlcaosdb/jlcaosdb.cxx b/jlcaosdb/jlcaosdb.cxx index 5fed1c2614657d10379299b248f2ce4f8a04bd6a..638ad863a2c1582f9c3a232d87f9436ab370a95e 100644 --- a/jlcaosdb/jlcaosdb.cxx +++ b/jlcaosdb/jlcaosdb.cxx @@ -25,40 +25,9 @@ #include <jlcxx/jlcxx.hpp> #include "caosdb/authentication.h" -#include "caosdb/connection.h" -#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. - mod.method("get_libcaosdb_version_major", []() {return caosdb::LIBCAOSDB_VERSION_MAJOR;}); - mod.method("get_libcaosdb_version_minor", []() {return caosdb::LIBCAOSDB_VERSION_MINOR;}); - 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")) - .constructor<const std::string&>() - .method("what", &caosdb::exceptions::AuthenticationError::what); - 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); + mod.add_type<caosdb::authentication::PlainPasswordAuthenticator>("PlainPasswordAuthenticator"); } diff --git a/src/CaosDB.jl b/src/CaosDB.jl index 17d475ae3ba3c920261da822a4960e7cf72eae98..7a5cb1f90cfdeea08166880087c0d20b19ff1655 100644 --- a/src/CaosDB.jl +++ b/src/CaosDB.jl @@ -5,14 +5,6 @@ module CaosDB using CxxWrap -"Generic super type of CaosDB exceptions" -abstract type AbstractCaosDBException <: Exception end - -"An error occurred while trying to authenticate" -abstract type AbstractAuthenticationError <: AbstractCaosDBException end - -"Connection couldn't be established" -abstract type AbstractConnectionError <: AbstractCaosDBException end # Adapt this path if you haven't compiled jlcaosdb to `caosdb-julialib/build` @wrapmodule(joinpath(@__DIR__, "../jlcaosdb/build/lib/libjlcaosdb")) @@ -21,22 +13,5 @@ function __init__() @initcxx end -""" - get_libcaosdb_version() - -Returns the version string of libcaosdb with which this package has -been built. -""" -function get_libcaosdb_version() - major = get_libcaosdb_version_major() - minor = get_libcaosdb_version_minor() - patch = get_libcaosdb_version_patch() - - return "$major.$minor.$patch" -end - -# Override the exception printing -Base.showerror(io::IO, e::AuthenticationError) = print(io, what(e)) -Base.showerror(io::IO, e::ConnectionError) = print(io, what(e)) end # module