+ LbsObject();
+ ~LbsObject();
+
+ // If an object is placed in a group, it will be written out to segments
+ // only containing other objects in the same group. A group name is simply
+ // a string.
+ //std::string get_group() const { return group; }
+ void set_group(const std::string &g) { group = g; }
+
+ // Data in an object must be written all at once, and cannot be generated
+ // incrementally. Data can be an arbitrary block of binary data of any
+ // size. The pointer to the data need only remain valid until write() is
+ // called.
+ void set_data(const char *d, size_t len) { data = d; data_len = len; }
+
+ // Write an object to a segment, thus making it permanent. This function
+ // can be called at most once.
+ void write(TarSegmentStore *store);
+
+ // Compute the checksum of an object, and include it in the object
+ // reference. This should be called after write(), and the data specified
+ // by set_data() must remain valid through the call to checksum().
+ void checksum();
+
+ // An object is assigned a permanent name once it has been written to a
+ // segment. Until that time, its name cannot be determined.
+ std::string get_name() const { return ref.to_string(); }
+ ObjectReference get_ref() { return ref; }
+
+private:
+ std::string group;
+ const char *data;
+ size_t data_len;