Public Member Functions | Protected Member Functions | Protected Attributes

Sphinx::Value_t Class Reference

Generic value type of sphinx attribute. More...

#include <value.h>

Public Member Functions

 Value_t (uint32_t v)
 initializes Value_t as uint32_t type
 Value_t (float v)
 initializes Value_t as float type
 Value_t (const std::vector< Value_t > &v)
 initializes Value_t as vector type
 Value_t (uint64_t v)
 initializes Value_t as uint64_t type
 Value_t (const std::string &v)
 initializes Value_t as string type
 Value_t (const Value_t &v)
 copy constructor, that performs deep copy of *value pointer
Value_toperator= (const Value_t &)
 assignment, that performs deep copy of *value pointer
bool isValid () const
 check if contains a valid value.
ValueType_t getValueType () const
 returns current type of Value_t
 operator uint32_t () const throw (ValueTypeError_t)
 overloaded implicit conversion operator to uint32_t
 operator const std::vector< Value_t > & () const throw (ValueTypeError_t)
 overloaded implicit conversion operator to std::vector
 operator float () const throw (ValueTypeError_t)
 overloaded implicit conversion operator to float
 operator uint64_t () const throw (ValueTypeError_t)
 overloaded implicit conversion operator to uint64_t
 operator const std::string & () const throw (ValueTypeError_t)
 overloaded implicit conversion operator to std::string

Protected Member Functions

void clear ()
void makeCopy (const Value_t &)

Protected Attributes

ValueBase_t * value

Detailed Description

Generic value type of sphinx attribute.

Value returned by Sphinx searchd in search result attributes. Supported types are uint32_t, float and std::vector<Value_t>


Member Function Documentation

ValueType_t Sphinx::Value_t::getValueType (  )  const

returns current type of Value_t

Returns:
current value type. One of VALUETYPE_UINT32, VALUETYPE_FLOAT, VALUETYPE_VECTOR
See also:
ValueType_t
Sphinx::Value_t::operator const std::string & (  )  const throw (ValueTypeError_t)

overloaded implicit conversion operator to std::string

Returns value as std::string. If the current value type is other than string, throws ValueTypeError_t;

Sphinx::Value_t::operator const std::vector< Value_t > & (  )  const throw (ValueTypeError_t)

overloaded implicit conversion operator to std::vector

Returns value as std::vector<Value_t>. If the current value type is other than std::vector, throws ValueTypeError_t;

Sphinx::Value_t::operator float (  )  const throw (ValueTypeError_t)

overloaded implicit conversion operator to float

Returns value as float. If the current value type is other than float, throws ValueTypeError_t;

Sphinx::Value_t::operator uint32_t (  )  const throw (ValueTypeError_t)

overloaded implicit conversion operator to uint32_t

Returns value as uint32_t. If the current value type is other than uint32_t, throws ValueTypeError_t;

Sphinx::Value_t::operator uint64_t (  )  const throw (ValueTypeError_t)

overloaded implicit conversion operator to uint64_t

Returns value as uint64_t. If the current value type is other than uint64_t, throws ValueTypeError_t;


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