MotionLib  1.0.0
SamBuCa motion library
Public Member Functions | Protected Attributes | List of all members
smc::MotionController Class Reference

main entry-point More...

#include <MotionController.hpp>

Collaboration diagram for smc::MotionController:
Collaboration graph
[legend]

Public Member Functions

 MotionController ()
 Construct a new MotionController object.
 
std::size_t load (const std::string &config)
 Construct platforms and devices based on given configuration string. More...
 
std::size_t getDeviceCount () const
 Get the number of registered devices. More...
 
DeviceBase::Shared getDevice (const DeviceId &address)
 get a generic device according to its address More...
 
template<typename T >
std::shared_ptr< T > getDevice (const DeviceId &address)
 Get the device object pointer. More...
 
std::set< DeviceId > getDeviceList () const
 retrieve complete list of devices
 
std::set< DeviceId > getDeviceList (DeviceType type) const
 retrieve complete list of devices of a given type More...
 
std::set< std::string > getAliasList () const
 Get current Alias list.
 
DeviceId getAlias (const std::string &alias) const
 Get the given alias. More...
 
bool addAlias (const std::string &alias, const DeviceId &deviceId, bool override=true)
 add an alias More...
 
void removeAlias (const std::string &alias)
 remove an alias
 
std::shared_ptr< internal::PlatformFactorygetPlatformFactory () const
 for internal use and debugging purpose
 
std::shared_ptr< internal::DeviceStoregetDeviceStore () const
 for internal use and debugging purpose
 

Protected Attributes

std::shared_ptr< internal::PlatformFactorym_platformFactory
 
std::shared_ptr< internal::DeviceStorem_deviceStore
 
std::shared_ptr< internal::NotificationWorkerm_notificationWorker
 

Detailed Description

main entry-point

Definition at line 62 of file MotionController.hpp.

Member Function Documentation

◆ addAlias()

bool smc::MotionController::addAlias ( const std::string &  alias,
const DeviceId &  deviceId,
bool  override = true 
)

add an alias

Parameters
[in]aliasthe alias name
[in]deviceIddeviceId to alias
Returns
true if the alias was created
false if alias already exist (and override=false)

Definition at line 125 of file MotionController.cpp.

◆ getAlias()

DeviceId smc::MotionController::getAlias ( const std::string &  alias) const

Get the given alias.

Returns
an empty string if the alias doesn't exist

Definition at line 120 of file MotionController.cpp.

◆ getDevice() [1/2]

DeviceBase::Shared smc::MotionController::getDevice ( const DeviceId &  address)

get a generic device according to its address

Parameters
addressAddress of the device to get
Returns
shared_ptr<T> Pointer to requested device

Definition at line 95 of file MotionController.cpp.

Here is the caller graph for this function:

◆ getDevice() [2/2]

template<typename T >
std::shared_ptr< T > smc::MotionController::getDevice ( const DeviceId &  address)

Get the device object pointer.

Parameters
addressAddress of the device to get
Returns
shared_ptr<T> Pointer to requested device

Definition at line 35 of file MotionController.hxx.

Here is the call graph for this function:

◆ getDeviceCount()

size_t smc::MotionController::getDeviceCount ( ) const

Get the number of registered devices.

Returns
const size_t Number of devices

Definition at line 100 of file MotionController.cpp.

◆ getDeviceList()

std::set< std::string > smc::MotionController::getDeviceList ( DeviceType  type) const

retrieve complete list of devices of a given type

Parameters
type
Returns
std::set<DeviceId>

Definition at line 110 of file MotionController.cpp.

◆ load()

size_t smc::MotionController::load ( const std::string &  config)

Construct platforms and devices based on given configuration string.

Parameters
configConfiguration string (YAML)
Returns
int32_t Number of devices configured

Definition at line 65 of file MotionController.cpp.


The documentation for this class was generated from the following files: