Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Skyward Boardcore
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
Model registry
Analyze
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
Avionics
Software Development
Skyward Boardcore
Wiki
Singleton
Changes
Page history
New page
Templates
Clone repository
Style fixes and added WIP pages
authored
4 years ago
by
Luca Conterio
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Singleton.md
+2
-2
2 additions, 2 deletions
Singleton.md
with
2 additions
and
2 deletions
Singleton.md
View page @
c15f5246
...
...
@@ -4,7 +4,7 @@ A singleton is a class that can be **instantiated only once**: this can be very
In boardcore, you can achieve this by extending the Singleton template which you can find in
`src/shared/`
.
##
# Interface
##
Methods
The Singleton interface is a template class which exposes a single method:
```
cpp
inline
static
T
*
getInstance
()
...
...
@@ -17,7 +17,7 @@ What this method does is:
-
If an instance of this class already exists, return that instance.
-
If an instance of this class does not exist yet, create and return a new one.
##
#
Example
## Example
From the
`Singleton.h`
comment:
```
cpp
...
...
This diff is collapsed.
Click to expand it.