libmoost
|
00001 /* vim:set ts=3 sw=3 sts=3 et: */ 00028 00029 00030 00031 #ifndef MOOST_KVSTORE_KYOTO_TYCOON_CONNECTION_INTERFACE_H 00032 #define MOOST_KVSTORE_KYOTO_TYCOON_CONNECTION_INTERFACE_H 00033 00034 #include <boost/shared_array.hpp> 00035 #include <boost/cstdint.hpp> 00036 00037 #include "connection.h" 00038 00039 namespace moost { namespace kvstore { 00040 00041 class IKyotoTycoonConnection : public IConnection 00042 { 00043 public: 00044 00045 virtual ~IKyotoTycoonConnection() { } 00046 00047 public: 00048 00049 // native store methods 00050 00051 // return value is a C-style string of length vsize 00052 // (not including the trailing null byte) 00053 virtual boost::shared_array<char> get(const void* pkey, size_t ksize, size_t& vsize) const = 0; 00054 00055 // throws on failure 00056 virtual void set(const void* pkey, size_t ksize, const void* pval, size_t vsize) const = 0; 00057 00058 // throws on failure 00059 virtual void cache(const void* pkey, size_t ksize, const void* pval, size_t vsize, boost::int64_t expirySecs) const = 0; 00060 }; 00061 00062 }} // end namespace 00063 00064 #endif