Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
wolf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
mobile_robotics
wolf_projects
wolf_lib
wolf
Commits
b78922c3
Commit
b78922c3
authored
3 years ago
by
Mederic Fourmy
Browse files
Options
Downloads
Plain Diff
[skip-ci] Merge branch 'devel' into 451-refactoring-wolf-installation-system
parents
1df8ee07
768795c7
No related branches found
No related tags found
2 merge requests
!451
After cmake and const refactor
,
!445
Resolve "Refactoring WOLF installation system"
Pipeline
#10656
skipped
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/core/common/factory.h
+25
-2
25 additions, 2 deletions
include/core/common/factory.h
with
25 additions
and
2 deletions
include/core/common/factory.h
+
25
−
2
View file @
b78922c3
...
...
@@ -307,6 +307,8 @@ class Factory
static
bool
unregisterCreator
(
const
std
::
string
&
_type
);
static
TypeBasePtr
create
(
const
std
::
string
&
_type
,
TypeInput
...
_input
);
std
::
string
getClass
()
const
;
static
void
printAddress
();
static
void
printCallbacks
();
private:
CallbackMap
callbacks_
;
...
...
@@ -321,9 +323,15 @@ class Factory
void
operator
=
(
Factory
const
&
)
=
delete
;
private:
Factory
()
{
}
~
Factory
()
{
}
~
Factory
()
;
};
template
<
class
TypeBase
,
typename
...
TypeInput
>
inline
Factory
<
TypeBase
,
TypeInput
...
>::~
Factory
<
TypeBase
,
TypeInput
...
>
()
{
std
::
cout
<<
" Factory destructor "
<<
this
->
getClass
()
<<
std
::
endl
;
}
template
<
class
TypeBase
,
typename
...
TypeInput
>
inline
bool
Factory
<
TypeBase
,
TypeInput
...
>::
registerCreator
(
const
std
::
string
&
_type
,
CreatorCallback
createFn
)
{
...
...
@@ -358,7 +366,7 @@ inline typename Factory<TypeBase, TypeInput...>::TypeBasePtr Factory<TypeBase, T
template
<
class
TypeBase
,
typename
...
TypeInput
>
inline
Factory
<
TypeBase
,
TypeInput
...
>&
Factory
<
TypeBase
,
TypeInput
...
>::
get
()
{
static
Factory
instance_
;
static
Factory
<
TypeBase
,
TypeInput
...
>
instance_
;
return
instance_
;
}
...
...
@@ -368,6 +376,21 @@ inline std::string Factory<TypeBase, TypeInput...>::getClass() const
return
"Factory<class TypeBase>"
;
}
template
<
class
TypeBase
,
typename
...
TypeInput
>
inline
void
Factory
<
TypeBase
,
TypeInput
...
>::
printAddress
()
{
std
::
cout
<<
get
().
getClass
()
<<
" address: "
<<
&
get
()
<<
std
::
endl
;
}
template
<
class
TypeBase
,
typename
...
TypeInput
>
inline
void
Factory
<
TypeBase
,
TypeInput
...
>::
printCallbacks
()
{
std
::
cout
<<
get
().
getClass
()
<<
" callbacks size: "
<<
get
().
callbacks_
.
size
()
<<
std
::
endl
;
for
(
auto
cb
:
get
().
callbacks_
){
std
::
cout
<<
"
\t
"
<<
cb
.
first
<<
std
::
endl
;
}
}
}
// namespace wolf
namespace
wolf
...
...
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