The Sparta Modeling Framework
Loading...
Searching...
No Matches
sparta::ValidationCheckCallback< ValueType > Class Template Reference

Delegate for Parameter validation. More...

#include <Parameter.hpp>

Public Member Functions

 ValidationCheckCallback (bool(*method)(ValueType &, const sparta::TreeNode *), const std::string &name)
 Construct delegate with a class member pointer.
 
 ValidationCheckCallback ()
 Construct with no functionality.
 
 ValidationCheckCallback (const std::string &name)
 Construct with no functionality and a name.
 
 ValidationCheckCallback (const ValidationCheckCallback< ValueType > &rhp)
 Copy Constructor.
 
void operator= (const ValidationCheckCallback< ValueType > &rhp)
 
std::string getName () const
 
bool operator() (ValueType &val, const TreeNode *node) const
 Invoke callback to check given value at the indicated position in the device tree.
 

Static Public Member Functions

template<class T , bool(T::*)(ValueType &, const sparta::TreeNode *) TMethod>
static ValidationCheckCallback< ValueType > from_method (T *obj, const std::string &name)
 
static void validateName (const std::string &nm)
 

Detailed Description

template<class ValueType>
class sparta::ValidationCheckCallback< ValueType >

Delegate for Parameter validation.

Serves as a delegate to arbitrary class member, static member, or global method to perform tests on a given

Valid class member function and global/static functions must be of one of the forms:

  • bool T::TMethod(ValueType, const TreeNode*) // member function
  • bool method(ValueType) // static/global

Invoke the delegate using operator().

This class is copyable through construction, but not assignable.

Definition at line 988 of file Parameter.hpp.

Constructor & Destructor Documentation

◆ ValidationCheckCallback() [1/4]

template<class ValueType >
sparta::ValidationCheckCallback< ValueType >::ValidationCheckCallback ( bool(*)(ValueType &, const sparta::TreeNode *)  method,
const std::string &  name 
)
inline

Construct delegate with a class member pointer.

Template Parameters
Tclass type containing a member to which this delegate will point.
TMethodMember function of T which will be invoked by this delegate.
Parameters
objObject of templated class T on which this delegate will make its callback.
nameName of this validator. This should be an recognizable name in the context of a Parameter so that failure of this dependency are obvious. There are no name limitations except that it must not contain a comma. Construct with a static method or normal function pointer

Definition at line 1033 of file Parameter.hpp.

Here is the call graph for this function:

◆ ValidationCheckCallback() [2/4]

template<class ValueType >
sparta::ValidationCheckCallback< ValueType >::ValidationCheckCallback ( )
inline

Construct with no functionality.

Definition at line 1042 of file Parameter.hpp.

Here is the call graph for this function:

◆ ValidationCheckCallback() [3/4]

template<class ValueType >
sparta::ValidationCheckCallback< ValueType >::ValidationCheckCallback ( const std::string &  name)
inline

Construct with no functionality and a name.

Definition at line 1050 of file Parameter.hpp.

Here is the call graph for this function:

◆ ValidationCheckCallback() [4/4]

template<class ValueType >
sparta::ValidationCheckCallback< ValueType >::ValidationCheckCallback ( const ValidationCheckCallback< ValueType > &  rhp)
inline

Copy Constructor.

Definition at line 1058 of file Parameter.hpp.

Here is the call graph for this function:

Member Function Documentation

◆ from_method()

template<class ValueType >
template<class T , bool(T::*)(ValueType &, const sparta::TreeNode *) TMethod>
static ValidationCheckCallback< ValueType > sparta::ValidationCheckCallback< ValueType >::from_method ( T *  obj,
const std::string &  name 
)
inlinestatic

Definition at line 998 of file Parameter.hpp.

◆ getName()

template<class ValueType >
std::string sparta::ValidationCheckCallback< ValueType >::getName ( ) const
inline

Definition at line 1071 of file Parameter.hpp.

◆ operator()()

template<class ValueType >
bool sparta::ValidationCheckCallback< ValueType >::operator() ( ValueType &  val,
const TreeNode node 
) const
inline

Invoke callback to check given value at the indicated position in the device tree.

Definition at line 1077 of file Parameter.hpp.

◆ operator=()

template<class ValueType >
void sparta::ValidationCheckCallback< ValueType >::operator= ( const ValidationCheckCallback< ValueType > &  rhp)
inline

Definition at line 1065 of file Parameter.hpp.

◆ validateName()

template<class ValueType >
static void sparta::ValidationCheckCallback< ValueType >::validateName ( const std::string &  nm)
inlinestatic

Validates the given name string for this ValidationCheckCallback

Exceptions
ParameterExceptionif the name is invalid.

Definition at line 1084 of file Parameter.hpp.


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