diff --git a/include/hepnos/DataSet.hpp b/include/hepnos/DataSet.hpp index e29fb29334222b73502fd05ccdd62fb493a495d1..16eca9b87df394fcac0452bb34e0660e329746fb 100644 --- a/include/hepnos/DataSet.hpp +++ b/include/hepnos/DataSet.hpp @@ -43,31 +43,6 @@ class DataSet { */ DataSet(DataStore* ds, uint8_t level, const std::string& container, const std::string& name); - /** - * @brief Stores binary data associated with a particular key into this DataSet. - * This function will return true if the key did not already exist and the - * write succeeded. It will return false otherwise. - * - * @param key Key. - * @param buffer Binary data to insert. - * - * @return trye if the key did not already exist and the write succeeded, - * false otherwise. - */ - bool storeBuffer(const std::string& key, const std::vector& buffer); - - /** - * @brief Loads binary data associated with a particular key from the DataSet. - * This function will return true if the key exists and the read succeeded. - * It will return false otherwise. - * - * @param key Key. - * @param buffer Buffer in which to put the binary data. - * - * @return true if the key exists and the read succeeded, - * false otherwise. - */ - bool loadBuffer(const std::string& key, std::vector& buffer) const; /** * @brief Implementation class (used for the Pimpl idiom). @@ -162,6 +137,32 @@ class DataSet { */ bool valid() const; + /** + * @brief Stores binary data associated with a particular key into this DataSet. + * This function will return true if the key did not already exist and the + * write succeeded. It will return false otherwise. + * + * @param key Key. + * @param buffer Binary data to insert. + * + * @return trye if the key did not already exist and the write succeeded, + * false otherwise. + */ + bool storeRawData(const std::string& key, const std::vector& buffer); + + /** + * @brief Loads binary data associated with a particular key from the DataSet. + * This function will return true if the key exists and the read succeeded. + * It will return false otherwise. + * + * @param key Key. + * @param buffer Buffer in which to put the binary data. + * + * @return true if the key exists and the read succeeded, + * false otherwise. + */ + bool loadRawData(const std::string& key, std::vector& buffer) const; + /** * @brief Stores a key/value pair into the DataSet. * The type of the key should have operator<< available @@ -188,7 +189,7 @@ class DataSet { } std::string serialized = ss_value.str(); std::vector buffer(serialized.begin(), serialized.end()); - return storeBuffer(key, buffer); + return storeRawData(key, buffer); } /** @@ -209,7 +210,7 @@ class DataSet { template bool load(const K& key, V& value) const { std::vector buffer; - if(!loadBuffer(key, buffer)) { + if(!loadRawData(key, buffer)) { return false; } try { diff --git a/src/DataSet.cpp b/src/DataSet.cpp index ed6a4b598d1632852fa4e868b9ab4b274447e034..568e8583fe09a27dd1540cdd2cd225162e1b42b9 100644 --- a/src/DataSet.cpp +++ b/src/DataSet.cpp @@ -66,7 +66,7 @@ bool DataSet::valid() const { } -bool DataSet::storeBuffer(const std::string& key, const std::vector& buffer) { +bool DataSet::storeRawData(const std::string& key, const std::vector& buffer) { if(!valid()) { throw Exception("Calling store() on invalid DataSet"); } @@ -74,7 +74,7 @@ bool DataSet::storeBuffer(const std::string& key, const std::vector& buffe return m_impl->m_datastore->m_impl->store(0, fullname(), key, buffer); } -bool DataSet::loadBuffer(const std::string& key, std::vector& buffer) const { +bool DataSet::loadRawData(const std::string& key, std::vector& buffer) const { if(!valid()) { throw Exception("Calling load() on invalid DataSet"); }