stmm-games-doc  0.32.0
Public Member Functions | Protected Member Functions | List of all members
stmi::ParentDeviceManager Class Reference

Device manager container class. More...

Inheritance diagram for stmi::ParentDeviceManager:
Inheritance graph
[legend]

Public Member Functions

shared_ptr< DevicegetDevice (int32_t nDeviceId) const noexcept override
 Return the device with the given id. More...
 
shared_ptr< CapabilitygetCapability (const Capability::Class &oClass) const noexcept override
 Get a device manager capability of a certain class. More...
 
shared_ptr< CapabilitygetCapability (int32_t nCapabilityId) const noexcept override
 Get a device manager capability by id. More...
 
std::vector< Capability::ClassgetCapabilityClasses () const noexcept override
 The union of the device manager capability classes of all the children. More...
 
std::vector< Capability::ClassgetDeviceCapabilityClasses () const noexcept override
 The union of the device capability classes of all the children's devices. More...
 
std::vector< Event::ClassgetEventClasses () const noexcept override
 The union of the event types of all the children. More...
 
std::vector< int32_t > getDevicesWithCapabilityClass (const Capability::Class &oCapabilityClass) const noexcept override
 The union of the devices of all the children with a given capability class. More...
 
std::vector< int32_t > getDevices () const noexcept override
 The union of the devices of all the children. More...
 
bool isEventClassEnabled (const Event::Class &oEventClass) const noexcept override
 Tells whether an event class is enabled in at least one of the children. More...
 
void enableEventClass (const Event::Class &oEventClass) noexcept override
 Calls the function for all the children. More...
 
bool addAccessor (const shared_ptr< Accessor > &refAccessor) noexcept override
 Calls addAccessor() of children. More...
 
bool removeAccessor (const shared_ptr< Accessor > &refAccessor) noexcept override
 Calls removeAccessor() of children. More...
 
bool hasAccessor (const shared_ptr< Accessor > &refAccessor) noexcept override
 Tells whether an accessor is at least in one of the children. More...
 
bool addEventListener (const shared_ptr< EventListener > &refEventListener, const shared_ptr< CallIf > &refCallIf) noexcept override
 Calls addEventListener of children. More...
 
bool addEventListener (const shared_ptr< EventListener > &refEventListener) noexcept override
 Calls addEventListener of children. More...
 
bool removeEventListener (const shared_ptr< EventListener > &refEventListener, bool bFinalize) noexcept override
 Calls removeEventListener of children. More...
 
bool removeEventListener (const shared_ptr< EventListener > &refEventListener) noexcept override
 Calls removeEventListener of children. More...
 
std::vector< shared_ptr< ChildDeviceManager > > getChildren () const noexcept
 The child device managers. More...
 
virtual std::vector< shared_ptr< Capability > > getDeviceManagerCapabilities (const Capability::Class &oClass) const noexcept
 Get the device manager capabilities of a given class of all the children. More...
 
- Public Member Functions inherited from stmi::ChildDeviceManager
shared_ptr< ParentDeviceManagergetParent () const noexcept
 Gets the parent of this child device manager. More...
 
shared_ptr< ParentDeviceManagergetParent () noexcept
 Gets the parent of this child device manager. More...
 
shared_ptr< ParentDeviceManagergetRoot () const noexcept
 Returns the root device manager. More...
 
shared_ptr< ParentDeviceManagergetRoot () noexcept
 Returns the root device manager. More...
 
bool isParent () const noexcept
 Tells whether this instance is also a ParentDeviceManager. More...
 
shared_ptr< ParentDeviceManagergetAsParent () const noexcept
 If a parent returns this object as a parent. More...
 
shared_ptr< ParentDeviceManagergetAsParent () noexcept
 If a parent returns this object as a parent. More...
 
- Public Member Functions inherited from stmi::DeviceManager
virtual ~DeviceManager () noexcept=default
 
template<typename TCapa >
bool getCapability (shared_ptr< TCapa > &refCapa) const noexcept
 Request a registered device manager capability. More...
 

Protected Member Functions

 ParentDeviceManager () noexcept
 
void init (const std::vector< shared_ptr< ChildDeviceManager > > &aChildDeviceManager) noexcept
 Initialization. More...
 
void removeChildren () noexcept
 Removes all children. More...
 
- Protected Member Functions inherited from stmi::ChildDeviceManager
 ChildDeviceManager () noexcept
 Constructor. More...
 
- Protected Member Functions inherited from stmi::DeviceManager
 DeviceManager () noexcept
 

Additional Inherited Members

- Static Public Member Functions inherited from stmi::DeviceManager
static int64_t getNowTimeMicroseconds () noexcept
 Current time from epoch in microseconds. More...
 

Detailed Description

Device manager container class.

The contained device managers (the children) must be subclasses of ChildDeviceManager.

Constructor & Destructor Documentation

◆ ParentDeviceManager()

stmi::ParentDeviceManager::ParentDeviceManager ( )
protectednoexcept

Member Function Documentation

◆ addAccessor()

bool stmi::ParentDeviceManager::addAccessor ( const shared_ptr< Accessor > &  refAccessor)
overridevirtualnoexcept

Calls addAccessor() of children.

Returns
true if at least one of the children returned true, false otherwise.

Implements stmi::DeviceManager.

◆ addEventListener() [1/2]

bool stmi::ParentDeviceManager::addEventListener ( const shared_ptr< EventListener > &  refEventListener,
const shared_ptr< CallIf > &  refCallIf 
)
overridevirtualnoexcept

Calls addEventListener of children.

Implements stmi::DeviceManager.

◆ addEventListener() [2/2]

bool stmi::ParentDeviceManager::addEventListener ( const shared_ptr< EventListener > &  refEventListener)
overridevirtualnoexcept

Calls addEventListener of children.

Implements stmi::DeviceManager.

◆ enableEventClass()

void stmi::ParentDeviceManager::enableEventClass ( const Event::Class oEventClass)
overridevirtualnoexcept

Calls the function for all the children.

Implements stmi::DeviceManager.

◆ getCapability() [1/2]

shared_ptr<Capability> stmi::ParentDeviceManager::getCapability ( const Capability::Class oClass) const
overridevirtualnoexcept

Get a device manager capability of a certain class.

Queries its children. The returned capability isn't necessarily the only one for the given class.

Parameters
oClassThe class. Must be valid.
Returns
The device manager capability or null if not found.

Implements stmi::DeviceManager.

◆ getCapability() [2/2]

shared_ptr<Capability> stmi::ParentDeviceManager::getCapability ( int32_t  nCapabilityId) const
overridevirtualnoexcept

Get a device manager capability by id.

Queries its children.

Parameters
nCapabilityIdThe id.
Returns
The device manager capability or null if not found.

Implements stmi::DeviceManager.

◆ getCapabilityClasses()

std::vector<Capability::Class> stmi::ParentDeviceManager::getCapabilityClasses ( ) const
overridevirtualnoexcept

The union of the device manager capability classes of all the children.

Implements stmi::DeviceManager.

◆ getChildren()

std::vector< shared_ptr<ChildDeviceManager> > stmi::ParentDeviceManager::getChildren ( ) const
inlinenoexcept

The child device managers.

Returns
The child device managers.

◆ getDevice()

shared_ptr<Device> stmi::ParentDeviceManager::getDevice ( int32_t  nDeviceId) const
overridevirtualnoexcept

Return the device with the given id.

Parameters
nDeviceIdThe device id.
Returns
The device or null if not found.

Implements stmi::DeviceManager.

◆ getDeviceCapabilityClasses()

std::vector<Capability::Class> stmi::ParentDeviceManager::getDeviceCapabilityClasses ( ) const
overridevirtualnoexcept

The union of the device capability classes of all the children's devices.

Implements stmi::DeviceManager.

◆ getDeviceManagerCapabilities()

virtual std::vector<shared_ptr<Capability> > stmi::ParentDeviceManager::getDeviceManagerCapabilities ( const Capability::Class oClass) const
virtualnoexcept

Get the device manager capabilities of a given class of all the children.

Parameters
oClassThe device manager capability class. Must be subclass of DeviceManagerCapability.
Returns
The available device manager capabilities.

◆ getDevices()

std::vector<int32_t> stmi::ParentDeviceManager::getDevices ( ) const
overridevirtualnoexcept

The union of the devices of all the children.

Implements stmi::DeviceManager.

◆ getDevicesWithCapabilityClass()

std::vector<int32_t> stmi::ParentDeviceManager::getDevicesWithCapabilityClass ( const Capability::Class oCapabilityClass) const
overridevirtualnoexcept

The union of the devices of all the children with a given capability class.

Implements stmi::DeviceManager.

◆ getEventClasses()

std::vector<Event::Class> stmi::ParentDeviceManager::getEventClasses ( ) const
overridevirtualnoexcept

The union of the event types of all the children.

Implements stmi::DeviceManager.

◆ hasAccessor()

bool stmi::ParentDeviceManager::hasAccessor ( const shared_ptr< Accessor > &  refAccessor)
overridevirtualnoexcept

Tells whether an accessor is at least in one of the children.

Implements stmi::DeviceManager.

◆ init()

void stmi::ParentDeviceManager::init ( const std::vector< shared_ptr< ChildDeviceManager > > &  aChildDeviceManager)
protectednoexcept

Initialization.

Cannot be called twice.

Parameters
aChildDeviceManagerThe child device managers. Cannot be empty.

◆ isEventClassEnabled()

bool stmi::ParentDeviceManager::isEventClassEnabled ( const Event::Class oEventClass) const
overridevirtualnoexcept

Tells whether an event class is enabled in at least one of the children.

Implements stmi::DeviceManager.

◆ removeAccessor()

bool stmi::ParentDeviceManager::removeAccessor ( const shared_ptr< Accessor > &  refAccessor)
overridevirtualnoexcept

Calls removeAccessor() of children.

Returns
true if at least one of the children returned true, false otherwise.

Implements stmi::DeviceManager.

◆ removeChildren()

void stmi::ParentDeviceManager::removeChildren ( )
inlineprotectednoexcept

Removes all children.

◆ removeEventListener() [1/2]

bool stmi::ParentDeviceManager::removeEventListener ( const shared_ptr< EventListener > &  refEventListener,
bool  bFinalize 
)
overridevirtualnoexcept

Calls removeEventListener of children.

Implements stmi::DeviceManager.

◆ removeEventListener() [2/2]

bool stmi::ParentDeviceManager::removeEventListener ( const shared_ptr< EventListener > &  refEventListener)
overridevirtualnoexcept

Calls removeEventListener of children.

Implements stmi::DeviceManager.