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
b36d0b53
Commit
b36d0b53
authored
3 years ago
by
Alexander Kreft
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Helper functions for entity-properties
parent
0b343f96
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!11
F get value
Pipeline
#13161
passed
3 years ago
Stage: info
Stage: code-style
Stage: setup
Stage: test
Stage: deploy
Pipeline: CaosDB Julia Integration Tests
#13162
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Entity.jl
+105
-1
105 additions, 1 deletion
src/Entity.jl
with
105 additions
and
1 deletion
src/Entity.jl
+
105
−
1
View file @
b36d0b53
...
...
@@ -863,13 +863,35 @@ function get_property_list_length(property::Ref{_Property})
return
length
[]
end
"""
function get_property_list_length(entity::Ref{_Entity})
Return the length of the list of the given `entity`
"""
function
get_property_list_length
(
entity
::
Ref
{
_Entity
})
length
=
Ref
{
Cint
}(
0
)
err_code
=
ccall
(
(
:
caosdb_entity_property_get_value_list_length
,
CaosDB
.
library_name
),
Cint
,
(
Ref
{
_Entity
},
Ref
{
Cint
}),
entity
,
length
,
)
CaosDB
.
Exceptions
.
evaluate_return_code
(
err_code
)
return
length
[]
end
"""
function get_int_list_value_at(property::Ref{_Property}, index::Cint)
Return the value of the INTEGER list of the given `property` at the position `index`.
"""
function
get_int_list_value_at
(
property
::
Ref
{
_Property
},
index
::
Cint
)
out
=
Ref
{
Cint
}(
0
)
err_code
=
ccall
(
(
:
caosdb_entity_property_get_int_list_value_at
,
CaosDB
.
library_name
),
Cint
,
...
...
@@ -883,6 +905,26 @@ function get_int_list_value_at(property::Ref{_Property}, index::Cint)
return
out
[]
end
"""
function get_int_list_value_at(entity::Ref{_Entity}, index::Cint)
Return the value of the INTEGER list of the given `entity` at the position `index`.
"""
function
get_int_list_value_at
(
entity
::
Ref
{
_Entity
},
index
::
Cint
)
out
=
Ref
{
Cint
}(
0
)
err_code
=
ccall
(
(
:
caosdb_entity_entity_get_int_list_value_at
,
CaosDB
.
library_name
),
Cint
,
(
Ref
{
_Entity
},
Ref
{
Cint
},
Cint
),
entity
,
out
,
index
-
Cint
(
1
),
)
CaosDB
.
Exceptions
.
evaluate_return_code
(
err_code
)
return
out
[]
end
"""
function get_double_list_value_at(property::Ref{_Property}, index::Cint)
...
...
@@ -903,6 +945,26 @@ function get_double_list_value_at(property::Ref{_Property}, index::Cint)
return
out
[]
end
"""
function get_double_list_value_at(entity::Ref{_Entity}, index::Cint)
Return the value of the DOUBLE list of the given `entity` at the position `index`.
"""
function
get_double_list_value_at
(
entity
::
Ref
{
_Entity
},
index
::
Cint
)
out
=
Ref
{
Cdouble
}(
0
)
err_code
=
ccall
(
(
:
caosdb_entity_entity_get_double_list_value_at
,
CaosDB
.
library_name
),
Cint
,
(
Ref
{
_Entity
},
Ref
{
Cdouble
},
Cint
),
entity
,
out
,
index
-
Cint
(
1
),
)
CaosDB
.
Exceptions
.
evaluate_return_code
(
err_code
)
return
out
[]
end
"""
function get_bool_list_value_at(property::Ref{_Property}, index::Cint)
...
...
@@ -924,6 +986,27 @@ function get_bool_list_value_at(property::Ref{_Property}, index::Cint)
return
out
end
"""
function get_bool_list_value_at(entity::Ref{_Entity}, index::Cint)
Return the value of the BOOLEAN list of the given `entity` at the position `index`.
"""
function
get_bool_list_value_at
(
entity
::
Ref
{
_Entity
},
index
::
Cint
)
out
=
Ref
{
Cint
}(
0
)
err_code
=
ccall
(
(
:
caosdb_entity_entity_get_boolean_list_value_at
,
CaosDB
.
library_name
),
Cint
,
(
Ref
{
_Entity
},
Ref
{
Cint
},
Cint
),
entity
,
out
,
index
-
Cint
(
1
),
)
CaosDB
.
Exceptions
.
evaluate_return_code
(
err_code
)
out
=
convert
(
Bool
,
out
[])
return
out
end
"""
function get_string_list_value_at(property::Ref{_Property}, index::Cint)
...
...
@@ -945,6 +1028,27 @@ function get_string_list_value_at(property::Ref{_Property}, index::Cint)
return
out
end
"""
function get_string_list_value_at(entity::Ref{_Entity}, index::Cint)
Return the value of the TEXT list of the given `entity` at the position `index`.
"""
function
get_string_list_value_at
(
entity
::
Ref
{
_Entity
},
index
::
Cint
)
out
=
Ref
{
Ptr
{
UInt8
}}(
Ptr
{
UInt8
}())
err_code
=
ccall
(
(
:
caosdb_entity_entity_get_string_list_value_at
,
CaosDB
.
library_name
),
Cint
,
(
Ref
{
_Entity
},
Ref
{
Ptr
{
UInt8
}},
Cint
),
entity
,
out
,
index
-
Cint
(
1
),
)
CaosDB
.
Exceptions
.
evaluate_return_code
(
err_code
)
out
=
unsafe_string
(
out
[])
return
out
end
"""
function get_version_id(entity::Ref{_Entity})
...
...
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