Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F28203128
SystemImpl.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
SystemImpl.h
View Options
/*******************************************************************************
*
* File: SystemImpl.h
*
* Contents: Declaration of a basic implementation of the System interface.
*
* Copyright 2017
*
* Author: David Juhasz (david.juhasz@tuwien.ac.at)
*
******************************************************************************/
#ifndef ROSA_LIB_CORE_SYSTEMIMPL_H
#define ROSA_LIB_CORE_SYSTEMIMPL_H
#include
"rosa/core/System.h"
#include
<mutex>
#include
<unordered_set>
namespace
rosa
{
class
SystemImpl
:
public
System
{
public
:
SystemImpl
(
const
std
::
string
&
Name
)
noexcept
;
~
SystemImpl
(
void
);
private
:
// Container for keeping reference of registered Units.
std
::
unordered_set
<
Unit
*>
Units
;
// Used to provide mutual exclusion when modifying Units.
std
::
mutex
RegisterMutex
;
protected
:
// Registers the given Unit instance to the System.
// PRE: !isUnitRegistered(U)
// POST: isUnitRegistered(U)
void
registerUnit
(
Unit
&
U
)
noexcept
override
;
// Unregisters and destroys the given Unit.
// PRE: isUnitRegistered(U)
// POST: !isUnitRegistered(U) && 'U is destroyed'
void
destroyUnit
(
Unit
&
U
)
noexcept
override
;
// Returns if the given Unit is registered in the System.
bool
isUnitRegistered
(
const
Unit
&
U
)
const
noexcept
override
;
public
:
// Returns the number of live Units, that have been constructed and not
// destroyed yet.
size_t
numberOfLiveUnits
(
void
)
const
noexcept
override
;
// Returns if the System has no live Units.
bool
empty
(
void
)
const
noexcept
override
;
};
}
// End namespace rosa
#endif
// ROSA_LIB_CORE_SYSTEMIMPL_H
File Metadata
Details
Attached
Mime Type
text/x-c++
Expires
Fri, Nov 20, 9:52 PM (1 d, 7 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
420174
Default Alt Text
SystemImpl.h (1 KB)
Attached To
Mode
R20 SoC_Rosa_repo
Attached
Detach File
Event Timeline