VGServer::AnyType Class Reference
[Public Application Interface]

AnyType is the class which encapsules the different possible attribute typed values. More...

#include <AnyType.h>

Inheritance diagram for VGServer::AnyType:

VGServer::AttributeProperties List of all members.

Public Member Functions

 AnyType (const AnyType &a)
 copy constructor to deal with enclosed strings
 AnyType (const std::string &s)
 AnyType (const char *s)
 AnyType (double d)
 AnyType (float f)
 AnyType (unsigned long long l)
 AnyType (unsigned int i)
 AnyType (unsigned short s)
 AnyType (unsigned char c)
 AnyType (long long l)
 AnyType (int i)
 AnyType (short s)
 AnyType (char c)
 AnyType (bool b)
 AnyType (attrtype_t t)
 create a new AnyType object
template<template< typename Type > class Operator, char OpName>
AnyType binary_arith_op (const AnyType &b) const
 Binary arithmatic template operator.
template<template< typename Type > class Operator, int OpNum>
bool binary_comp_op (const AnyType &b) const
 Binary comparison template operator.
bool convertType (attrtype_t t)
 changes the current type: returns false if the current value could not be converted to the new type, the new type is set nonetheless.
bool getBoolean () const
 return the enclosed value in different types, converting if necessary if the enclosed value cannot be converted these functions throw a ConversionError exception.
double getDouble () const
int getInteger () const
long long getLong () const
std::string getString () const
attrtype_t getType () const
 return the type of the object
int getTypeLength () const
 return the storage length of the type in bytes
std::string getTypeString () const
 returns a string for each this AnyType's type.
unsigned int getUnsignedInteger () const
unsigned long long getUnsignedLong () const
unsigned int getValueLength () const
 return the storage length of this value (mark the different to getTypeLength()
bool isFixedLength () const
 boolean check if this type is of fixed-length
bool op_equal_to (const AnyType &b) const
bool op_greater (const AnyType &b) const
bool op_greater_equal (const AnyType &b) const
bool op_less (const AnyType &b) const
bool op_less_equal (const AnyType &b) const
bool op_not_equal_to (const AnyType &b) const
AnyType operator * (const AnyType &b) const
bool operator!= (const AnyType &a) const
 comparison operator: compares values _and_ types
AnyType operator+ (const AnyType &b) const
AnyType operator- (const AnyType &b) const
AnyType operator- () const
 unary prefix - operator.
AnyType operator/ (const AnyType &b) const
AnyTypeoperator= (const AnyType &a)
 assignment operator to deal with enclosed strings
bool operator== (const AnyType &a) const
 comparison operator: compares values _and_ types
void resetType (attrtype_t t)
 changes the current type and resets the contents without attempting to convert the enclosed value.
bool setDouble (double d)
bool setInteger (int i)
 sets the value, converting the input if necessary.
bool setLong (long long l)
bool setString (const std::string &s)
bool setStringQuoted (const std::string &s)
 ~AnyType ()
 destroy the object: free associated string memory

Static Public Member Functions

static int getTypeLength (attrtype_t t)
 return the storage length of the type in bytes
static std::string getTypeString (attrtype_t at)
 returns a string for each attrtype_t.
static bool isFixedLength (attrtype_t t)
 boolean check if this type is of fixed-length
static bool isValidAttrtype (attrtype_t at)
 returns true if the attrtype_t is a valid type
static attrtype_t stringToType (const char *s)
 returns the attrtype enum value of a string, throws ConversionException if it cannot be determined.
static attrtype_t stringToType (const std::string &s)
 returns the attrtype enum value of a string, throws ConversionException if it cannot be determined.

Detailed Description

AnyType is the class which encapsules the different possible attribute typed values.

It tries to do automatic conversion between different-typed input values. This could also be implemented using a polymorphic class hierarchy

Definition at line 21 of file AnyType.h.


Constructor & Destructor Documentation

VGServer::AnyType::AnyType ( attrtype_t  t  )  [inline, explicit]

create a new AnyType object

Definition at line 39 of file AnyType.h.

References VGServer::ATTRTYPE_LONGSTRING, and VGServer::ATTRTYPE_STRING.

Referenced by binary_arith_op(), and VGServer::GraphData::getEdgeAttr().

VGServer::AnyType::AnyType ( bool  b  )  [inline]

Definition at line 49 of file AnyType.h.

References VGServer::ATTRTYPE_BOOL.

VGServer::AnyType::AnyType ( char  c  )  [inline]

Definition at line 54 of file AnyType.h.

References VGServer::ATTRTYPE_CHAR.

VGServer::AnyType::AnyType ( short  s  )  [inline]

Definition at line 59 of file AnyType.h.

References VGServer::ATTRTYPE_SHORT.

VGServer::AnyType::AnyType ( int  i  )  [inline]

Definition at line 64 of file AnyType.h.

References VGServer::ATTRTYPE_INTEGER.

VGServer::AnyType::AnyType ( long long  l  )  [inline]

Definition at line 69 of file AnyType.h.

References VGServer::ATTRTYPE_LONG.

VGServer::AnyType::AnyType ( unsigned char  c  )  [inline]

Definition at line 74 of file AnyType.h.

References VGServer::ATTRTYPE_BYTE.

VGServer::AnyType::AnyType ( unsigned short  s  )  [inline]

Definition at line 79 of file AnyType.h.

References VGServer::ATTRTYPE_WORD.

VGServer::AnyType::AnyType ( unsigned int  i  )  [inline]

Definition at line 84 of file AnyType.h.

References VGServer::ATTRTYPE_DWORD.

VGServer::AnyType::AnyType ( unsigned long long  l  )  [inline]

Definition at line 89 of file AnyType.h.

References VGServer::ATTRTYPE_QWORD.

VGServer::AnyType::AnyType ( float  f  )  [inline]

Definition at line 94 of file AnyType.h.

References VGServer::ATTRTYPE_FLOAT.

VGServer::AnyType::AnyType ( double  d  )  [inline]

Definition at line 99 of file AnyType.h.

References VGServer::ATTRTYPE_DOUBLE.

VGServer::AnyType::AnyType ( const char *  s  )  [inline]

Definition at line 104 of file AnyType.h.

References VGServer::ATTRTYPE_STRING.

VGServer::AnyType::AnyType ( const std::string &  s  )  [inline]

Definition at line 109 of file AnyType.h.

References VGServer::ATTRTYPE_STRING.

VGServer::AnyType::~AnyType (  )  [inline]

destroy the object: free associated string memory

Definition at line 116 of file AnyType.h.

References VGServer::ATTRTYPE_LONGSTRING, and VGServer::ATTRTYPE_STRING.

VGServer::AnyType::AnyType ( const AnyType a  )  [inline]

copy constructor to deal with enclosed strings

Definition at line 125 of file AnyType.h.

References _double, _float, _int, _long, _string, _uint, _ulong, VGServer::ATTRTYPE_BOOL, VGServer::ATTRTYPE_BYTE, VGServer::ATTRTYPE_CHAR, VGServer::ATTRTYPE_DOUBLE, VGServer::ATTRTYPE_DWORD, VGServer::ATTRTYPE_FLOAT, VGServer::ATTRTYPE_INTEGER, VGServer::ATTRTYPE_INVALID, VGServer::ATTRTYPE_LONG, VGServer::ATTRTYPE_LONGSTRING, VGServer::ATTRTYPE_QWORD, VGServer::ATTRTYPE_SHORT, VGServer::ATTRTYPE_STRING, VGServer::ATTRTYPE_WORD, and type.


Member Function Documentation

template<template< typename Type > class Operator, char OpName>
AnyType VGServer::AnyType::binary_arith_op ( const AnyType b  )  const

Binary arithmatic template operator.

Converts the two AnyTypes into the largest type of their common field. If a string cannot be converted to a numeric of the same field as the other operand a ConversionException is thrown. Bool types cannot be added.

Definition at line 1262 of file AnyType.cc.

References _double, _float, _int, _long, _uint, _ulong, AnyType(), VGServer::ATTRTYPE_BOOL, VGServer::ATTRTYPE_BYTE, VGServer::ATTRTYPE_CHAR, VGServer::ATTRTYPE_DOUBLE, VGServer::ATTRTYPE_DWORD, VGServer::ATTRTYPE_FLOAT, VGServer::ATTRTYPE_INTEGER, VGServer::ATTRTYPE_INVALID, VGServer::ATTRTYPE_LONG, VGServer::ATTRTYPE_LONGSTRING, VGServer::ATTRTYPE_QWORD, VGServer::ATTRTYPE_SHORT, VGServer::ATTRTYPE_STRING, VGServer::ATTRTYPE_WORD, convertType(), getDouble(), getInteger(), getLong(), and type.

Referenced by operator-(), and operator/().

template<template< typename Type > class Operator, int OpNum>
bool VGServer::AnyType::binary_comp_op ( const AnyType b  )  const

Binary comparison template operator.

Converts the two AnyTypes into the largest type of their common field. If a string cannot be converted to a numeric of the same field as the other operand a ConversionException is thrown. Bool types cannot be added.

Definition at line 1733 of file AnyType.cc.

References _double, _float, _int, _long, _uint, _ulong, VGServer::ATTRTYPE_BOOL, VGServer::ATTRTYPE_BYTE, VGServer::ATTRTYPE_CHAR, VGServer::ATTRTYPE_DOUBLE, VGServer::ATTRTYPE_DWORD, VGServer::ATTRTYPE_FLOAT, VGServer::ATTRTYPE_INTEGER, VGServer::ATTRTYPE_INVALID, VGServer::ATTRTYPE_LONG, VGServer::ATTRTYPE_LONGSTRING, VGServer::ATTRTYPE_QWORD, VGServer::ATTRTYPE_SHORT, VGServer::ATTRTYPE_STRING, VGServer::ATTRTYPE_WORD, convertType(), getDouble(), getInteger(), getLong(), getUnsignedLong(), and type.

bool VGServer::AnyType::convertType ( attrtype_t  t  ) 

changes the current type: returns false if the current value could not be converted to the new type, the new type is set nonetheless.

Definition at line 1092 of file AnyType.cc.

References VGServer::ATTRTYPE_BOOL, VGServer::ATTRTYPE_BYTE, VGServer::ATTRTYPE_CHAR, VGServer::ATTRTYPE_DOUBLE, VGServer::ATTRTYPE_DWORD, VGServer::ATTRTYPE_FLOAT, VGServer::ATTRTYPE_INTEGER, VGServer::ATTRTYPE_INVALID, VGServer::ATTRTYPE_LONG, VGServer::ATTRTYPE_LONGSTRING, VGServer::ATTRTYPE_QWORD, VGServer::ATTRTYPE_SHORT, VGServer::ATTRTYPE_STRING, VGServer::ATTRTYPE_WORD, getBoolean(), getDouble(), getInteger(), getLong(), getString(), and getUnsignedInteger().

Referenced by binary_arith_op(), binary_comp_op(), operator-(), VGServer::TpAttributeBlob< AllocPolicy >::putAttrChainValue(), VGServer::GraphLoader::setEdgeAttr(), and VGServer::GraphLoader::setVertexAttr().

bool VGServer::AnyType::getBoolean (  )  const

return the enclosed value in different types, converting if necessary if the enclosed value cannot be converted these functions throw a ConversionError exception.

Definition at line 716 of file AnyType.cc.

References VGServer::ATTRTYPE_BOOL, VGServer::ATTRTYPE_BYTE, VGServer::ATTRTYPE_CHAR, VGServer::ATTRTYPE_DOUBLE, VGServer::ATTRTYPE_DWORD, VGServer::ATTRTYPE_FLOAT, VGServer::ATTRTYPE_INTEGER, VGServer::ATTRTYPE_INVALID, VGServer::ATTRTYPE_LONG, VGServer::ATTRTYPE_LONGSTRING, VGServer::ATTRTYPE_QWORD, VGServer::ATTRTYPE_SHORT, VGServer::ATTRTYPE_STRING, and VGServer::ATTRTYPE_WORD.

Referenced by convertType().

double VGServer::AnyType::getDouble (  )  const

Definition at line 962 of file AnyType.cc.

References VGServer::ATTRTYPE_BOOL, VGServer::ATTRTYPE_BYTE, VGServer::ATTRTYPE_CHAR, VGServer::ATTRTYPE_DOUBLE, VGServer::ATTRTYPE_DWORD, VGServer::ATTRTYPE_FLOAT, VGServer::ATTRTYPE_INTEGER, VGServer::ATTRTYPE_INVALID, VGServer::ATTRTYPE_LONG, VGServer::ATTRTYPE_LONGSTRING, VGServer::ATTRTYPE_QWORD, VGServer::ATTRTYPE_SHORT, VGServer::ATTRTYPE_STRING, and VGServer::ATTRTYPE_WORD.

Referenced by binary_arith_op(), binary_comp_op(), convertType(), and VGServer::TpAttributeBlob< AllocPolicy >::putAnyType().

int VGServer::AnyType::getInteger (  )  const

Definition at line 770 of file AnyType.cc.

References VGServer::ATTRTYPE_BOOL, VGServer::ATTRTYPE_BYTE, VGServer::ATTRTYPE_CHAR, VGServer::ATTRTYPE_DOUBLE, VGServer::ATTRTYPE_DWORD, VGServer::ATTRTYPE_FLOAT, VGServer::ATTRTYPE_INTEGER, VGServer::ATTRTYPE_INVALID, VGServer::ATTRTYPE_LONG, VGServer::ATTRTYPE_LONGSTRING, VGServer::ATTRTYPE_QWORD, VGServer::ATTRTYPE_SHORT, VGServer::ATTRTYPE_STRING, and VGServer::ATTRTYPE_WORD.

Referenced by VGServer::AttributeProperties::appendBinaryFormat(), VGServer::GraphContainer::applyChangelist(), binary_arith_op(), binary_comp_op(), convertType(), VGServer::FilterRoot::eval_edge(), VGServer::FilterRoot::eval_vertex(), VGServer::GraphContainer::RTreeDataCallback::getMBR(), VGServer::TpAttributeBlob< AllocPolicy >::putAnyType(), VGServer::TpAttributeBlob< AllocPolicy >::putAttrChainValue(), VGServer::GraphLoader::setEdgeAttr(), and VGServer::GraphLoader::setVertexAttr().

long long VGServer::AnyType::getLong (  )  const

Definition at line 870 of file AnyType.cc.

References VGServer::ATTRTYPE_BOOL, VGServer::ATTRTYPE_BYTE, VGServer::ATTRTYPE_CHAR, VGServer::ATTRTYPE_DOUBLE, VGServer::ATTRTYPE_DWORD, VGServer::ATTRTYPE_FLOAT, VGServer::ATTRTYPE_INTEGER, VGServer::ATTRTYPE_INVALID, VGServer::ATTRTYPE_LONG, VGServer::ATTRTYPE_LONGSTRING, VGServer::ATTRTYPE_QWORD, VGServer::ATTRTYPE_SHORT, VGServer::ATTRTYPE_STRING, and VGServer::ATTRTYPE_WORD.

Referenced by binary_arith_op(), binary_comp_op(), convertType(), and VGServer::TpAttributeBlob< AllocPolicy >::putAnyType().

std::string VGServer::AnyType::getString (  )  const

Definition at line 1007 of file AnyType.cc.

References VGServer::ATTRTYPE_BOOL, VGServer::ATTRTYPE_BYTE, VGServer::ATTRTYPE_CHAR, VGServer::ATTRTYPE_DOUBLE, VGServer::ATTRTYPE_DWORD, VGServer::ATTRTYPE_FLOAT, VGServer::ATTRTYPE_INTEGER, VGServer::ATTRTYPE_INVALID, VGServer::ATTRTYPE_LONG, VGServer::ATTRTYPE_LONGSTRING, VGServer::ATTRTYPE_QWORD, VGServer::ATTRTYPE_SHORT, VGServer::ATTRTYPE_STRING, VGServer::ATTRTYPE_WORD, and g_snprintf.

Referenced by convertType(), VGServer::TpAttributeBlob< AllocPolicy >::putAnyType(), and VGServer::GraphData::writeFig().

attrtype_t VGServer::AnyType::getType (  )  const [inline]

return the type of the object

Definition at line 229 of file AnyType.h.

Referenced by VGServer::AttributeProperties::appendBinaryFormat(), VGServer::TpAttributeBlob< AllocPolicy >::getAnyType(), VGServer::TpAttributeBlob< AllocPolicy >::getAttrChainValue(), VGServer::TpAttributeBlob< AllocPolicy >::putAnyType(), and VGServer::TpAttributeBlob< AllocPolicy >::putAttrChainValue().

int VGServer::AnyType::getTypeLength ( attrtype_t  t  )  [static]

return the storage length of the type in bytes

Definition at line 227 of file AnyType.cc.

References VGServer::ATTRTYPE_BOOL, VGServer::ATTRTYPE_BYTE, VGServer::ATTRTYPE_CHAR, VGServer::ATTRTYPE_DOUBLE, VGServer::ATTRTYPE_DWORD, VGServer::ATTRTYPE_FLOAT, VGServer::ATTRTYPE_INTEGER, VGServer::ATTRTYPE_INVALID, VGServer::ATTRTYPE_LONG, VGServer::ATTRTYPE_LONGSTRING, VGServer::ATTRTYPE_QWORD, VGServer::ATTRTYPE_SHORT, VGServer::ATTRTYPE_STRING, and VGServer::ATTRTYPE_WORD.

int VGServer::AnyType::getTypeLength (  )  const [inline]

return the storage length of the type in bytes

Definition at line 264 of file AnyType.h.

Referenced by isFixedLength(), and VGServer::TpAttributeBlob< AllocPolicy >::putAttrChainValue().

std::string VGServer::AnyType::getTypeString (  )  const [inline]

returns a string for each this AnyType's type.

Definition at line 258 of file AnyType.h.

std::string VGServer::AnyType::getTypeString ( attrtype_t  at  )  [static]

returns a string for each attrtype_t.

Definition at line 205 of file AnyType.cc.

References VGServer::ATTRTYPE_BOOL, VGServer::ATTRTYPE_BYTE, VGServer::ATTRTYPE_CHAR, VGServer::ATTRTYPE_DOUBLE, VGServer::ATTRTYPE_DWORD, VGServer::ATTRTYPE_FLOAT, VGServer::ATTRTYPE_INTEGER, VGServer::ATTRTYPE_INVALID, VGServer::ATTRTYPE_LONG, VGServer::ATTRTYPE_LONGSTRING, VGServer::ATTRTYPE_QWORD, VGServer::ATTRTYPE_SHORT, VGServer::ATTRTYPE_STRING, and VGServer::ATTRTYPE_WORD.

unsigned int VGServer::AnyType::getUnsignedInteger (  )  const

Definition at line 823 of file AnyType.cc.

References VGServer::ATTRTYPE_BOOL, VGServer::ATTRTYPE_BYTE, VGServer::ATTRTYPE_CHAR, VGServer::ATTRTYPE_DOUBLE, VGServer::ATTRTYPE_DWORD, VGServer::ATTRTYPE_FLOAT, VGServer::ATTRTYPE_INTEGER, VGServer::ATTRTYPE_INVALID, VGServer::ATTRTYPE_LONG, VGServer::ATTRTYPE_LONGSTRING, VGServer::ATTRTYPE_QWORD, VGServer::ATTRTYPE_SHORT, VGServer::ATTRTYPE_STRING, and VGServer::ATTRTYPE_WORD.

Referenced by convertType(), and VGServer::TpAttributeBlob< AllocPolicy >::putAnyType().

unsigned long long VGServer::AnyType::getUnsignedLong (  )  const

Definition at line 915 of file AnyType.cc.

References VGServer::ATTRTYPE_BOOL, VGServer::ATTRTYPE_BYTE, VGServer::ATTRTYPE_CHAR, VGServer::ATTRTYPE_DOUBLE, VGServer::ATTRTYPE_DWORD, VGServer::ATTRTYPE_FLOAT, VGServer::ATTRTYPE_INTEGER, VGServer::ATTRTYPE_INVALID, VGServer::ATTRTYPE_LONG, VGServer::ATTRTYPE_LONGSTRING, VGServer::ATTRTYPE_QWORD, VGServer::ATTRTYPE_SHORT, VGServer::ATTRTYPE_STRING, and VGServer::ATTRTYPE_WORD.

Referenced by binary_comp_op(), and VGServer::TpAttributeBlob< AllocPolicy >::putAnyType().

unsigned int VGServer::AnyType::getValueLength (  )  const

return the storage length of this value (mark the different to getTypeLength()

Definition at line 278 of file AnyType.cc.

References VGServer::ATTRTYPE_BOOL, VGServer::ATTRTYPE_BYTE, VGServer::ATTRTYPE_CHAR, VGServer::ATTRTYPE_DOUBLE, VGServer::ATTRTYPE_DWORD, VGServer::ATTRTYPE_FLOAT, VGServer::ATTRTYPE_INTEGER, VGServer::ATTRTYPE_INVALID, VGServer::ATTRTYPE_LONG, VGServer::ATTRTYPE_LONGSTRING, VGServer::ATTRTYPE_QWORD, VGServer::ATTRTYPE_SHORT, VGServer::ATTRTYPE_STRING, and VGServer::ATTRTYPE_WORD.

Referenced by VGServer::TpAttributeBlob< AllocPolicy >::putAttrChainValue(), VGServer::GraphLoader::setEdgeAttr(), and VGServer::GraphLoader::setVertexAttr().

bool VGServer::AnyType::isFixedLength (  )  const [inline]

boolean check if this type is of fixed-length

Definition at line 275 of file AnyType.h.

static bool VGServer::AnyType::isFixedLength ( attrtype_t  t  )  [inline, static]

boolean check if this type is of fixed-length

Definition at line 271 of file AnyType.h.

References getTypeLength().

Referenced by VGServer::TpAttributeBlob< AllocPolicy >::putAttrChainValue().

bool VGServer::AnyType::isValidAttrtype ( attrtype_t  at  )  [static]

returns true if the attrtype_t is a valid type

Definition at line 180 of file AnyType.cc.

References VGServer::ATTRTYPE_BOOL, VGServer::ATTRTYPE_BYTE, VGServer::ATTRTYPE_CHAR, VGServer::ATTRTYPE_DOUBLE, VGServer::ATTRTYPE_DWORD, VGServer::ATTRTYPE_FLOAT, VGServer::ATTRTYPE_INTEGER, VGServer::ATTRTYPE_INVALID, VGServer::ATTRTYPE_LONG, VGServer::ATTRTYPE_LONGSTRING, VGServer::ATTRTYPE_QWORD, VGServer::ATTRTYPE_SHORT, VGServer::ATTRTYPE_STRING, and VGServer::ATTRTYPE_WORD.

bool VGServer::AnyType::op_equal_to ( const AnyType b  )  const [inline]

Definition at line 337 of file AnyType.h.

bool VGServer::AnyType::op_greater ( const AnyType b  )  const [inline]

Definition at line 346 of file AnyType.h.

bool VGServer::AnyType::op_greater_equal ( const AnyType b  )  const [inline]

Definition at line 352 of file AnyType.h.

bool VGServer::AnyType::op_less ( const AnyType b  )  const [inline]

Definition at line 343 of file AnyType.h.

bool VGServer::AnyType::op_less_equal ( const AnyType b  )  const [inline]

Definition at line 349 of file AnyType.h.

bool VGServer::AnyType::op_not_equal_to ( const AnyType b  )  const [inline]

Definition at line 340 of file AnyType.h.

AnyType VGServer::AnyType::operator * ( const AnyType b  )  const [inline]

Definition at line 327 of file AnyType.h.

bool VGServer::AnyType::operator!= ( const AnyType a  )  const [inline]

comparison operator: compares values _and_ types

Definition at line 225 of file AnyType.h.

AnyType VGServer::AnyType::operator+ ( const AnyType b  )  const [inline]

Definition at line 321 of file AnyType.h.

AnyType VGServer::AnyType::operator- ( const AnyType b  )  const [inline]

Definition at line 324 of file AnyType.h.

References binary_arith_op().

AnyType VGServer::AnyType::operator- (  )  const

unary prefix - operator.

Converts the AnyType to a numeric value. Bool values are inverted. Unsigned Types are handled just like signed types, even tho it doesnt make sense.

Definition at line 1202 of file AnyType.cc.

References _double, _float, _int, _long, _uint, _ulong, VGServer::ATTRTYPE_BOOL, VGServer::ATTRTYPE_BYTE, VGServer::ATTRTYPE_CHAR, VGServer::ATTRTYPE_DOUBLE, VGServer::ATTRTYPE_DWORD, VGServer::ATTRTYPE_FLOAT, VGServer::ATTRTYPE_INTEGER, VGServer::ATTRTYPE_INVALID, VGServer::ATTRTYPE_LONG, VGServer::ATTRTYPE_LONGSTRING, VGServer::ATTRTYPE_QWORD, VGServer::ATTRTYPE_SHORT, VGServer::ATTRTYPE_STRING, VGServer::ATTRTYPE_WORD, convertType(), and type.

AnyType VGServer::AnyType::operator/ ( const AnyType b  )  const [inline]

Definition at line 330 of file AnyType.h.

References binary_arith_op().

AnyType& VGServer::AnyType::operator= ( const AnyType a  )  [inline]

assignment operator to deal with enclosed strings

Definition at line 171 of file AnyType.h.

References _double, _float, _int, _long, _string, _uint, _ulong, VGServer::ATTRTYPE_BOOL, VGServer::ATTRTYPE_BYTE, VGServer::ATTRTYPE_CHAR, VGServer::ATTRTYPE_DOUBLE, VGServer::ATTRTYPE_DWORD, VGServer::ATTRTYPE_FLOAT, VGServer::ATTRTYPE_INTEGER, VGServer::ATTRTYPE_INVALID, VGServer::ATTRTYPE_LONG, VGServer::ATTRTYPE_LONGSTRING, VGServer::ATTRTYPE_QWORD, VGServer::ATTRTYPE_SHORT, VGServer::ATTRTYPE_STRING, VGServer::ATTRTYPE_WORD, and type.

bool VGServer::AnyType::operator== ( const AnyType a  )  const

comparison operator: compares values _and_ types

Definition at line 99 of file AnyType.cc.

References _double, _float, _int, _long, _string, _uint, _ulong, VGServer::ATTRTYPE_BOOL, VGServer::ATTRTYPE_BYTE, VGServer::ATTRTYPE_CHAR, VGServer::ATTRTYPE_DOUBLE, VGServer::ATTRTYPE_DWORD, VGServer::ATTRTYPE_FLOAT, VGServer::ATTRTYPE_INTEGER, VGServer::ATTRTYPE_INVALID, VGServer::ATTRTYPE_LONG, VGServer::ATTRTYPE_LONGSTRING, VGServer::ATTRTYPE_QWORD, VGServer::ATTRTYPE_SHORT, VGServer::ATTRTYPE_STRING, VGServer::ATTRTYPE_WORD, and type.

void VGServer::AnyType::resetType ( attrtype_t  t  ) 

changes the current type and resets the contents without attempting to convert the enclosed value.

Reimplemented in VGServer::AttributeProperties.

Definition at line 1073 of file AnyType.cc.

References VGServer::ATTRTYPE_LONGSTRING, and VGServer::ATTRTYPE_STRING.

Referenced by VGServer::AttributeProperties::resetType().

bool VGServer::AnyType::setDouble ( double  d  ) 

Definition at line 521 of file AnyType.cc.

References VGServer::ATTRTYPE_BOOL, VGServer::ATTRTYPE_BYTE, VGServer::ATTRTYPE_CHAR, VGServer::ATTRTYPE_DOUBLE, VGServer::ATTRTYPE_DWORD, VGServer::ATTRTYPE_FLOAT, VGServer::ATTRTYPE_INTEGER, VGServer::ATTRTYPE_INVALID, VGServer::ATTRTYPE_LONG, VGServer::ATTRTYPE_LONGSTRING, VGServer::ATTRTYPE_QWORD, VGServer::ATTRTYPE_SHORT, VGServer::ATTRTYPE_STRING, VGServer::ATTRTYPE_WORD, g_snprintf, setInteger(), and setLong().

Referenced by VGServer::TpAttributeBlob< AllocPolicy >::getAnyType().

bool VGServer::AnyType::setInteger ( int  i  ) 

sets the value, converting the input if necessary.

returns false if the input could not be converted into the right type.

Definition at line 332 of file AnyType.cc.

References VGServer::ATTRTYPE_BOOL, VGServer::ATTRTYPE_BYTE, VGServer::ATTRTYPE_CHAR, VGServer::ATTRTYPE_DOUBLE, VGServer::ATTRTYPE_DWORD, VGServer::ATTRTYPE_FLOAT, VGServer::ATTRTYPE_INTEGER, VGServer::ATTRTYPE_INVALID, VGServer::ATTRTYPE_LONG, VGServer::ATTRTYPE_LONGSTRING, VGServer::ATTRTYPE_QWORD, VGServer::ATTRTYPE_SHORT, VGServer::ATTRTYPE_STRING, and VGServer::ATTRTYPE_WORD.

Referenced by VGServer::TpAttributeBlob< AllocPolicy >::getAnyType(), VGServer::TpAttributeBlob< AllocPolicy >::getAttrChainValue(), setDouble(), and setString().

bool VGServer::AnyType::setLong ( long long  l  ) 

Definition at line 426 of file AnyType.cc.

References VGServer::ATTRTYPE_BOOL, VGServer::ATTRTYPE_BYTE, VGServer::ATTRTYPE_CHAR, VGServer::ATTRTYPE_DOUBLE, VGServer::ATTRTYPE_DWORD, VGServer::ATTRTYPE_FLOAT, VGServer::ATTRTYPE_INTEGER, VGServer::ATTRTYPE_INVALID, VGServer::ATTRTYPE_LONG, VGServer::ATTRTYPE_LONGSTRING, VGServer::ATTRTYPE_QWORD, VGServer::ATTRTYPE_SHORT, VGServer::ATTRTYPE_STRING, and VGServer::ATTRTYPE_WORD.

Referenced by VGServer::TpAttributeBlob< AllocPolicy >::getAnyType(), setDouble(), and setString().

bool VGServer::AnyType::setString ( const std::string &  s  ) 

Definition at line 578 of file AnyType.cc.

References VGServer::ATTRTYPE_BOOL, VGServer::ATTRTYPE_BYTE, VGServer::ATTRTYPE_CHAR, VGServer::ATTRTYPE_DOUBLE, VGServer::ATTRTYPE_DWORD, VGServer::ATTRTYPE_FLOAT, VGServer::ATTRTYPE_INTEGER, VGServer::ATTRTYPE_INVALID, VGServer::ATTRTYPE_LONG, VGServer::ATTRTYPE_LONGSTRING, VGServer::ATTRTYPE_QWORD, VGServer::ATTRTYPE_SHORT, VGServer::ATTRTYPE_STRING, VGServer::ATTRTYPE_WORD, setInteger(), and setLong().

Referenced by VGServer::TpAttributeBlob< AllocPolicy >::getAnyType(), and setStringQuoted().

bool VGServer::AnyType::setStringQuoted ( const std::string &  s  ) 

Definition at line 671 of file AnyType.cc.

References setString().

attrtype_t VGServer::AnyType::stringToType ( const char *  s  )  [static]

returns the attrtype enum value of a string, throws ConversionException if it cannot be determined.

Definition at line 141 of file AnyType.cc.

References VGServer::ATTRTYPE_BOOL, VGServer::ATTRTYPE_BYTE, VGServer::ATTRTYPE_CHAR, VGServer::ATTRTYPE_DOUBLE, VGServer::ATTRTYPE_DWORD, VGServer::ATTRTYPE_FLOAT, VGServer::ATTRTYPE_INTEGER, VGServer::ATTRTYPE_LONG, VGServer::ATTRTYPE_LONGSTRING, VGServer::ATTRTYPE_QWORD, VGServer::ATTRTYPE_SHORT, VGServer::ATTRTYPE_STRING, VGServer::ATTRTYPE_WORD, and VGServer::g_strcasecmp().

static attrtype_t VGServer::AnyType::stringToType ( const std::string &  s  )  [inline, static]

returns the attrtype enum value of a string, throws ConversionException if it cannot be determined.

Definition at line 247 of file AnyType.h.


The documentation for this class was generated from the following files:
Generated on Wed Sep 27 14:34:01 2006 for VGServer by  doxygen 1.4.7