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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-cpplib
Commits
705e09d0
Commit
705e09d0
authored
3 years ago
by
florian
Browse files
Options
Downloads
Patches
Plain Diff
DRAFT: Disable messages for properties and parents for now
parent
f6af9e0e
No related branches found
No related tags found
1 merge request
!4
ENH: Allow insertion and deletion of single entities
Pipeline
#11185
passed
3 years ago
Stage: info
Stage: setup
Stage: test
Stage: deploy
Pipeline: caosdb-cppinttest
#11186
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/caosdb/entity.h
+41
-36
41 additions, 36 deletions
include/caosdb/entity.h
src/caosdb/entity.cpp
+5
-3
5 additions, 3 deletions
src/caosdb/entity.cpp
with
46 additions
and
39 deletions
include/caosdb/entity.h
+
41
−
36
View file @
705e09d0
...
@@ -54,8 +54,10 @@ public:
...
@@ -54,8 +54,10 @@ public:
}
}
friend
class
Entity
;
friend
class
Entity
;
friend
class
Parent
;
// TODO(fspreck) Re-enable once we have decided how messages are
friend
class
Property
;
// appended to parents and properties
// friend class Parent;
// friend class Property;
friend
class
Messages
;
friend
class
Messages
;
private
:
private
:
...
@@ -76,8 +78,9 @@ public:
...
@@ -76,8 +78,9 @@ public:
}
}
friend
class
Entity
;
friend
class
Entity
;
friend
class
Parent
;
// TODO(fspreck) Same here.
friend
class
Property
;
// friend class Parent;
// friend class Property;
private
:
private
:
inline
Messages
()
:
wrapped
(
nullptr
){};
inline
Messages
()
:
wrapped
(
nullptr
){};
...
@@ -138,32 +141,32 @@ public:
...
@@ -138,32 +141,32 @@ public:
return
out
;
return
out
;
}
}
// TODO(fspreck)
These need implementations. See Entity::GetErrors for
// TODO(fspreck)
Finish the following implementations once we have
//
inspiration
.
//
decided how to attach messages to parents
.
/**
//
/**
* Return the error messages of this parent.
//
* Return the error messages of this parent.
*/
//
*/
[[
nodiscard
]]
inline
auto
GetErrors
()
const
->
const
Messages
&
{
//
[[nodiscard]] inline auto GetErrors() const -> const Messages & {
return
errors
;
//
return errors;
}
//
}
[[
nodiscard
]]
inline
auto
HasErrors
()
const
->
bool
{
//
[[nodiscard]] inline auto HasErrors() const -> bool {
return
this
->
errors
.
wrapped
->
size
()
>
0
;
//
return this->errors.wrapped->size() > 0;
}
//
}
/**
//
/**
* Return the warning messages of this parent.
//
* Return the warning messages of this parent.
*/
//
*/
[[
nodiscard
]]
inline
auto
GetWarnings
()
const
->
const
Messages
&
{
//
[[nodiscard]] inline auto GetWarnings() const -> const Messages & {
return
warnings
;
//
return warnings;
}
//
}
[[
nodiscard
]]
inline
auto
HasWarnings
()
const
->
bool
{
//
[[nodiscard]] inline auto HasWarnings() const -> bool {
return
this
->
warnings
.
wrapped
->
size
()
>
0
;
//
return this->warnings.wrapped->size() > 0;
}
//
}
/**
//
/**
* Return the info messages of this parent.
//
* Return the info messages of this parent.
*/
//
*/
[[
nodiscard
]]
inline
auto
GetInfos
()
const
->
const
Messages
&
{
//
[[nodiscard]] inline auto GetInfos() const -> const Messages & {
return
infos
;
//
return infos;
}
//
}
friend
class
Entity
;
friend
class
Entity
;
friend
class
Parents
;
friend
class
Parents
;
...
@@ -185,9 +188,9 @@ private:
...
@@ -185,9 +188,9 @@ private:
* Message which serves as storage backend.
* Message which serves as storage backend.
*/
*/
mutable
caosdb
::
entity
::
v1alpha1
::
Parent
*
wrapped
;
mutable
caosdb
::
entity
::
v1alpha1
::
Parent
*
wrapped
;
Messages
errors
;
//
Messages errors;
Messages
warnings
;
//
Messages warnings;
Messages
infos
;
//
Messages infos;
};
};
/**
/**
...
@@ -252,9 +255,11 @@ public:
...
@@ -252,9 +255,11 @@ public:
[[
nodiscard
]]
auto
GetValue
()
const
->
const
std
::
string
&
;
[[
nodiscard
]]
auto
GetValue
()
const
->
const
std
::
string
&
;
[[
nodiscard
]]
auto
GetUnit
()
const
->
const
std
::
string
&
;
[[
nodiscard
]]
auto
GetUnit
()
const
->
const
std
::
string
&
;
[[
nodiscard
]]
auto
GetDatatype
()
const
->
const
std
::
string
&
;
[[
nodiscard
]]
auto
GetDatatype
()
const
->
const
std
::
string
&
;
[[
nodiscard
]]
auto
GetErrors
()
const
->
const
Messages
&
;
// TODO(fspreck) Implement these when we have decided how to attach
[[
nodiscard
]]
auto
GetWarnings
()
const
->
const
Messages
&
;
// messages to properties.
[[
nodiscard
]]
auto
GetInfos
()
const
->
const
Messages
&
;
// [[nodiscard]] auto GetErrors() const -> const Messages &;
// [[nodiscard]] auto GetWarnings() const -> const Messages &;
// [[nodiscard]] auto GetInfos() const -> const Messages &;
auto
SetId
(
const
std
::
string
&
id
)
->
void
;
auto
SetId
(
const
std
::
string
&
id
)
->
void
;
auto
SetName
(
const
std
::
string
&
name
)
->
void
;
auto
SetName
(
const
std
::
string
&
name
)
->
void
;
...
...
This diff is collapsed.
Click to expand it.
src/caosdb/entity.cpp
+
5
−
3
View file @
705e09d0
...
@@ -29,9 +29,11 @@ using ProtoEntity = caosdb::entity::v1alpha1::Entity;
...
@@ -29,9 +29,11 @@ using ProtoEntity = caosdb::entity::v1alpha1::Entity;
using
caosdb
::
utility
::
get_arena
;
using
caosdb
::
utility
::
get_arena
;
Parent
::
Parent
()
:
wrapped
(
Parent
::
CreateProtoParent
())
{
Parent
::
Parent
()
:
wrapped
(
Parent
::
CreateProtoParent
())
{
errors
.
wrapped
=
this
->
wrapped
->
mutable_errors
();
// TODO(fspreck) Re-enable once we have decided how to attach
warnings
.
wrapped
=
this
->
wrapped
->
mutable_warnings
();
// messages to parents.
infos
.
wrapped
=
this
->
wrapped
->
mutable_infos
();
// errors.wrapped = this->wrapped->mutable_errors();
// warnings.wrapped = this->wrapped->mutable_warnings();
// infos.wrapped = this->wrapped->mutable_infos();
}
}
auto
Parent
::
CreateProtoParent
()
->
ProtoParent
*
{
auto
Parent
::
CreateProtoParent
()
->
ProtoParent
*
{
...
...
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