μHAL (v2.7.9)
Part of the IPbus software repository
Classes | Namespaces | Macros
DerivedNode.hpp File Reference
#include <boost/static_assert.hpp>
#include "uhal/Node.hpp"
#include "uhal/TemplateDefinitions/DerivedNode.hxx"
Include dependency graph for DerivedNode.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

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. More...
 

Namespaces

 uhal
 

Macros

#define UHAL_REGISTER_DERIVED_NODE(classname)
 Macro which adds a Derived Node Class to the factory It takes a classname and then creates a registration helper object, with the classname as its template parameter and a stringified version of the classname as its constructor argument. More...
 
#define UHAL_DERIVEDNODE(DerivedType)
 Macro which adds the clone method implementation for derived classesk. More...
 

Detailed Description

Author
Andrew W. Rose
Date
2012

Definition in file DerivedNode.hpp.

Macro Definition Documentation

◆ UHAL_DERIVEDNODE

#define UHAL_DERIVEDNODE (   DerivedType)
Value:
private: \
BOOST_STATIC_ASSERT(( boost::is_base_of<Node, uhal::Node>::value )); \
protected: \
virtual uhal::Node* clone() const;

Macro which adds the clone method implementation for derived classesk.

Definition at line 65 of file DerivedNode.hpp.

◆ UHAL_REGISTER_DERIVED_NODE

#define UHAL_REGISTER_DERIVED_NODE (   classname)
Value:
uhal::RegistrationHelper< classname > classname##RegistrationHelper( #classname ); \
uhal::Node* classname::clone() const \
{ \
return new classname ( static_cast<const classname&> ( *this ) ); \
}

Macro which adds a Derived Node Class to the factory It takes a classname and then creates a registration helper object, with the classname as its template parameter and a stringified version of the classname as its constructor argument.

Definition at line 54 of file DerivedNode.hpp.

uhal::RegistrationHelper
Experimental!! Helper struct for adding the DerivedNode to the Node Factory Declaring an instance of ...
Definition: DerivedNode.hpp:83
uhal::Node
A heirarchical node for navigating heirarchical firmwares.
Definition: Node.hpp:86