Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
aidge_core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eclipse Projects
aidge
aidge_core
Commits
19cdd7c7
Commit
19cdd7c7
authored
10 months ago
by
Olivier BICHLER
Browse files
Options
Downloads
Patches
Plain Diff
Fixed assert and inline issue
parent
ff65e20b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!119
0.2.1
Pipeline
#44829
failed
10 months ago
Stage: static_analysis
Stage: build
Stage: test
Stage: coverage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/aidge/utils/DynamicAttributes.hpp
+5
-3
5 additions, 3 deletions
include/aidge/utils/DynamicAttributes.hpp
with
5 additions
and
3 deletions
include/aidge/utils/DynamicAttributes.hpp
+
5
−
3
View file @
19cdd7c7
...
@@ -86,7 +86,7 @@ public:
...
@@ -86,7 +86,7 @@ public:
template
<
class
T
>
void
addAttr
(
const
std
::
string
&
name
,
const
T
&
value
)
template
<
class
T
>
void
addAttr
(
const
std
::
string
&
name
,
const
T
&
value
)
{
{
const
auto
&
res
=
mAttrs
.
emplace
(
std
::
make_pair
(
name
,
future_std
::
any
(
value
)));
const
auto
&
res
=
mAttrs
.
emplace
(
std
::
make_pair
(
name
,
future_std
::
any
(
value
)));
assert
(
res
.
second
&&
"attribute already exists"
);
AIDGE_ASSERT
(
res
.
second
,
"attribute already exists"
);
#ifdef PYBIND
#ifdef PYBIND
// We cannot handle Python object if the Python interpreter is not running
// We cannot handle Python object if the Python interpreter is not running
...
@@ -129,10 +129,10 @@ public:
...
@@ -129,10 +129,10 @@ public:
void
addAttrPy
(
const
std
::
string
&
name
,
py
::
object
&&
value
)
void
addAttrPy
(
const
std
::
string
&
name
,
py
::
object
&&
value
)
{
{
auto
it
=
mAttrs
.
find
(
name
);
auto
it
=
mAttrs
.
find
(
name
);
assert
(
it
==
mAttrs
.
end
()
&&
"attribute already exists"
);
AIDGE_ASSERT
(
it
==
mAttrs
.
end
()
,
"attribute already exists"
);
const
auto
&
res
=
mAttrsPy
.
emplace
(
std
::
make_pair
(
name
,
value
));
const
auto
&
res
=
mAttrsPy
.
emplace
(
std
::
make_pair
(
name
,
value
));
assert
(
res
.
second
&&
"attribute already exists"
);
AIDGE_ASSERT
(
res
.
second
,
"attribute already exists"
);
}
}
void
setAttrPy
(
const
std
::
string
&
name
,
py
::
object
&&
value
)
override
final
void
setAttrPy
(
const
std
::
string
&
name
,
py
::
object
&&
value
)
override
final
...
@@ -199,6 +199,8 @@ public:
...
@@ -199,6 +199,8 @@ public:
};
};
#endif
#endif
virtual
~
DynamicAttributes
()
{}
private
:
private
:
#ifdef PYBIND
#ifdef PYBIND
// Stores C++ attributes (copy) and Python-only attributes
// Stores C++ attributes (copy) and Python-only attributes
...
...
This diff is collapsed.
Click to expand it.
Olivier BICHLER
@olivierbichler
mentioned in issue
#116 (closed)
·
10 months ago
mentioned in issue
#116 (closed)
mentioned in issue #116
Toggle commit list
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