The Sparta Modeling Framework
Loading...
Searching...
No Matches
sparta::AssertContext Class Reference

Creates a helper traits class for determining whehther a type has a member named getClock. More...

#include <Resource.hpp>

Public Member Functions

template<class CTXT >
std::string getContextDescription (CTXT *ctxt, typename std::enable_if<!std::is_base_of< Resource, CTXT >::value &&!std::is_base_of< TreeNode, CTXT >::value &&!has_attr_getClock< CTXT >::value >::type *dummy=nullptr)
 Handle default case where pointer is not a sparta::Resource.
 
template<class CTXT >
std::string getContextDescription (CTXT *ctxt, typename std::enable_if<!std::is_base_of< Resource, CTXT >::value &&!std::is_base_of< TreeNode, CTXT >::value &&has_attr_getClock< CTXT >::value >::type *dummy=0)
 Handle case where pointer is a not subclass of (and not a) sparta::Resource, but still has a getClock method. This method must be checked for its signature.
 
template<class CTXT >
std::string getContextDescription (const sparta::Resource *ctxt, typename std::enable_if< std::is_base_of< Resource, CTXT >::value >::type *dummy=0)
 Handle case where pointer is a subclass of (or is a) sparta::Resource.
 
template<class CTXT >
std::string getContextDescription (const sparta::TreeNode *ctxt, typename std::enable_if< std::is_base_of< TreeNode, CTXT >::value >::type *dummy=0)
 Handle case where pointer is a subclass of (or is a) sparta::TreeNode.
 

Detailed Description

Creates a helper traits class for determining whehther a type has a member named getClock.

Helper for getting context of an assertion

Definition at line 252 of file Resource.hpp.

Member Function Documentation

◆ getContextDescription() [1/4]

template<class CTXT >
std::string sparta::AssertContext::getContextDescription ( const sparta::Resource ctxt,
typename std::enable_if< std::is_base_of< Resource, CTXT >::value >::type *  dummy = 0 
)
inline

Handle case where pointer is a subclass of (or is a) sparta::Resource.

Definition at line 336 of file Resource.hpp.

Here is the call graph for this function:

◆ getContextDescription() [2/4]

template<class CTXT >
std::string sparta::AssertContext::getContextDescription ( const sparta::TreeNode ctxt,
typename std::enable_if< std::is_base_of< TreeNode, CTXT >::value >::type *  dummy = 0 
)
inline

Handle case where pointer is a subclass of (or is a) sparta::TreeNode.

Definition at line 357 of file Resource.hpp.

Here is the call graph for this function:

◆ getContextDescription() [3/4]

template<class CTXT >
std::string sparta::AssertContext::getContextDescription ( CTXT *  ctxt,
typename std::enable_if<!std::is_base_of< Resource, CTXT >::value &&!std::is_base_of< TreeNode, CTXT >::value &&!has_attr_getClock< CTXT >::value >::type *  dummy = nullptr 
)
inline

Handle default case where pointer is not a sparta::Resource.

Definition at line 289 of file Resource.hpp.

◆ getContextDescription() [4/4]

template<class CTXT >
std::string sparta::AssertContext::getContextDescription ( CTXT *  ctxt,
typename std::enable_if<!std::is_base_of< Resource, CTXT >::value &&!std::is_base_of< TreeNode, CTXT >::value &&has_attr_getClock< CTXT >::value >::type *  dummy = 0 
)
inline

Handle case where pointer is a not subclass of (and not a) sparta::Resource, but still has a getClock method. This method must be checked for its signature.

Note
The signature of getClock could be verified in the template arguments, but if the user created a non-resource class with a getClock method and then use the context assert within it, they probably meant to actually get the clock rather than get a silly message about not being inside a resource

Definition at line 312 of file Resource.hpp.


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