Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Project Juggler
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
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
EIC
Project Juggler
Commits
0e11fb38
Commit
0e11fb38
authored
2 years ago
by
Sylvester Joosten
Browse files
Options
Downloads
Patches
Plain Diff
rename ServiceMixin --> Service as it's not really a Mixin like the others, more like a base
parent
cae79e27
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!464
Draft: working implemenation of Property
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/algorithms/logger.h
+1
-1
1 addition, 1 deletion
core/algorithms/logger.h
core/algorithms/service.h
+4
-4
4 additions, 4 deletions
core/algorithms/service.h
with
5 additions
and
5 deletions
core/algorithms/logger.h
+
1
−
1
View file @
0e11fb38
...
...
@@ -33,7 +33,7 @@ constexpr std::string_view logLevelName(LogLevel level) {
// Note: the log action is responsible for dealing with concurrent calls
// the default LogAction is a thread-safe example
class
LogSvc
:
public
Service
Mixin
<
LogSvc
>
{
class
LogSvc
:
public
Service
<
LogSvc
>
{
public:
using
LogAction
=
std
::
function
<
void
(
LogLevel
,
std
::
string_view
,
std
::
string_view
)
>
;
void
defaultLevel
(
const
LogLevel
l
)
{
m_level
.
set
(
l
);
}
...
...
This diff is collapsed.
Click to expand it.
core/algorithms/service.h
+
4
−
4
View file @
0e11fb38
...
...
@@ -11,9 +11,9 @@
// (mostly needed for the service base class)
#define ALGORITHMS_DEFINE_SERVICE(className) \
protected: \
className() : Service
Mixin
<className>(#className) {} \
className() : Service<className>(#className) {} \
public: \
friend class Service
Mixin
<className>; \
friend class Service<className>; \
className(const className&) = delete; \
void operator=(const className&) = delete;
...
...
@@ -60,7 +60,7 @@ class ServiceSvc {
// CRTP mixin to add the instance method
// This could have been part of DEFINE_SERVICE macro, but I think it is better
// to keep the macro magic to a minimum to maximize transparency
template
<
class
SvcType
>
class
Service
Mixin
:
public
PropertyMixin
{
template
<
class
SvcType
>
class
Service
:
public
PropertyMixin
{
public:
static
SvcType
&
instance
()
{
// This is guaranteed to be thread-safe from C++11 onwards.
...
...
@@ -69,7 +69,7 @@ template <class SvcType> class ServiceMixin : public PropertyMixin {
}
// constructor for the service mixin registers the service, except
// for the ServiceSvc which is its own thing (and that would be ciricular)
Service
Mixin
(
std
::
string_view
name
)
{
Service
(
std
::
string_view
name
)
{
ServiceSvc
::
instance
().
add
(
name
,
this
);
}
};
...
...
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