Created
April 4, 2010 06:44
-
-
Save argv0/355176 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef RIAK_OBJECT_HPP_ | |
#define RIAK_OBJECT_HPP_ | |
#include <string> | |
#include <vector> | |
#include <map> | |
#include "vclock.hpp" | |
typedef std::map<std::string, std::string> metadata_map_t; | |
class riak_content { | |
metadata_map_t metadata_; | |
size_t value_len_; | |
void *value_; | |
}; | |
typedef std::vector<riak_content> riak_contents_t; | |
class riak_object { | |
private: | |
size_t bucket_len_; | |
void *bucket_; | |
size_t key_len_; | |
void *key_; | |
vclock *vclock_; | |
riak_contents_t contents_; | |
metadata_map_t update_metadata_; | |
size_t update_value_len_; | |
void *update_value_; | |
public: | |
riak_object() : | |
bucket_len_(0), | |
bucket_(0), | |
key_len_(0), | |
key_(0), | |
vclock_(new vclock()), | |
contents_(), | |
update_metadata_(), | |
update_value_len_(0), | |
update_value_(0) {} | |
~riak_object() { | |
if (vclock_) | |
delete vclock_; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment