33 #ifndef WALLAROO_ATTRIBUTE_H_
34 #define WALLAROO_ATTRIBUTE_H_
55 template <
typename T >
58 std::istringstream istream( v );
59 if ( !( istream >> std::boolalpha >> value ) )
92 template <
typename T >
107 owner -> Register( name,
this );
114 virtual void Value(
const std::string& v )
122 operator T () {
return value; }
127 operator T ()
const {
return value; }
133 const char*
c_str()
const {
return value.c_str(); }
162 template <
typename T >
bool operator < ( const Attribute< T >& lhs,
const T& rhs ){
return static_cast< T
>( lhs ) < rhs; }
164 template <
typename T >
bool operator <= ( const Attribute< T >& lhs,
const T& rhs ){
return operator<( lhs, rhs ) ||
operator==( lhs, rhs ); }
173 template <
typename T >
bool operator < ( const T& lhs, const Attribute< T >& rhs ){
return operator>( rhs, lhs ); }
175 template <
typename T >
bool operator <= ( const T& lhs, const Attribute< T >& rhs ){
return !
operator>( lhs, rhs ); }
184 template <
typename T >
185 std::ostream& operator << ( std::ostream& os, const Attribute< T >& att )
187 os << static_cast< T >( att );
virtual void Value(const std::string &v)
Definition: attribute.h:114
Attribute & operator--()
Definition: attribute.h:141
T operator++(int)
Definition: attribute.h:139
Part * GetPart() const
Definition: part.h:60
Definition: attribute.h:93
Attribute & operator++()
Definition: attribute.h:138
T operator+(const Attribute< T > &lhs, const Attribute< T > &rhs)
Definition: attribute.h:179
Attribute & operator*=(const T &rhs)
Definition: attribute.h:146
const char * c_str() const
Definition: attribute.h:133
void String2Value< unsigned char >(const std::string &v, unsigned char &value)
Definition: attribute.h:68
void String2Value(const std::string &v, T &value)
Definition: attribute.h:56
Attribute & operator/=(const T &rhs)
Definition: attribute.h:147
bool operator<(const Attribute< T > &lhs, const T &rhs)
Definition: attribute.h:162
void String2Value< std::string >(const std::string &v, std::string &value)
Definition: attribute.h:77
bool operator>(const Attribute< T > &lhs, const T &rhs)
Definition: attribute.h:163
Attribute & operator+=(const T &rhs)
Definition: attribute.h:144
bool operator<=(const Attribute< T > &lhs, const T &rhs)
Definition: attribute.h:164
Attribute(const std::string &name, const RegToken &token)
Definition: attribute.h:104
Attribute & operator=(const Attribute &a)
Definition: attribute.h:135
bool operator>=(const Attribute< T > &lhs, const T &rhs)
Definition: attribute.h:165
T operator--(int)
Definition: attribute.h:142
bool operator!=(const Attribute< T > &lhs, const T &rhs)
Definition: attribute.h:160
Definition: attribute.h:45
Attribute & operator-=(const T &rhs)
Definition: attribute.h:145
Definition: deserializable_value.h:47
Definition: exceptions.h:110
bool operator==(const Attribute< T > &lhs, const T &rhs)
Definition: attribute.h:159