#include <Triple.hpp>
Public Types | |
typedef T1 | e1_type |
typedef T2 | e2_type |
typedef T3 | e3_type |
Public Member Functions | |
Triple () | |
Triple (T1 e1, T2 e2, T3 e3) | |
Triple (const Triple< T1, T2, T3 > &triple) | |
virtual | ~Triple () |
void | clear () |
double | score () const |
bool | operator== (const Triple< T1, T2, T3 > &triple) const |
bool | operator!= (const Triple< T1, T2, T3 > &triple) const |
bool | operator> (const Triple< T1, T2, T3 > &triple) const |
bool | operator< (const Triple< T1, T2, T3 > &triple) const |
void | parse (std::istream &is) |
T1 & | e1 () |
T2 & | e2 () |
T3 & | e3 () |
const T1 & | e1 () const |
const T2 & | e2 () const |
const T3 & | e3 () const |
void | print (std::ostream &os) const |
void | to_bytes (ByteBuffer &buffer) const |
void | wrap (const char *data, size_t size) |
void | wrap (const ByteBuffer &buffer) |
Static Public Attributes | |
static const std::string | classname |
static const size_t | sizeof_T1 = sizeof(T1) |
static const size_t | sizeof_T2 = sizeof(T2) |
static const size_t | sizeof_T3 = sizeof(T3) |
static const size_t | offset_T2 = sizeof_T1 |
static const size_t | offset_T3 = sizeof_T2 + offset_T2 |
static const size_t | sizeof_value = sizeof_T1 + sizeof_T2 + sizeof_T3 |
Private Attributes | |
T1 | e1_ |
T2 | e2_ |
T3 | e3_ |
A class template of a concrete Value. This class interprets its ByteBuffer as three primitive values. Valid primitive types defined by the template parameters T1, T2 and T3 are [u]int[ 8 | 16 | 32 | 64 ]_t | float | double
Definition at line 25 of file Triple.hpp.
typedef T1 aitools::invertedindex::Triple< T1, T2, T3 >::e1_type |
Definition at line 30 of file Triple.hpp.
typedef T2 aitools::invertedindex::Triple< T1, T2, T3 >::e2_type |
Definition at line 31 of file Triple.hpp.
typedef T3 aitools::invertedindex::Triple< T1, T2, T3 >::e3_type |
Definition at line 32 of file Triple.hpp.
aitools::invertedindex::Triple< T1, T2, T3 >::Triple | ( | ) | [inline] |
The default constructor.
Definition at line 141 of file Triple.hpp.
aitools::invertedindex::Triple< T1, T2, T3 >::Triple | ( | T1 | e1, | |
T2 | e2, | |||
T3 | e3 | |||
) | [inline] |
The explicit constructor.
Definition at line 148 of file Triple.hpp.
aitools::invertedindex::Triple< T1, T2, T3 >::Triple | ( | const Triple< T1, T2, T3 > & | triple | ) | [inline] |
The copy constructor.
Definition at line 155 of file Triple.hpp.
aitools::invertedindex::Triple< T1, T2, T3 >::~Triple | ( | ) | [inline, virtual] |
The destructor.
Definition at line 162 of file Triple.hpp.
void aitools::invertedindex::Triple< T1, T2, T3 >::clear | ( | ) | [inline, virtual] |
Resets all internals to default values.
Implements aitools::invertedindex::Value.
Definition at line 167 of file Triple.hpp.
References aitools::invertedindex::Triple< T1, T2, T3 >::e1_, aitools::invertedindex::Triple< T1, T2, T3 >::e2_, and aitools::invertedindex::Triple< T1, T2, T3 >::e3_.
const T1 & aitools::invertedindex::Triple< T1, T2, T3 >::e1 | ( | ) | const [inline] |
Access the 1st element for reading.
Definition at line 247 of file Triple.hpp.
References aitools::invertedindex::Triple< T1, T2, T3 >::e1_.
T1 & aitools::invertedindex::Triple< T1, T2, T3 >::e1 | ( | ) | [inline] |
Access the 1st element for writing.
Definition at line 226 of file Triple.hpp.
References aitools::invertedindex::Triple< T1, T2, T3 >::e1_.
Referenced by BOOST_AUTO_TEST_CASE(), and aitools::invertedindex::NGramFileReader::next().
const T2 & aitools::invertedindex::Triple< T1, T2, T3 >::e2 | ( | ) | const [inline] |
Access the 2nd element for reading.
Definition at line 254 of file Triple.hpp.
References aitools::invertedindex::Triple< T1, T2, T3 >::e2_.
T2 & aitools::invertedindex::Triple< T1, T2, T3 >::e2 | ( | ) | [inline] |
Access the 2nd element for writing.
Definition at line 233 of file Triple.hpp.
References aitools::invertedindex::Triple< T1, T2, T3 >::e2_.
Referenced by aitools::invertedindex::NGramFileReader::next().
const T3 & aitools::invertedindex::Triple< T1, T2, T3 >::e3 | ( | ) | const [inline] |
Access the 3th element for reading.
Definition at line 261 of file Triple.hpp.
References aitools::invertedindex::Triple< T1, T2, T3 >::e3_.
T3 & aitools::invertedindex::Triple< T1, T2, T3 >::e3 | ( | ) | [inline] |
Access the 3th element for writing.
Definition at line 240 of file Triple.hpp.
References aitools::invertedindex::Triple< T1, T2, T3 >::e3_.
Referenced by aitools::invertedindex::NGramFileReader::next().
bool aitools::invertedindex::Triple< T1, T2, T3 >::operator!= | ( | const Triple< T1, T2, T3 > & | triple | ) | const [inline] |
Definition at line 190 of file Triple.hpp.
bool aitools::invertedindex::Triple< T1, T2, T3 >::operator< | ( | const Triple< T1, T2, T3 > & | triple | ) | const [inline] |
Definition at line 204 of file Triple.hpp.
References aitools::invertedindex::Triple< T1, T2, T3 >::score().
bool aitools::invertedindex::Triple< T1, T2, T3 >::operator== | ( | const Triple< T1, T2, T3 > & | triple | ) | const [inline] |
Definition at line 183 of file Triple.hpp.
References aitools::invertedindex::Triple< T1, T2, T3 >::e1_, aitools::invertedindex::Triple< T1, T2, T3 >::e2_, and aitools::invertedindex::Triple< T1, T2, T3 >::e3_.
bool aitools::invertedindex::Triple< T1, T2, T3 >::operator> | ( | const Triple< T1, T2, T3 > & | triple | ) | const [inline] |
Definition at line 197 of file Triple.hpp.
References aitools::invertedindex::Triple< T1, T2, T3 >::score().
void aitools::invertedindex::Triple< T1, T2, T3 >::parse | ( | std::istream & | is | ) | [inline, virtual] |
Parses all elements from an input stream.
Implements aitools::invertedindex::Value.
Definition at line 211 of file Triple.hpp.
References aitools::invertedindex::Triple< T1, T2, T3 >::e1_, aitools::invertedindex::Triple< T1, T2, T3 >::e2_, aitools::invertedindex::Triple< T1, T2, T3 >::e3_, aitools::invertedindex::Value::sizeof_int8_t, aitools::invertedindex::Triple< T1, T2, T3 >::sizeof_T1, aitools::invertedindex::Triple< T1, T2, T3 >::sizeof_T2, aitools::invertedindex::Triple< T1, T2, T3 >::sizeof_T3, and aitools::invertedindex::Value::tmp_int.
void aitools::invertedindex::Triple< T1, T2, T3 >::print | ( | std::ostream & | os | ) | const [inline, virtual] |
Prints all elements to an output stream.
Implements aitools::invertedindex::Value.
Definition at line 268 of file Triple.hpp.
References aitools::invertedindex::Triple< T1, T2, T3 >::e1_, aitools::invertedindex::Triple< T1, T2, T3 >::e2_, aitools::invertedindex::Triple< T1, T2, T3 >::e3_, aitools::invertedindex::Value::sizeof_int8_t, aitools::invertedindex::Triple< T1, T2, T3 >::sizeof_T1, aitools::invertedindex::Triple< T1, T2, T3 >::sizeof_T2, and aitools::invertedindex::Triple< T1, T2, T3 >::sizeof_T3.
double aitools::invertedindex::Triple< T1, T2, T3 >::score | ( | ) | const [inline, virtual] |
Gets the weight of this object.
Implements aitools::invertedindex::Value.
Definition at line 176 of file Triple.hpp.
References aitools::invertedindex::Triple< T1, T2, T3 >::e1_.
Referenced by aitools::invertedindex::Triple< T1, T2, T3 >::operator<(), and aitools::invertedindex::Triple< T1, T2, T3 >::operator>().
void aitools::invertedindex::Triple< T1, T2, T3 >::to_bytes | ( | ByteBuffer & | buffer | ) | const [inline, virtual] |
Serializes all elements into a byte buffer.
Implements aitools::invertedindex::Value.
Definition at line 285 of file Triple.hpp.
References aitools::invertedindex::ByteBuffer::data(), aitools::invertedindex::Triple< T1, T2, T3 >::e1_, aitools::invertedindex::Triple< T1, T2, T3 >::e2_, aitools::invertedindex::Triple< T1, T2, T3 >::e3_, aitools::invertedindex::Triple< T1, T2, T3 >::offset_T2, aitools::invertedindex::Triple< T1, T2, T3 >::offset_T3, aitools::invertedindex::ByteBuffer::resize(), aitools::invertedindex::Triple< T1, T2, T3 >::sizeof_T1, aitools::invertedindex::Triple< T1, T2, T3 >::sizeof_T2, aitools::invertedindex::Triple< T1, T2, T3 >::sizeof_T3, and aitools::invertedindex::Triple< T1, T2, T3 >::sizeof_value.
Referenced by BOOST_AUTO_TEST_CASE().
void aitools::invertedindex::Triple< T1, T2, T3 >::wrap | ( | const ByteBuffer & | buffer | ) | [inline] |
Interprets a byte buffer.
Reimplemented from aitools::invertedindex::Value.
Definition at line 306 of file Triple.hpp.
References aitools::invertedindex::Triple< T1, T2, T3 >::wrap().
void aitools::invertedindex::Triple< T1, T2, T3 >::wrap | ( | const char * | data, | |
size_t | size | |||
) | [inline, virtual] |
Interprets a byte buffer.
Implements aitools::invertedindex::Value.
Definition at line 295 of file Triple.hpp.
References aitools::invertedindex::Triple< T1, T2, T3 >::e1_, aitools::invertedindex::Triple< T1, T2, T3 >::e2_, aitools::invertedindex::Triple< T1, T2, T3 >::e3_, aitools::invertedindex::Triple< T1, T2, T3 >::offset_T2, aitools::invertedindex::Triple< T1, T2, T3 >::offset_T3, aitools::invertedindex::Triple< T1, T2, T3 >::sizeof_T1, aitools::invertedindex::Triple< T1, T2, T3 >::sizeof_T2, aitools::invertedindex::Triple< T1, T2, T3 >::sizeof_T3, and aitools::invertedindex::Triple< T1, T2, T3 >::sizeof_value.
Referenced by aitools::invertedindex::Triple< T1, T2, T3 >::wrap().
const std::string aitools::invertedindex::Triple< T1, T2, T3 >::classname [inline, static] |
Definition at line 36 of file Triple.hpp.
T1 aitools::invertedindex::Triple< T1, T2, T3 >::e1_ [private] |
Definition at line 125 of file Triple.hpp.
Referenced by aitools::invertedindex::Triple< T1, T2, T3 >::clear(), aitools::invertedindex::Triple< T1, T2, T3 >::e1(), aitools::invertedindex::Triple< T1, T2, T3 >::operator==(), aitools::invertedindex::Triple< T1, T2, T3 >::parse(), aitools::invertedindex::Triple< T1, T2, T3 >::print(), aitools::invertedindex::Triple< T1, T2, T3 >::score(), aitools::invertedindex::Triple< T1, T2, T3 >::to_bytes(), and aitools::invertedindex::Triple< T1, T2, T3 >::wrap().
T2 aitools::invertedindex::Triple< T1, T2, T3 >::e2_ [private] |
Definition at line 126 of file Triple.hpp.
Referenced by aitools::invertedindex::Triple< T1, T2, T3 >::clear(), aitools::invertedindex::Triple< T1, T2, T3 >::e2(), aitools::invertedindex::Triple< T1, T2, T3 >::operator==(), aitools::invertedindex::Triple< T1, T2, T3 >::parse(), aitools::invertedindex::Triple< T1, T2, T3 >::print(), aitools::invertedindex::Triple< T1, T2, T3 >::to_bytes(), and aitools::invertedindex::Triple< T1, T2, T3 >::wrap().
T3 aitools::invertedindex::Triple< T1, T2, T3 >::e3_ [private] |
Definition at line 127 of file Triple.hpp.
Referenced by aitools::invertedindex::Triple< T1, T2, T3 >::clear(), aitools::invertedindex::Triple< T1, T2, T3 >::e3(), aitools::invertedindex::Triple< T1, T2, T3 >::operator==(), aitools::invertedindex::Triple< T1, T2, T3 >::parse(), aitools::invertedindex::Triple< T1, T2, T3 >::print(), aitools::invertedindex::Triple< T1, T2, T3 >::to_bytes(), and aitools::invertedindex::Triple< T1, T2, T3 >::wrap().
const size_t aitools::invertedindex::Triple< T1, T2, T3 >::offset_T2 = sizeof_T1 [static] |
Definition at line 42 of file Triple.hpp.
Referenced by aitools::invertedindex::Triple< T1, T2, T3 >::to_bytes(), and aitools::invertedindex::Triple< T1, T2, T3 >::wrap().
const size_t aitools::invertedindex::Triple< T1, T2, T3 >::offset_T3 = sizeof_T2 + offset_T2 [static] |
Definition at line 43 of file Triple.hpp.
Referenced by aitools::invertedindex::Triple< T1, T2, T3 >::to_bytes(), and aitools::invertedindex::Triple< T1, T2, T3 >::wrap().
const size_t aitools::invertedindex::Triple< T1, T2, T3 >::sizeof_T1 = sizeof(T1) [static] |
const size_t aitools::invertedindex::Triple< T1, T2, T3 >::sizeof_T2 = sizeof(T2) [static] |
const size_t aitools::invertedindex::Triple< T1, T2, T3 >::sizeof_T3 = sizeof(T3) [static] |
const size_t aitools::invertedindex::Triple< T1, T2, T3 >::sizeof_value = sizeof_T1 + sizeof_T2 + sizeof_T3 [static] |
Definition at line 45 of file Triple.hpp.
Referenced by aitools::invertedindex::Triple< T1, T2, T3 >::to_bytes(), and aitools::invertedindex::Triple< T1, T2, T3 >::wrap().