store_data.h

00001 #ifndef _DHT_STORE_DATA_H_
00002 #define _DHT_STORE_DATA_H_
00003 
00004 #include "basic_data.h"
00005 
00006 namespace dht {
00019     class store_data : public basic_data {
00020         bool _allow_hash_transform;
00021 
00022         // Since this class is not meant to be used by itself,
00023         // disallow constructor and destructor except by key and value 
00024         // classes
00025         inline store_data(bool aht);
00026         inline store_data(const void *data, size_t len, bool aht);
00027         inline store_data(const char *str, bool aht);
00028         inline store_data(const std::string &str, bool aht);
00029         // inline store_data(const store_data &o);
00030 
00031         virtual ~store_data();
00032         
00033         friend class key;
00034         friend class value;
00035     public:     
00039         inline bool allow_hash_transform() const;
00043         inline void allow_hash_transform(bool a);
00044         
00045         // inline store_data &operator=(const store_data &o);
00046     };
00047     
00048     inline store_data::store_data(bool aht) : basic_data() { 
00049         _allow_hash_transform = aht;
00050     }
00051     
00052     inline store_data::store_data(const void *data, size_t len, bool aht) 
00053         : basic_data(data, len) { _allow_hash_transform = aht; }
00054 
00055     inline store_data::store_data(const char *str, bool aht) 
00056         : basic_data(str) 
00057     {
00058         _allow_hash_transform = aht;
00059     }
00060         
00061     inline store_data::store_data(const std::string &str, bool aht) 
00062         : basic_data(str) 
00063     {
00064         _allow_hash_transform = aht;
00065     }
00066 
00067 /*
00068     inline store_data::store_data(const store_data &o) : basic_data(o) { 
00069         _allow_hash_transform = o._allow_hash_transform;
00070     }
00071 */
00072     inline bool 
00073     store_data::allow_hash_transform() const { return _allow_hash_transform; }
00074     inline void
00075     store_data::allow_hash_transform(bool a) { _allow_hash_transform = a; }
00076 
00077 /*    
00078     inline store_data &store_data::operator=(const store_data &o) {
00079         basic_data::operator=(o);
00080         _allow_hash_transform = o._allow_hash_transform;
00081         return *this;
00082     }
00083 */    
00084     
00085 }
00086 
00087 #endif //_VALUE_H_

Generated on Thu Mar 1 16:18:47 2007 for libdht by  doxygen 1.5.1