summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libdbpp/types.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/libdbpp/types.h b/libdbpp/types.h
index 3db6807..79a828d 100644
--- a/libdbpp/types.h
+++ b/libdbpp/types.h
@@ -6,15 +6,19 @@
#include <vector>
namespace DB {
+ /// Wrapper class for reference an existing block of binary data.
class DLL_PUBLIC Blob {
public:
+ /// Construct a reference using C-style pointer and length.
Blob(const void * data, size_t len);
+ /// Construct a reference using C++ template pointer to an object.
template<typename T>
Blob(const T * t) :
data(t),
len(sizeof(T))
{
}
+ /// Construct a reference using C++ vector pointer to a collection of objects.
template<typename T>
Blob(const std::vector<T> & v) :
data(&v.front()),
@@ -22,7 +26,9 @@ namespace DB {
{
}
+ /// The beginning of the binary data.
const void * data;
+ /// The length of the binary data.
size_t len;
};
}