YARP
Yet Another Robot Platform
yarp::dev::DriverCreatorOf< T > Class Template Reference

A factory for creating driver objects of a particular type. More...

#include <yarp/dev/Drivers.h>

+ Inheritance diagram for yarp::dev::DriverCreatorOf< T >:

Public Member Functions

 DriverCreatorOf (const char *name, const char *wrap, const char *code)
 Constructor. More...
 
std::string toString () const override
 Returns a simple description of devices the factory can make. More...
 
std::string getName () const override
 Get the common name of the device. More...
 
std::string getWrapper () const override
 Get the common name of a device that can wrap this one. More...
 
std::string getCode () const override
 Get the name of the C++ class associated with this device. More...
 
DeviceDrivercreate () const override
 Create a device. More...
 
- Public Member Functions inherited from yarp::dev::DriverCreator
virtual ~DriverCreator ()
 Destructor. More...
 
virtual PolyDriverowner ()
 For "links" to other devices. More...
 

Detailed Description

template<class T>
class yarp::dev::DriverCreatorOf< T >

A factory for creating driver objects of a particular type.

Examples
dev/fake_motor/fake_motor.cpp, and dev/file_grabber/file_grabber.cpp.

Definition at line 82 of file Drivers.h.

Constructor & Destructor Documentation

◆ DriverCreatorOf()

template<class T >
yarp::dev::DriverCreatorOf< T >::DriverCreatorOf ( const char *  name,
const char *  wrap,
const char *  code 
)
inline

Constructor.

Sets up the name by which the device will be known.

Parameters
nameThe "common name" of the device. This is the name that will be used when naming the device externally, for example from the command line.
wrapThe "common name" of another device which can wrap this device up for network access. If there is no such device, use an empty name: ""
codeThe name of a class associated with this device. This is to give the user an entry point into the relevant code documentation.

Definition at line 99 of file Drivers.h.

Member Function Documentation

◆ create()

template<class T >
DeviceDriver* yarp::dev::DriverCreatorOf< T >::create ( ) const
inlineoverridevirtual

Create a device.

Implements yarp::dev::DriverCreator.

Definition at line 120 of file Drivers.h.

◆ getCode()

template<class T >
std::string yarp::dev::DriverCreatorOf< T >::getCode ( ) const
inlineoverridevirtual

Get the name of the C++ class associated with this device.

Returns
the name of the C++ class associated with this device.

Implements yarp::dev::DriverCreator.

Definition at line 116 of file Drivers.h.

◆ getName()

template<class T >
std::string yarp::dev::DriverCreatorOf< T >::getName ( ) const
inlineoverridevirtual

Get the common name of the device.

Returns
the common name of the device this creates.

Implements yarp::dev::DriverCreator.

Definition at line 108 of file Drivers.h.

◆ getWrapper()

template<class T >
std::string yarp::dev::DriverCreatorOf< T >::getWrapper ( ) const
inlineoverridevirtual

Get the common name of a device that can wrap this one.

Returns
the common name of the device that can wrap this one for the network.

Implements yarp::dev::DriverCreator.

Definition at line 112 of file Drivers.h.

◆ toString()

template<class T >
std::string yarp::dev::DriverCreatorOf< T >::toString ( ) const
inlineoverridevirtual

Returns a simple description of devices the factory can make.

Returns
a description of what this factory makes

Implements yarp::dev::DriverCreator.

Definition at line 104 of file Drivers.h.


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