Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-julialib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-julialib
Commits
ea88efc2
Commit
ea88efc2
authored
3 years ago
by
florian
Browse files
Options
Downloads
Patches
Plain Diff
WIP: Remove code unnecessary for the bug report
parent
1d0944e3
No related branches found
No related tags found
No related merge requests found
Pipeline
#10106
failed
3 years ago
Stage: code-style
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
jlcaosdb/jlcaosdb.cxx
+1
-32
1 addition, 32 deletions
jlcaosdb/jlcaosdb.cxx
src/CaosDB.jl
+0
-25
0 additions, 25 deletions
src/CaosDB.jl
with
1 addition
and
57 deletions
jlcaosdb/jlcaosdb.cxx
+
1
−
32
View file @
ea88efc2
...
...
@@ -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"
);
}
This diff is collapsed.
Click to expand it.
src/CaosDB.jl
+
0
−
25
View file @
ea88efc2
...
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment