Jpp  17.2.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
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. More...
 

Public Member Functions

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

Static Public Member Functions

static const JObjectSelector< T > & getDefault ()
 Get default value of template class. More...
 

Static Public Attributes

static JTypeSelector selector
 Selector. More...
 

Protected Attributes

bool is_enabled
 

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

Type definition of argument of interface method.

Definition at line 28 of file JTypeSelector.hh.

Constructor & Destructor Documentation

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

Default constructor.

Definition at line 34 of file JTypeSelector.hh.

34  :
35  is_enabled(true)
36  {}
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

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  }
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  }
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  }
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  }
Auxiliary class for a type holder.
Definition: JType.hh:19
static JTypeSelector selector
Selector.
static const JObjectSelector< T > & JLANG::JDefault< JObjectSelector< T > >::getDefault ( )
inlinestaticinherited

Get default value of template class.

Returns
value

Definition at line 24 of file JDefault.hh.

25  {
26  return value;
27  }
static const JObjectSelector< T > value
Definition: JDefault.hh:30

Member Data Documentation

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

Selector.

Definition at line 104 of file JTypeSelector.hh.

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

Definition at line 107 of file JTypeSelector.hh.


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