#include <Single.hpp>
Public Types | |
typedef T | element_type |
Public Member Functions | |
Single () | |
Single (T element) | |
Single (const Single< T > &single) | |
virtual | ~Single () |
void | clear () |
double | score () const |
bool | operator== (const Single< T > &single) const |
bool | operator!= (const Single< T > &single) const |
bool | operator> (const Single< T > &single) const |
bool | operator< (const Single< T > &single) const |
void | parse (std::istream &is) |
T & | element () |
const T & | element () 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_T = sizeof(T) |
Private Attributes | |
T | element_ |
A class template of a concrete Value. This class interprets a ByteBuffer as one primitive value. Valid primitive types defined by the template parameter T are [u]int[ 8 | 16 | 32 | 64 ]_t | float | double
Definition at line 25 of file Single.hpp.
typedef T aitools::invertedindex::Single< T >::element_type |
Definition at line 30 of file Single.hpp.
aitools::invertedindex::Single< T >::Single | ( | ) | [inline] |
The default constructor.
Definition at line 103 of file Single.hpp.
aitools::invertedindex::Single< T >::Single | ( | T | element | ) | [inline] |
The explicit constructor.
Definition at line 108 of file Single.hpp.
aitools::invertedindex::Single< T >::Single | ( | const Single< T > & | single | ) | [inline] |
The copy constructor.
Definition at line 113 of file Single.hpp.
aitools::invertedindex::Single< T >::~Single | ( | ) | [inline, virtual] |
The destructor.
Definition at line 118 of file Single.hpp.
void aitools::invertedindex::Single< T >::clear | ( | ) | [inline, virtual] |
Resets all internals to default values.
Implements aitools::invertedindex::Value.
Definition at line 123 of file Single.hpp.
References aitools::invertedindex::Single< T >::element_.
const T & aitools::invertedindex::Single< T >::element | ( | ) | const [inline] |
Definition at line 181 of file Single.hpp.
References aitools::invertedindex::Single< T >::element_.
T & aitools::invertedindex::Single< T >::element | ( | ) | [inline] |
Definition at line 174 of file Single.hpp.
References aitools::invertedindex::Single< T >::element_.
bool aitools::invertedindex::Single< T >::operator!= | ( | const Single< T > & | single | ) | const [inline] |
Definition at line 144 of file Single.hpp.
bool aitools::invertedindex::Single< T >::operator< | ( | const Single< T > & | single | ) | const [inline] |
Definition at line 158 of file Single.hpp.
References aitools::invertedindex::Single< T >::score().
bool aitools::invertedindex::Single< T >::operator== | ( | const Single< T > & | single | ) | const [inline] |
Definition at line 137 of file Single.hpp.
References aitools::invertedindex::Single< T >::element_.
bool aitools::invertedindex::Single< T >::operator> | ( | const Single< T > & | single | ) | const [inline] |
Definition at line 151 of file Single.hpp.
References aitools::invertedindex::Single< T >::score().
void aitools::invertedindex::Single< T >::parse | ( | std::istream & | is | ) | [inline, virtual] |
Parses all elements from an input stream.
Implements aitools::invertedindex::Value.
Definition at line 165 of file Single.hpp.
References aitools::invertedindex::Single< T >::element_, aitools::invertedindex::Value::sizeof_int8_t, aitools::invertedindex::Single< T >::sizeof_T, and aitools::invertedindex::Value::tmp_int.
void aitools::invertedindex::Single< T >::print | ( | std::ostream & | os | ) | const [inline, virtual] |
Prints all elements to an output stream.
Implements aitools::invertedindex::Value.
Definition at line 188 of file Single.hpp.
References aitools::invertedindex::Single< T >::element_, aitools::invertedindex::Value::sizeof_int8_t, and aitools::invertedindex::Single< T >::sizeof_T.
double aitools::invertedindex::Single< T >::score | ( | ) | const [inline, virtual] |
Gets the weight of this object.
Implements aitools::invertedindex::Value.
Definition at line 130 of file Single.hpp.
References aitools::invertedindex::Single< T >::element_.
Referenced by aitools::invertedindex::Single< T >::operator<(), and aitools::invertedindex::Single< T >::operator>().
void aitools::invertedindex::Single< T >::to_bytes | ( | ByteBuffer & | buffer | ) | const [inline, virtual] |
Serializes all elements into a byte buffer.
Implements aitools::invertedindex::Value.
Definition at line 197 of file Single.hpp.
References aitools::invertedindex::ByteBuffer::data(), aitools::invertedindex::Single< T >::element_, aitools::invertedindex::ByteBuffer::resize(), and aitools::invertedindex::Single< T >::sizeof_T.
void aitools::invertedindex::Single< T1 >::wrap | ( | const ByteBuffer & | buffer | ) | [inline] |
Interprets a byte buffer.
Reimplemented from aitools::invertedindex::Value.
Definition at line 214 of file Single.hpp.
References aitools::invertedindex::Single< T >::wrap().
void aitools::invertedindex::Single< T1 >::wrap | ( | const char * | data, | |
size_t | size | |||
) | [inline, virtual] |
Interprets a byte buffer.
Implements aitools::invertedindex::Value.
Definition at line 205 of file Single.hpp.
References aitools::invertedindex::Single< T >::element_, and aitools::invertedindex::Single< T >::sizeof_T.
Referenced by aitools::invertedindex::Single< T >::wrap().
const std::string aitools::invertedindex::Single< T >::classname [inline, static] |
Definition at line 34 of file Single.hpp.
T aitools::invertedindex::Single< T >::element_ [private] |
Definition at line 91 of file Single.hpp.
Referenced by aitools::invertedindex::Single< T >::clear(), aitools::invertedindex::Single< T >::element(), aitools::invertedindex::Single< T >::operator==(), aitools::invertedindex::Single< T >::parse(), aitools::invertedindex::Single< T >::print(), aitools::invertedindex::Single< T >::score(), aitools::invertedindex::Single< T >::to_bytes(), and aitools::invertedindex::Single< T >::wrap().
const size_t aitools::invertedindex::Single< T >::sizeof_T = sizeof(T) [static] |
Definition at line 37 of file Single.hpp.
Referenced by aitools::invertedindex::Single< T >::parse(), aitools::invertedindex::Single< T >::print(), aitools::invertedindex::Single< T >::to_bytes(), and aitools::invertedindex::Single< T >::wrap().