00001 #ifndef ADDRESS_CONVENIENCE_HPP_
00002 #define ADDRESS_CONVENIENCE_HPP_
00003
00004 #include <string>
00005 #include "compare_to_operators.hpp"
00006
00007 namespace ariba {
00008 namespace addressing {
00009 namespace detail {
00010
00016 template<class T>
00017 class address_convenience : public compare_to_operators<T> {
00018 public:
00020 inline T& operator=( const T& rhs ) {
00021 static_cast<T*>(this)->assign(rhs);
00022 return *this;
00023 }
00024
00026 inline T& operator=( const char* text ) {
00027 static_cast<T*>(this)->assign(text);
00028 return *this;
00029 }
00030
00032 inline T& operator=( const std::string& text ) {
00033 static_cast<T*>(this)->assign(text);
00034 return *this;
00035 }
00036
00038 inline T& assign( const char* text ) {
00039 static_cast<T*>(this)->assign( std::string(text) );
00040 return *this;
00041 }
00042 };
00043
00044 }}}
00045
00046 #endif