Public Types | Public Member Functions | List of all members
WireCell::IComponent< Type > Class Template Reference

#include <IComponent.h>

Inheritance diagram for WireCell::IComponent< Type >:
WireCell::Interface

Public Types

typedef std::shared_ptr< Typepointer
 Access subclass facet by pointer. More...
 
typedef std::vector< pointervector
 Vector of shared pointers. More...
 
- Public Types inherited from WireCell::Interface
typedef std::shared_ptr< Interfacepointer
 

Public Member Functions

virtual ~IComponent ()
 
- Public Member Functions inherited from WireCell::Interface
virtual ~Interface ()
 

Detailed Description

template<class Type>
class WireCell::IComponent< Type >

A component calls out a particular interface as being identified as important to the system. Inheriting from IComponent follows the CRTP pattern:

class IMyComponent : public IComponent<IMyComponent> { public: void mymethod() = 0; };

class MyConcreteComponent : public IMyComponent { public: void mymethod(); };

IMyComponent::pointer mycomp(new MyConcreteComponent); mycomp->mymethod();

See WireCell::NamedFactory for one creation pattern that works with IComponents.

Definition at line 29 of file IComponent.h.

Member Typedef Documentation

template<class Type>
typedef std::shared_ptr<Type> WireCell::IComponent< Type >::pointer

Access subclass facet by pointer.

Definition at line 33 of file IComponent.h.

template<class Type>
typedef std::vector<pointer> WireCell::IComponent< Type >::vector

Vector of shared pointers.

Definition at line 36 of file IComponent.h.

Constructor & Destructor Documentation

template<class Type>
virtual WireCell::IComponent< Type >::~IComponent ( )
inlinevirtual

Definition at line 38 of file IComponent.h.

38 {};

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