Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
ECSS Services
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
AcubeSat-OBC
ECSS Services
Commits
a66cfe89
Commit
a66cfe89
authored
6 years ago
by
kongr45gpen
Browse files
Options
Downloads
Patches
Plain Diff
Create a ServicePool that contains all Service instances
parent
d8c60bdd
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+1
-0
1 addition, 0 deletions
CMakeLists.txt
inc/ServicePool.hpp
+49
-0
49 additions, 0 deletions
inc/ServicePool.hpp
src/ServicePool.cpp
+14
-0
14 additions, 0 deletions
src/ServicePool.cpp
with
64 additions
and
0 deletions
CMakeLists.txt
+
1
−
0
View file @
a66cfe89
...
@@ -18,6 +18,7 @@ add_library(common OBJECT
...
@@ -18,6 +18,7 @@ add_library(common OBJECT
src/ErrorHandler.cpp
src/ErrorHandler.cpp
src/Message.cpp
src/Message.cpp
src/MessageParser.cpp
src/MessageParser.cpp
src/ServicePool.cpp
src/Helpers/CRCHelper.cpp
src/Helpers/CRCHelper.cpp
src/Helpers/TimeHelper.cpp
src/Helpers/TimeHelper.cpp
src/Services/EventReportService.cpp
src/Services/EventReportService.cpp
...
...
This diff is collapsed.
Click to expand it.
inc/ServicePool.hpp
0 → 100644
+
49
−
0
View file @
a66cfe89
#ifndef ECSS_SERVICES_SERVICEPOOL_HPP
#define ECSS_SERVICES_SERVICEPOOL_HPP
#include
"Services/RequestVerificationService.hpp"
#include
"Services/TimeManagementService.hpp"
#include
"Services/EventReportService.hpp"
#include
"Services/EventActionService.hpp"
#include
"Services/ParameterService.hpp"
#include
"Services/TestService.hpp"
#include
"Services/MemoryManagementService.hpp"
/**
* Defines a class that contains instances of all Services.
*
* All Services should be stored here and should not be instantiated in a different way.
*
* @todo Find a way to disable services which are not used
*/
class
ServicePool
{
public:
RequestVerificationService
requestVerification
;
EventReportService
eventReport
;
MemoryManagementService
memoryManagement
;
TimeManagementService
timeManagement
;
EventActionService
eventAction
;
TestService
testService
;
ParameterService
parameterManagement
;
/**
* The default ServicePool constructor
*/
ServicePool
()
=
default
;
/**
* Reset all the services and their contents/properties to the original values
*
* @note This performs the reset in-place, i.e. no new memory is allocated. As such, all
* Services already stored as values will point to the "new" Services after a reset.
*/
void
reset
();
};
/**
* A global variable that defines the basic pool where services can be fetched from
*/
extern
ServicePool
Services
;
#endif //ECSS_SERVICES_SERVICEPOOL_HPP
This diff is collapsed.
Click to expand it.
src/ServicePool.cpp
0 → 100644
+
14
−
0
View file @
a66cfe89
#include
"ServicePool.hpp"
ServicePool
Services
=
ServicePool
();
void
ServicePool
::
reset
()
{
// Call the destructor
this
->~
ServicePool
();
// Call the constructor
// Note the usage of "placement new" that replaces the contents of the Services variable.
// This is not dangerous usage, since all the memory that will be used for this has been
// statically allocated from before.
new
(
this
)
ServicePool
();
}
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