Jpp  18.4.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 | 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, remove_t }
 Preprocessing options. More...
 
typedef std::pair
< JPreprocessor, JOption_t
pair_type
 
typedef std::vector< pair_typedata_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 JPreprocessor getOption (const JOption_t option)
 Get option. More...
 
static std::vector< JPreprocessorgetOptions ()
 Get options. More...
 
static std::vector< JPreprocessorgetOptions (const JOption_t option)
 Get options. More...
 

Protected Member Functions

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

Static Protected Member Functions

static const data_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 45 of file JPreprocessor.hh.

Definition at line 46 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 consecutive hits according match criterion

remove_t 

remove 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 consecutive hits according match criterion
41  remove_t //!< remove consecutive hits according match criterion
42  };
remove consecutive hits according match criterion
join consecutive hits according match criterion
filter consecutive hits according match criterion

Constructor & Destructor Documentation

JTRIGGER::JPreprocessor::JPreprocessor ( )
inline

Default constructor.

Definition at line 52 of file JPreprocessor.hh.

52  :
54  {}
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
static const data_type & get_options()
Get paired options.
then awk string
JTRIGGER::JPreprocessor::JPreprocessor ( const std::string option)
inlineprotected

Constructor.

Parameters
optionoption

Definition at line 155 of file JPreprocessor.hh.

155  :
156  std::string(option)
157  {
158  using namespace std;
159 
160  const string::size_type pos = this->rfind(ENUM_EXTENSION);
161 
162  if (pos != string::npos) {
163  this->erase(pos);
164  }
165  }
static const char ENUM_EXTENSION
Extension of enumeration names.
then awk string

Member Function Documentation

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

Type conversion operator.

Returns
option

Definition at line 62 of file JPreprocessor.hh.

63  {
64  return JPreprocessor::getOption(*this);
65  }
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 74 of file JPreprocessor.hh.

75  {
76  using namespace std;
77  using namespace JPP;
78 
79  data_type::const_iterator i = find_if(get_options().begin(),
80  get_options().end(),
82 
83  if (i != get_options().end()) {
84  return i->second;
85  } else {
86  THROW(JTypeInformationException, "Invalid option <" << option << ">");
87  }
88  };
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:712
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
static const data_type & get_options()
Get paired options.
JPreprocessor()
Default constructor.
static JPreprocessor JTRIGGER::JPreprocessor::getOption ( const JOption_t  option)
inlinestatic

Get option.

Parameters
optionoption
Returns
option

Definition at line 97 of file JPreprocessor.hh.

98  {
99  using namespace std;
100  using namespace JPP;
101 
102  data_type::const_iterator i = find_if(get_options().begin(),
103  get_options().end(),
104  make_predicate(&pair_type::second, option));
105 
106  if (i != get_options().end()) {
107  return i->first;
108  } else {
109  THROW(JTypeInformationException, "Invalid option <" << option << ">");
110  }
111  };
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:712
static const data_type & get_options()
Get paired options.
static std::vector<JPreprocessor> JTRIGGER::JPreprocessor::getOptions ( )
inlinestatic

Get options.

Returns
list of options

Definition at line 119 of file JPreprocessor.hh.

120  {
121  return JLANG::make_array(get_options().begin(),
122  get_options().end(),
124  }
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 data_type & get_options()
Get paired options.
static std::vector<JPreprocessor> JTRIGGER::JPreprocessor::getOptions ( const JOption_t  option)
inlinestatic

Get options.

Parameters
optionoption
Returns
list of options

Definition at line 133 of file JPreprocessor.hh.

134  {
135  std::vector<JPreprocessor> buffer(1, getOption(option));
136 
137  for (const auto& i : get_options()) {
138  if (i.second != option) {
139  buffer.push_back(i.first);
140  }
141  }
142 
143  return buffer;
144  }
static JOption_t getOption(const JPreprocessor &option)
Get option.
static const data_type & get_options()
Get paired options.
static const data_type& JTRIGGER::JPreprocessor::get_options ( )
inlinestaticprotected

Get paired options.

Returns
list of paired options

Definition at line 173 of file JPreprocessor.hh.

174  {
175  static data_type buffer;
176 
177  if (buffer.empty()) {
178 
179 #define MAKE_ENTRY(A) std::make_pair(JPreprocessor(#A), A)
180 
181  buffer.push_back(MAKE_ENTRY(none_t));
182  buffer.push_back(MAKE_ENTRY(join_t));
183  buffer.push_back(MAKE_ENTRY(filter_t));
184  buffer.push_back(MAKE_ENTRY(remove_t));
185 
186 #undef MAKE_ENTRY
187  }
188 
189  return buffer;
190  }
remove consecutive hits according match criterion
std::vector< pair_type > data_type
#define MAKE_ENTRY(A)
join consecutive hits according match criterion
filter consecutive hits according match criterion

Member Data Documentation

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

Extension of enumeration names.

Definition at line 148 of file JPreprocessor.hh.


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