LocalCreatorPolicy Struct Reference
LocalCreatorPolicy is a policy template for the compile time selection utility IF_CONTAINS_TYPE_(NAME). More...
#include <LocalCreatorPolicy.h>
Static Public Member Functions | |
template<typename T , typename SubType , typename R > | |
static R | process () |
The method is provided for calling within the context of a selector template. As the name of the policy class describes it creates a local object that is also destructed if the method is left. |
Detailed Description
LocalCreatorPolicy is a policy template for the compile time selection utility IF_CONTAINS_TYPE_(NAME).
It is intended for the use within the then clause, because it creates a local object of the requested type. A local object is construced and when the scope of the function is left then the object is destructed. This creator can be used for e.g. device drivers initialisation or things that have to be done only once. However, it should be noted, that the destructor may not set back all things.
Member Function Documentation
static R LocalCreatorPolicy::process | ( | ) | [inline, static] |
The method is provided for calling within the context of a selector template. As the name of the policy class describes it creates a local object that is also destructed if the method is left.
- Template Parameters:
-
T is a type normally a configuration type/class SubType is a type and you can instantiate an object of it. If the policy is used in the context of IF_CONTAINS_TYPE_(NAME) it is guaranteed, that SubType is the requested type. R is the return value of the static process method and its default is void
References famouso::mw::nl::CAN::detail::__attribute__().
The documentation for this struct was generated from the following file:
- include/config/policies/LocalCreatorPolicy.h