Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JLANG::JTypeSelector< T > Struct Template Reference

Auxiliary class for selection of data type. More...

#include <JTypeSelector.hh>

Inheritance diagram for JLANG::JTypeSelector< T >:
JLANG::JObjectSelector< T > JLANG::JDefault< JObjectSelector< T > >

Public Types

typedef JObjectSelector< T >::argument_type argument_type
 Type definition of argument of interface method.
 

Public Member Functions

 JTypeSelector ()
 Default constructor.
 
template<class JSelector_t >
 JTypeSelector (const JSelector_t &selector)
 Constructor.
 
virtual bool accept () const override
 Accept data type.
 
virtual bool accept (argument_type object) const override
 Accept object.
 
void set (const bool status)
 Set acceptance.
 
template<class JSelector_t >
JTypeSelectoroperator() (const JSelector_t &selector)
 Set selection.
 

Static Public Member Functions

static const T & getDefault ()
 Get default value of template class.
 

Static Public Attributes

static JTypeSelector selector
 Selector.
 

Protected Attributes

bool is_enabled
 

Static Private Attributes

static const T value
 

Detailed Description

template<class T>
struct JLANG::JTypeSelector< T >

Auxiliary class for selection of data type.

This class implements the JLANG::JObjectSelector interface.

Definition at line 22 of file JTypeSelector.hh.

Member Typedef Documentation

◆ argument_type

template<class T >
JObjectSelector<T>::argument_type JLANG::JTypeSelector< T >::argument_type

Type definition of argument of interface method.

Definition at line 28 of file JTypeSelector.hh.

Constructor & Destructor Documentation

◆ JTypeSelector() [1/2]

template<class T >
JLANG::JTypeSelector< T >::JTypeSelector ( )
inline

Default constructor.

Definition at line 34 of file JTypeSelector.hh.

34 :
35 is_enabled(true)
36 {}

◆ JTypeSelector() [2/2]

template<class T >
template<class JSelector_t >
JLANG::JTypeSelector< T >::JTypeSelector ( const JSelector_t & selector)
inline

Constructor.

Parameters
selectorselector

Definition at line 45 of file JTypeSelector.hh.

46 {
47 (*this)(selector);
48 }
static JTypeSelector selector
Selector.

Member Function Documentation

◆ accept() [1/2]

template<class T >
virtual bool JLANG::JTypeSelector< T >::accept ( ) const
inlineoverridevirtual

Accept data type.

Returns
true if accepted; else false

Definition at line 56 of file JTypeSelector.hh.

57 {
58 return is_enabled;
59 }

◆ accept() [2/2]

template<class T >
virtual bool JLANG::JTypeSelector< T >::accept ( argument_type object) const
inlineoverridevirtual

Accept object.

Parameters
objectobject
Returns
true

Reimplemented from JLANG::JObjectSelector< T >.

Definition at line 68 of file JTypeSelector.hh.

69 {
70 return true;
71 }

◆ set()

template<class T >
void JLANG::JTypeSelector< T >::set ( const bool status)
inline

Set acceptance.

Parameters
statusenabled status

Definition at line 79 of file JTypeSelector.hh.

80 {
81 this->is_enabled = status;
82 }

◆ operator()()

template<class T >
template<class JSelector_t >
JTypeSelector & JLANG::JTypeSelector< T >::operator() ( const JSelector_t & selector)
inline

Set selection.

The template argument JSelector_t refers to a data structure which should provide for the function object operator:

  bool operator()(JType<T>& type) const;    // get status of data type
Parameters
selectorselector

Definition at line 97 of file JTypeSelector.hh.

98 {
99 this->is_enabled = selector(JType<T>());
100
101 return *this;
102 }

◆ getDefault()

static const T & JLANG::JDefault< T >::getDefault ( )
inlinestaticinherited

Get default value of template class.

Returns
value

Definition at line 24 of file JDefault.hh.

25 {
26 return value;
27 }

Member Data Documentation

◆ selector

template<class T >
JTypeSelector< T > JLANG::JTypeSelector< T >::selector
static

Selector.

Definition at line 104 of file JTypeSelector.hh.

◆ is_enabled

template<class T >
bool JLANG::JTypeSelector< T >::is_enabled
protected

Definition at line 107 of file JTypeSelector.hh.

◆ value

const T JLANG::JDefault< T >::value
staticprivateinherited

Definition at line 30 of file JDefault.hh.


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