Jpp  15.0.1
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 | Protected Member Functions | Static Protected Member Functions | Static Protected Attributes | List of all members
JTRIGGER::JPreprocessor Struct Reference

Auxiliary class for specifying the way of pre-processing of hits. More...

#include <JPreprocessor.hh>

Inheritance diagram for JTRIGGER::JPreprocessor:

Public Types

enum  JOption_t { none_t = 0, join_t, filter_t }
 Preprocessing options. More...
 
typedef std::pair
< JPreprocessor, JOption_t
pair_type
 
typedef std::vector< pair_typemap_type
 

Public Member Functions

 JPreprocessor ()
 Default constructor. More...
 
 operator JOption_t () const
 Type conversion operator. More...
 

Static Public Member Functions

static JOption_t getOption (const JPreprocessor &option)
 Get option. More...
 
static std::vector< JPreprocessorgetOptions ()
 Get options. More...
 

Protected Member Functions

 JPreprocessor (const std::string &option)
 Constructor. More...
 

Static Protected Member Functions

static const map_typeget_options ()
 Get paired options. More...
 

Static Protected Attributes

static const char ENUM_EXTENSION = '_'
 Extension of enumeration names. More...
 

Detailed Description

Auxiliary class for specifying the way of pre-processing of hits.

Definition at line 31 of file JPreprocessor.hh.

Member Typedef Documentation

Definition at line 44 of file JPreprocessor.hh.

Definition at line 45 of file JPreprocessor.hh.

Member Enumeration Documentation

Preprocessing options.

Enumerator
none_t 

no pre-processing

join_t 

join consecutive hits according match criterion

filter_t 

filter-out consecutive hits according match criterion

Definition at line 37 of file JPreprocessor.hh.

37  {
38  none_t = 0, //!< no pre-processing
39  join_t, //!< join consecutive hits according match criterion
40  filter_t //!< filter-out consecutive hits according match criterion
41  };
join consecutive hits according match criterion
filter-out consecutive hits according match criterion

Constructor & Destructor Documentation

JTRIGGER::JPreprocessor::JPreprocessor ( )
inline

Default constructor.

Definition at line 51 of file JPreprocessor.hh.

51  :
52  std::string(get_options()[0].first)
53  {}
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
static const map_type & get_options()
Get paired options.
JTRIGGER::JPreprocessor::JPreprocessor ( const std::string &  option)
inlineprotected

Constructor.

Parameters
optionoption

Definition at line 111 of file JPreprocessor.hh.

111  :
112  std::string(option)
113  {
114  using namespace std;
115 
116  const string::size_type pos = this->rfind(ENUM_EXTENSION);
117 
118  if (pos != string::npos) {
119  this->erase(pos);
120  }
121  }
static const char ENUM_EXTENSION
Extension of enumeration names.

Member Function Documentation

JTRIGGER::JPreprocessor::operator JOption_t ( ) const
inline

Type conversion operator.

Returns
option

Definition at line 61 of file JPreprocessor.hh.

62  {
63  return JPreprocessor::getOption(*this);
64  }
static JOption_t getOption(const JPreprocessor &option)
Get option.
static JOption_t JTRIGGER::JPreprocessor::getOption ( const JPreprocessor option)
inlinestatic

Get option.

Parameters
optionoption
Returns
option

Definition at line 73 of file JPreprocessor.hh.

74  {
75  using namespace std;
76  using namespace JPP;
77 
78  map_type::const_iterator i = find_if(get_options().begin(),
79  get_options().end(),
81 
82  if (i != get_options().end()) {
83  return i->second;
84  } else {
85  THROW(JTypeInformationException, "Invalid option <" << option << ">");
86  }
87  };
JPredicate< JResult_t T::*, JComparison::eq > make_predicate(JResult_t T::*member, const JResult_t value)
Helper method to create predicate for data member.
Definition: JPredicate.hh:128
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:670
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
JPreprocessor()
Default constructor.
static const map_type & get_options()
Get paired options.
static std::vector<JPreprocessor> JTRIGGER::JPreprocessor::getOptions ( )
inlinestatic

Get options.

Returns
list of options

Definition at line 95 of file JPreprocessor.hh.

96  {
97  return JLANG::make_array(get_options().begin(),
98  get_options().end(),
100  }
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
const array_type< JValue_t > & make_array(const JValue_t(&array)[N])
Method to create array of values.
Definition: JVectorize.hh:54
static const map_type & get_options()
Get paired options.
static const map_type& JTRIGGER::JPreprocessor::get_options ( )
inlinestaticprotected

Get paired options.

Returns
list of paired options

Definition at line 129 of file JPreprocessor.hh.

130  {
131  static map_type buffer;
132 
133  if (buffer.empty()) {
134 
135 #define MAKE_ENTRY(A) std::make_pair(JPreprocessor(#A), A)
136 
137  buffer.push_back(MAKE_ENTRY(none_t));
138  buffer.push_back(MAKE_ENTRY(join_t));
139  buffer.push_back(MAKE_ENTRY(filter_t));
140 
141 #undef MAKE_ENTRY
142  }
143 
144  return buffer;
145  }
#define MAKE_ENTRY(A)
join consecutive hits according match criterion
filter-out consecutive hits according match criterion
std::vector< pair_type > map_type

Member Data Documentation

const char JTRIGGER::JPreprocessor::ENUM_EXTENSION = '_'
staticprotected

Extension of enumeration names.

Definition at line 104 of file JPreprocessor.hh.


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