Flags.h File Reference

Go to the source code of this file.

Classes

class  shark::TypedFlags< Flag >
 Flexible and extensible mechanisms for holding flags. More...
 
class  shark::TypedFeatureNotAvailableException< Feature >
 Exception indicating the attempt to use a feature which is not supported. More...
 
struct  boost::serialization::tracking_level< shark::TypedFlags< T > >
 

Namespaces

 shark
 AbstractMultiObjectiveOptimizer.
 
 boost
 
 boost::serialization
 

Macros

#define SHARK_FEATURE_INTERFACE
 
#define SHARK_FEATURE_EXCEPTION(FEATURE)
 
#define SHARK_FEATURE_EXCEPTION_DERIVED(FEATURE)
 
#define SHARK_FEATURE_CHECK(FEATURE)   if(!(this->features()&base_type::FEATURE)){SHARK_FEATURE_EXCEPTION_DERIVED(FEATURE);}
 Checks whether the feature is available, if not, it throws an exception. More...
 

Macro Definition Documentation

◆ SHARK_FEATURE_CHECK

#define SHARK_FEATURE_CHECK (   FEATURE)    if(!(this->features()&base_type::FEATURE)){SHARK_FEATURE_EXCEPTION_DERIVED(FEATURE);}

Checks whether the feature is available, if not, it throws an exception.

Definition at line 185 of file Flags.h.

◆ SHARK_FEATURE_EXCEPTION

◆ SHARK_FEATURE_EXCEPTION_DERIVED

#define SHARK_FEATURE_EXCEPTION_DERIVED (   FEATURE)
Value:
{assert(!(this->features()&base_type::FEATURE));\
throw typename base_type::FeatureNotAvailableException("Class does not support Feature " #FEATURE, base_type::FEATURE,__FILE__, __LINE__);}

Same as SHARK_FEATURE_EXCEPTION, but used when called from a derived class. Assumes that a typedef "base_type" for the Baseclass exists

Definition at line 180 of file Flags.h.

Referenced by shark::AbstractLoss< unsigned int, RealVector >::evalDerivative().

◆ SHARK_FEATURE_INTERFACE

#define SHARK_FEATURE_INTERFACE
Value:
typedef TypedFlags<Feature> Features;\
protected:\
Features m_features;\
public:\
const Features & features() const {\
return( m_features );\
}\
virtual void updateFeatures(){}\
typedef TypedFeatureNotAvailableException<Feature> FeatureNotAvailableException

Definition at line 160 of file Flags.h.