Auxiliary class for specifying selection of database data.
More...
#include <JSelector.hh>
|
| JSelector () |
| Default constructor. More...
|
|
template<class T > |
| JSelector (const std::string &key, const T value, const Selector::RelOp &operand=Selector::RelOp::Equal) |
| Constructor. More...
|
|
template<class JClass_t , class JType_t > |
| JSelector (JType_t JClass_t::*data_member, const JType_t value, const Selector::RelOp &operand=Selector::RelOp::Equal) |
| Constructor. More...
|
|
template<class JClass_t > |
| JSelector (std::string JClass_t::*data_member, const std::string value, const Selector::RelOp &operand=Selector::RelOp::Equal) |
| Constructor. More...
|
|
JSelector & | add (const JSelector &selection) |
| Add selection. More...
|
|
template<class T > |
JSelector & | add (const std::string &key, const T value, const Selector::RelOp &operand=Selector::RelOp::Equal) |
| Add selection. More...
|
|
template<class JClass_t , class JType_t > |
JSelector & | add (JType_t JClass_t::*data_member, const JType_t value, const Selector::RelOp &operand=Selector::RelOp::Equal) |
| Add selection. More...
|
|
template<class JClass_t > |
JSelector & | add (std::string JClass_t::*data_member, const std::string &value, const Selector::RelOp &operand=Selector::RelOp::Equal) |
| Add selection. More...
|
|
JSelector & | mul (const JSecond_t &object) |
| Multiply with object. More...
|
|
Auxiliary class for specifying selection of database data.
Definition at line 67 of file JDB/JSelector.hh.
◆ JSelector() [1/4]
JDATABASE::JSelector::JSelector |
( |
| ) |
|
|
inline |
◆ JSelector() [2/4]
template<class T >
JDATABASE::JSelector::JSelector |
( |
const std::string & |
key, |
|
|
const T |
value, |
|
|
const Selector::RelOp & |
operand = Selector::RelOp::Equal |
|
) |
| |
|
inline |
Constructor.
- Parameters
-
key | key |
value | value |
operand | operand |
Definition at line 93 of file JDB/JSelector.hh.
95 add(key, value, operand);
◆ JSelector() [3/4]
template<class JClass_t , class JType_t >
JDATABASE::JSelector::JSelector |
( |
JType_t JClass_t::* |
data_member, |
|
|
const JType_t |
value, |
|
|
const Selector::RelOp & |
operand = Selector::RelOp::Equal |
|
) |
| |
|
inline |
Constructor.
- Parameters
-
data_member | data member |
value | value |
operand | operand |
Definition at line 107 of file JDB/JSelector.hh.
109 add(data_member, value, operand);
◆ JSelector() [4/4]
template<class JClass_t >
JDATABASE::JSelector::JSelector |
( |
std::string JClass_t::* |
data_member, |
|
|
const std::string |
value, |
|
|
const Selector::RelOp & |
operand = Selector::RelOp::Equal |
|
) |
| |
|
inline |
Constructor.
- Parameters
-
data_member | data member |
value | value |
operand | operand |
Definition at line 121 of file JDB/JSelector.hh.
123 add(data_member, value, operand);
◆ add() [1/4]
Add selection.
- Parameters
-
- Returns
- this selection
Definition at line 133 of file JDB/JSelector.hh.
137 copy(selection.begin(), selection.end(), back_inserter(*
this));
◆ add() [2/4]
template<class T >
JSelector& JDATABASE::JSelector::add |
( |
const std::string & |
key, |
|
|
const T |
value, |
|
|
const Selector::RelOp & |
operand = Selector::RelOp::Equal |
|
) |
| |
|
inline |
Add selection.
- Parameters
-
key | key |
value | value |
operand | operand |
- Returns
- this selection
Definition at line 152 of file JDB/JSelector.hh.
160 push_back(Selector(key.c_str(), os.str().c_str(), operand));
◆ add() [3/4]
template<class JClass_t , class JType_t >
JSelector& JDATABASE::JSelector::add |
( |
JType_t JClass_t::* |
data_member, |
|
|
const JType_t |
value, |
|
|
const Selector::RelOp & |
operand = Selector::RelOp::Equal |
|
) |
| |
|
inline |
Add selection.
- Parameters
-
data_member | data member |
value | value |
operand | operand |
- Returns
- this selection
Definition at line 175 of file JDB/JSelector.hh.
◆ add() [4/4]
template<class JClass_t >
JSelector& JDATABASE::JSelector::add |
( |
std::string JClass_t::* |
data_member, |
|
|
const std::string & |
value, |
|
|
const Selector::RelOp & |
operand = Selector::RelOp::Equal |
|
) |
| |
|
inline |
Add selection.
- Parameters
-
data_member | data member |
value | value |
operand | operand |
- Returns
- this selection
Definition at line 190 of file JDB/JSelector.hh.
◆ mul()
Multiply with object.
- Parameters
-
- Returns
- result object
Definition at line 273 of file JMath.hh.
◆ operator>>
std::istream& operator>> |
( |
std::istream & |
in, |
|
|
JSelector & |
selector |
|
) |
| |
|
friend |
Read selector from input stream.
- Parameters
-
in | input stream |
selector | selector |
- Returns
- input stream
Definition at line 203 of file JDB/JSelector.hh.
216 string::size_type pos = buffer.find(
getOperand(i).Render());
218 if (pos != string::npos && (operand == -1 ||
getOperand(i).Render().length() >
getOperand(operand).Render().length())) {
225 string::size_type pos = buffer.find(
getOperand(operand).Render());
227 selector.push_back(Selector(
JPP::trim(buffer.substr(0, pos)).c_str(),
233 in.setstate(ios::badbit);
◆ operator<<
std::ostream& operator<< |
( |
std::ostream & |
out, |
|
|
const JSelector & |
selector |
|
) |
| |
|
friend |
Write selector to output stream.
- Parameters
-
out | output stream |
selector | selector |
- Returns
- output stream
Definition at line 247 of file JDB/JSelector.hh.
249 for (const_iterator i = selector.begin(); i != selector.end(); ++i) {
250 out << i->Name << i->RelationalOperator.Render() << i->Value <<
JSelector::EOL << std::endl;
◆ EOL
const char JDATABASE::JSelector::EOL = ';' |
|
static |
The documentation for this class was generated from the following file: