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
e0826e1b
Commit
e0826e1b
authored
3 years ago
by
florian
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Add destructors
parent
b5209375
No related branches found
No related tags found
2 merge requests
!3
TST: Add CI infrastructure for integration testing
,
!2
ENH: Add minimal wrapping of libcaosdb's C interface
Pipeline
#10281
passed
3 years ago
Stage: code-style
Stage: setup
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/CaosDB.jl
+62
-4
62 additions, 4 deletions
src/CaosDB.jl
with
62 additions
and
4 deletions
src/CaosDB.jl
+
62
−
4
View file @
e0826e1b
...
@@ -75,7 +75,23 @@ Struct containing a pointer to the wrapped cpp authenticator class.
...
@@ -75,7 +75,23 @@ Struct containing a pointer to the wrapped cpp authenticator class.
mutable struct
Authenticator
mutable struct
Authenticator
wrapped_authenticator
::
Ptr
{
Cvoid
}
wrapped_authenticator
::
Ptr
{
Cvoid
}
Authenticator
()
=
new
()
function
Authenticator
()
auth
=
new
()
# force this to point to C_NULL after initialization
auth
.
wrapped_authenticator
=
C_NULL
function
f
(
t
)
if
t
.
wrapped_authenticator
!=
C_NULL
# Only if pointer was filled after real initialization
ccall
(
(
:
caosdb_authentication_delete_authenticator
,
"libccaosdb"
),
Cint
,
(
Ref
{
Authenticator
},),
Ref
{
Authenticator
}(
t
),
)
end
end
finalizer
(
f
,
auth
)
end
end
end
function
create_plain_password_authenticator
(
function
create_plain_password_authenticator
(
...
@@ -116,7 +132,21 @@ Struct containing the actual connection to a CaosDB server.
...
@@ -116,7 +132,21 @@ Struct containing the actual connection to a CaosDB server.
mutable struct
CaosDBConnection
mutable struct
CaosDBConnection
wrapped_connection
::
Ptr
{
Cvoid
}
wrapped_connection
::
Ptr
{
Cvoid
}
CaosDBConnection
()
=
new
()
function
CaosDBConnection
()
conn
=
new
()
conn
.
wrapped_connection
=
C_NULL
function
f
(
t
)
if
t
.
wrapped_connection
!=
C_NULL
ccall
(
(
:
caosdb_connection_delete_connection
,
"libccaosdb"
),
Cint
,
(
Ref
{
CaosDBConnection
},),
Ref
{
CaosDBConnection
}(
t
),
)
end
end
finalizer
(
f
,
conn
)
end
end
end
"""
"""
...
@@ -126,7 +156,21 @@ certificate provider.
...
@@ -126,7 +156,21 @@ certificate provider.
mutable struct
CertificateProvider
mutable struct
CertificateProvider
wrapped_certificate_provider
::
Ptr
{
Cvoid
}
wrapped_certificate_provider
::
Ptr
{
Cvoid
}
CertificateProvider
()
=
new
()
function
CertificateProvider
()
prov
=
new
()
prov
.
wrapped_certificate_provider
=
C_NULL
function
f
(
t
)
if
t
.
wrapped_certificate_provider
!=
C_NULL
ccall
(
(
:
caosdb_connection_delete_certificate_provider
,
"libccaosdb"
),
Cint
,
(
Ref
{
CertificateProvider
},),
Ref
{
CertificateProvider
}(
t
),
)
end
end
finalizer
(
f
,
prov
)
end
end
end
"""
"""
...
@@ -136,7 +180,21 @@ connection configuration.
...
@@ -136,7 +180,21 @@ connection configuration.
mutable struct
Configuration
mutable struct
Configuration
wrapped_connection_configuration
::
Ptr
{
Cvoid
}
wrapped_connection_configuration
::
Ptr
{
Cvoid
}
Configuration
()
=
new
()
function
Configuration
()
config
=
new
()
config
.
wrapped_connection_configuration
=
C_NULL
function
f
(
t
)
if
t
.
wrapped_connection_configuration
!=
C_NULL
ccall
(
(
:
caosdb_connection_delete_connection_configuration
,
"libcaosdb"
),
Cint
,
(
Ref
{
Configuration
},),
Ref
{
Configuration
}(
t
),
)
end
end
finalizer
(
f
,
config
)
end
end
end
"""
"""
...
...
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