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
ab7187c2
Commit
ab7187c2
authored
1 year ago
by
Olivier BICHLER
Browse files
Options
Downloads
Patches
Plain Diff
Added some doc
parent
3fff049f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!16
Unified interface for attributes
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/aidge/utils/Attributes.hpp
+16
-0
16 additions, 0 deletions
include/aidge/utils/Attributes.hpp
include/aidge/utils/StaticAttributes.hpp
+5
-0
5 additions, 0 deletions
include/aidge/utils/StaticAttributes.hpp
with
21 additions
and
0 deletions
include/aidge/utils/Attributes.hpp
+
16
−
0
View file @
ab7187c2
...
@@ -42,8 +42,24 @@ constexpr std::size_t size(T (&)[N]) { return N; }
...
@@ -42,8 +42,24 @@ constexpr std::size_t size(T (&)[N]) { return N; }
*/
*/
class
Attributes
{
class
Attributes
{
public:
public:
/**
* @brief Check if the attribute exists.
* @param name Name of the attribute to check.
* @return bool True if the attribute exists, false otherwise.
*/
virtual
bool
hasAttr
(
const
std
::
string
&
name
)
const
=
0
;
virtual
bool
hasAttr
(
const
std
::
string
&
name
)
const
=
0
;
/**
* @brief Get the (implementation defined) name of the type of an attribute, returned by std::type_info::name.
* @param name Name of the attribute.
* @return std::string Name of the type as returned by std::type_info::name.
*/
virtual
std
::
string
getAttrType
(
const
std
::
string
&
name
)
const
=
0
;
virtual
std
::
string
getAttrType
(
const
std
::
string
&
name
)
const
=
0
;
/**
* @brief Get the attribute's name list.
* @return std::vector<std::string> Vector of names of the attributes.
*/
virtual
std
::
vector
<
std
::
string
>
getAttrsName
()
const
=
0
;
virtual
std
::
vector
<
std
::
string
>
getAttrsName
()
const
=
0
;
#ifdef PYBIND
#ifdef PYBIND
...
...
This diff is collapsed.
Click to expand it.
include/aidge/utils/StaticAttributes.hpp
+
5
−
0
View file @
ab7187c2
...
@@ -19,6 +19,11 @@
...
@@ -19,6 +19,11 @@
#include
"aidge/utils/Attributes.hpp"
#include
"aidge/utils/Attributes.hpp"
namespace
Aidge
{
namespace
Aidge
{
/**
* @brief This class is designed to handle static attributes (i.e. known at compile-time)
* with named accessors, with minimal overhead (the name strings are not stored in each object
* instance and it remains possible to access attribute without overhead at compile-time).
*/
template
<
class
ATTRS_ENUM
,
class
...
T
>
template
<
class
ATTRS_ENUM
,
class
...
T
>
class
StaticAttributes
:
public
Attributes
{
class
StaticAttributes
:
public
Attributes
{
public:
public:
...
...
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