μHAL (v2.7.9)
Part of the IPbus software repository
Public Member Functions | List of all members
uhal::RegistrationHelper< T > Struct Template Reference

Experimental!! Helper struct for adding the DerivedNode to the Node Factory Declaring an instance of an object at global scope means that it is created before the main code is entered We can use this to our advantage by using the constructor of this object to add entries to the factory in a distributed fashion (for instance, in the file where the derived node is defined), rather than manually having to add entries in one file To make things even simpler, the REGISTER macro expands the template argument to a string and passes it to the constructor. More...

#include <uhal/DerivedNode.hpp>

Public Member Functions

 RegistrationHelper (const std::string &aDerivedClassName)
 Constructor. More...
 

Detailed Description

template<typename T>
struct uhal::RegistrationHelper< T >

Experimental!! Helper struct for adding the DerivedNode to the Node Factory Declaring an instance of an object at global scope means that it is created before the main code is entered We can use this to our advantage by using the constructor of this object to add entries to the factory in a distributed fashion (for instance, in the file where the derived node is defined), rather than manually having to add entries in one file To make things even simpler, the REGISTER macro expands the template argument to a string and passes it to the constructor.

Helper class to add Nodes derived from DerivedNode to the class factory.

Definition at line 82 of file DerivedNode.hpp.

Constructor & Destructor Documentation

◆ RegistrationHelper()

template<typename T >
uhal::RegistrationHelper< T >::RegistrationHelper ( const std::string &  aDerivedClassName)

Constructor.

Parameters
aDerivedClassNameThe name that will be used to identify this class in the factory

Definition at line 38 of file DerivedNode.hxx.

References uhal::DerivedNodeFactory::add(), and uhal::DerivedNodeFactory::getInstance().


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