9 #ifndef RMF_BUFFER_CONST_HANDLE_H
10 #define RMF_BUFFER_CONST_HANDLE_H
12 #include "RMF/config.h"
31 std::shared_ptr<std::vector<char> > data_;
33 if (&*data_ < &*o.data_)
35 else if (&*data_ > &*o.data_)
44 : data_(std::make_shared<std::vector<char> >(r.begin(), r.end())) {}
47 : data_(std::make_shared<std::vector<char> >(r.begin(), r.end())) {}
49 : data_(std::make_shared<std::vector<char> >(r.begin(), r.end())) {}
52 const std::vector<char> &get_buffer()
const {
return *data_; }
56 return std::string(data_->begin(), data_->end());
62 #if !defined(IMP_DOXYGEN) && !defined(SWIG)
63 std::pair<const uint8_t *, size_t> get_uint8_t()
const {
64 return std::make_pair(reinterpret_cast<const uint8_t *>(&(*data_)[0]),
67 std::shared_ptr<std::vector<char> >
get()
const {
return data_; }
76 RMFEXPORT BufferConstHandle read_buffer(std::string file_name);
78 RMFEXPORT
void write_buffer(BufferConstHandle buffer, std::string file_name);
Manage a shared buffer for loading a RMF.
std::string get_string() const
get the buffer encoded in a string
std::size_t hash_value(const BufferConstHandle &t)
Produce hash values for boost hash tables.
Declarations of the various exception types.
#define RMF_COMPARISONS(Name)
Implement comparison in a class using field as the variable to compare.
#define RMF_HASHABLE(name, hashret)
Implement a hash function for the class.
Various general useful macros for IMP.