libmoost
/home/mhx/git/github/libmoost/include/moost/kvds/kvds_integral_type.hpp
Go to the documentation of this file.
00001 /* vim:set ts=3 sw=3 sts=3 et: */
00028 
00029 
00030 #include "kvds_pod_type.hpp"
00031 
00032 #ifndef MOOST_KVDS_KVDS_INTEGRAL_TYPE_HPP__
00033 #define MOOST_KVDS_KVDS_INTEGRAL_TYPE_HPP__
00034 
00035 namespace moost { namespace kvds {
00036 
00050 
00052 
00053    template <typename T> // integral types are also pods but not the other way around!
00054    class KvdsIntegralType : public KvdsPodType<T> 
00055    {
00056    public:
00057       typedef T kvds_type;
00058 
00060       BOOST_STATIC_ASSERT(boost::is_integral<T>::value);
00061 
00063       KvdsIntegralType(T & t) : KvdsPodType<T>(t) {}
00064 
00066       KvdsIntegralType(KvdsIntegralType const & t) : KvdsPodType<T>(t) {}
00067 
00069       KvdsIntegralType & operator = (KvdsIntegralType const & rhs)
00070       {
00071          this->t_ = rhs.t_;
00072          this->size_ = rhs.size_;
00073       }
00074    };
00075 
00076 }}
00077 
00078 #endif // MOOST_KVDS_KVDS_INTEGRAL_TYPE_HPP__