Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-cpplib
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-cpplib
Commits
ed3d916a
Verified
Commit
ed3d916a
authored
3 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
WIP: Value, DataType, Importance
parent
0f96286c
No related branches found
No related tags found
1 merge request
!12
F consolidation
Pipeline
#11834
failed
3 years ago
Stage: info
Stage: setup
Stage: test
Stage: deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/caosdb/entity.h
+15
-3
15 additions, 3 deletions
include/caosdb/entity.h
proto
+1
-1
1 addition, 1 deletion
proto
src/caosdb/entity.cpp
+7
-6
7 additions, 6 deletions
src/caosdb/entity.cpp
with
23 additions
and
10 deletions
include/caosdb/entity.h
+
15
−
3
View file @
ed3d916a
...
...
@@ -40,6 +40,18 @@ using ProtoParent = caosdb::entity::v1alpha1::Parent;
using
ProtoProperty
=
caosdb
::
entity
::
v1alpha1
::
Property
;
using
ProtoEntity
=
caosdb
::
entity
::
v1alpha1
::
Entity
;
using
ProtoMessage
=
caosdb
::
entity
::
v1alpha1
::
Message
;
using
caosdb
::
entity
::
v1alpha1
::
EntityRole
;
/**
* The entity role.
*/
enum
Role
{
NONE
=
EntityRole
::
ENTITY_ROLE_UNSPECIFIED
,
///< Unset/None
RECORD_TYPE
=
EntityRole
::
ENTITY_ROLE_RECORD_TYPE
,
///< RecordType
RECORD
=
EntityRole
::
ENTITY_ROLE_RECORD
,
///< Record
PROPERTY
=
EntityRole
::
ENTITY_ROLE_PROPERTY
,
///< Property
FILE
=
EntityRole
::
ENTITY_ROLE_FILE
,
///< File
};
/**
* Messages convey information about the state and result of transactions.
...
...
@@ -374,7 +386,7 @@ public:
inline
Entity
(
const
Entity
&
original
)
:
Entity
(
CreateProtoEntity
())
{
this
->
wrapped
->
CopyFrom
(
*
original
.
wrapped
);
};
explicit
Entity
(
IdResponse
*
id
R
esponse
);
explicit
Entity
(
IdResponse
*
id
_r
esponse
);
explicit
inline
Entity
(
ProtoEntity
*
wrapped
)
:
wrapped
(
wrapped
)
{
errors
.
wrapped
=
this
->
wrapped
->
mutable_errors
();
warnings
.
wrapped
=
this
->
wrapped
->
mutable_warnings
();
...
...
@@ -393,7 +405,7 @@ public:
return
wrapped
->
version
().
id
();
};
[[
nodiscard
]]
inline
auto
GetRole
()
const
->
const
std
::
string
&
{
[[
nodiscard
]]
inline
auto
GetRole
()
const
->
Role
&
{
return
wrapped
->
role
();
};
[[
nodiscard
]]
inline
auto
GetName
()
const
->
const
std
::
string
&
{
...
...
@@ -437,7 +449,7 @@ public:
return
out
;
}
auto
SetRole
(
const
std
::
string
&
role
)
->
void
;
auto
SetRole
(
Role
role
)
->
void
;
auto
SetName
(
const
std
::
string
&
name
)
->
void
;
/**
* Set the description of this entity.
...
...
This diff is collapsed.
Click to expand it.
proto
@
4ce7460f
Compare
36d7956b
...
4ce7460f
Subproject commit
36d7956b6eca506fb87096d8d50b6f4b820778b8
Subproject commit
4ce7460ff869422c419623c8d0cee0459ce6d6dc
This diff is collapsed.
Click to expand it.
src/caosdb/entity.cpp
+
7
−
6
View file @
ed3d916a
...
...
@@ -171,12 +171,13 @@ Entity::Entity() : wrapped(Entity::CreateProtoEntity()) {
infos
.
wrapped
=
this
->
wrapped
->
mutable_infos
();
}
Entity
::
Entity
(
IdResponse
*
idResponse
)
:
Entity
()
{
this
->
wrapped
->
set_id
(
idResponse
->
id
());
this
->
wrapped
->
mutable_errors
()
->
Swap
(
idResponse
->
mutable_entity_errors
());
Entity
::
Entity
(
IdResponse
*
id_response
)
:
Entity
()
{
this
->
wrapped
->
set_id
(
id_response
->
id
());
this
->
wrapped
->
mutable_version
()
->
Swap
(
id_response
->
mutable_version
());
this
->
wrapped
->
mutable_errors
()
->
Swap
(
id_response
->
mutable_entity_errors
());
this
->
wrapped
->
mutable_warnings
()
->
Swap
(
id
R
esponse
->
mutable_entity_warnings
());
this
->
wrapped
->
mutable_infos
()
->
Swap
(
id
R
esponse
->
mutable_entity_infos
());
id
_r
esponse
->
mutable_entity_warnings
());
this
->
wrapped
->
mutable_infos
()
->
Swap
(
id
_r
esponse
->
mutable_entity_infos
());
}
auto
Entity
::
SetId
(
const
std
::
string
&
id
)
->
void
{
this
->
wrapped
->
set_id
(
id
);
}
...
...
@@ -189,7 +190,7 @@ auto Entity::CopyTo(ProtoEntity *target) -> void {
target
->
CopyFrom
(
*
(
this
->
wrapped
));
}
auto
Entity
::
SetRole
(
const
std
::
string
&
role
)
->
void
{
auto
Entity
::
SetRole
(
Role
role
)
->
void
{
this
->
wrapped
->
set_role
(
role
);
}
...
...
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