Skip to content

Commit f0f1793

Browse files
committed
loadFileToMemory with std::vector instead of o2::pmr::vectot
For debugging purposes only
1 parent 359b736 commit f0f1793

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

CCDB/include/CCDB/CcdbApi.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,11 @@ class CcdbApi //: public DatabaseInterface
348348
TObject* retrieveFromTFile(std::string const& path, std::map<std::string, std::string> const& metadata, long timestamp,
349349
std::map<std::string, std::string>* headers, std::string const& etag,
350350
const std::string& createdNotAfter, const std::string& createdNotBefore) const;
351+
void loadFileToMemory(std::vector<char>& dest, std::string const& path,
352+
std::map<std::string, std::string> const& metadata, long timestamp,
353+
std::map<std::string, std::string>* headers, std::string const& etag,
354+
const std::string& createdNotAfter, const std::string& createdNotBefore, bool considerSnapshot = true) const;
355+
351356
#if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__ROOTCLING__) && !defined(__CLING__)
352357
typedef struct RequestContext {
353358
o2::pmr::vector<char>& dest;

CCDB/src/CcdbApi.cxx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1870,6 +1870,21 @@ void CcdbApi::saveSnapshot(RequestContext& requestContext) const
18701870
}
18711871
}
18721872

1873+
void CcdbApi::loadFileToMemory(std::vector<char>& dest, std::string const& path,
1874+
std::map<std::string, std::string> const& metadata, long timestamp,
1875+
std::map<std::string, std::string>* headers, std::string const& etag,
1876+
const std::string& createdNotAfter, const std::string& createdNotBefore, bool considerSnapshot) const
1877+
{
1878+
o2::pmr::vector<char> destP;
1879+
destP.reserve(dest.size());
1880+
loadFileToMemory(destP, path, metadata, timestamp, headers, etag, createdNotAfter, createdNotBefore, considerSnapshot);
1881+
dest.clear();
1882+
dest.reserve(destP.size());
1883+
for (const auto c : destP) {
1884+
dest.push_back(c);
1885+
}
1886+
}
1887+
18731888
void CcdbApi::loadFileToMemory(o2::pmr::vector<char>& dest, std::string const& path,
18741889
std::map<std::string, std::string> const& metadata, long timestamp,
18751890
std::map<std::string, std::string>* headers, std::string const& etag,

0 commit comments

Comments
 (0)