All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
MultiWidgets::FactoryT< T, Ptr > Class Template Reference

Base class for factory objects. More...

#include <MultiWidgets/Factory.hpp>

Inheritance diagram for MultiWidgets::FactoryT< T, Ptr >:
Patterns::NotCopyable

Public Types

typedef std::function< Ptr< T >)> CreateFunc
 

Public Member Functions

Ptr< T > create () const
 Creates a new instance of T as Ptr<T>
 
 FactoryT (const std::type_info &typeinfo, CreateFunc create)
 
QByteArray id () const
 Returns the unique identifier of the plugin.
 
QByteArray name () const
 Returns the human-readable name of the plugin.
 
QByteArray path () const
 Returns the path of the plugin library.
 
void setId (const QByteArray &id)
 Sets the unique identifier. More...
 
void setName (const QByteArray &name)
 Sets the name of the plugin. More...
 
void setPath (const QByteArray &path)
 Sets the path of the plugin library. More...
 
void setValue (const QByteArray &name, const QByteArray &value)
 Sets the value of a parameter. More...
 
QByteArray value (const QByteArray &name) const
 Returns the value of the given parameter. More...
 

Detailed Description

template<typename T, template< typename > class Ptr>
class MultiWidgets::FactoryT< T, Ptr >

Base class for factory objects.

This class is part of the plugin framework.

Member Function Documentation

template<typename T , template< typename > class Ptr>
void MultiWidgets::FactoryT< T, Ptr >::setId ( const QByteArray &  id)
inline

Sets the unique identifier.

Parameters
idunique id
template<typename T , template< typename > class Ptr>
void MultiWidgets::FactoryT< T, Ptr >::setName ( const QByteArray &  name)
inline

Sets the name of the plugin.

This is the name that is presented to the user.

Parameters
namename of the plugin
template<typename T , template< typename > class Ptr>
void MultiWidgets::FactoryT< T, Ptr >::setPath ( const QByteArray &  path)
inline

Sets the path of the plugin library.

Parameters
pathnew path
template<typename T , template< typename > class Ptr>
void MultiWidgets::FactoryT< T, Ptr >::setValue ( const QByteArray &  name,
const QByteArray &  value 
)
inline

Sets the value of a parameter.

All parameters are simply key/value pairs, where both key and value are strings.

Parameters
namename of the parameter
valuevalue of the parameter
template<typename T , template< typename > class Ptr>
QByteArray MultiWidgets::FactoryT< T, Ptr >::value ( const QByteArray &  name) const
inline

Returns the value of the given parameter.

Parameters
namename of the parameter
Returns
value of the parameter