diff --git a/src/blobstore/interface/Blob.h b/src/blobstore/interface/Blob.h new file mode 100644 index 00000000..fc8c5803 --- /dev/null +++ b/src/blobstore/interface/Blob.h @@ -0,0 +1,18 @@ +#pragma once +#ifndef BLOBSTORE_INTERFACE_BLOB_H_ +#define BLOBSTORE_INTERFACE_BLOB_H_ + +namespace blobstore { + +class Blob { +public: + virtual ~Blob() {} + + virtual void *data() = 0; + virtual const void *data() const = 0; +}; + +} + + +#endif diff --git a/src/blobstore/interface/BlobStore.h b/src/blobstore/interface/BlobStore.h new file mode 100644 index 00000000..95269f29 --- /dev/null +++ b/src/blobstore/interface/BlobStore.h @@ -0,0 +1,25 @@ +#pragma once +#ifndef FSPP_BLOBSTORE_BLOBSTORE_H_ +#define FSPP_BLOBSTORE_BLOBSTORE_H_ + +#include +#include + +namespace blobstore { +class Blob; + +//TODO Don't use string, but own class for keys? (better performance for all keys have same length) + +class BlobStore { +public: + virtual ~BlobStore() {} + + virtual std::unique_ptr create(const std::string &key) = 0; + virtual std::unique_ptr load(const std::string &key) = 0; + //TODO Needed for performance? Or is deleting loaded blobs enough? + //virtual void remove(const std::string &key) = 0; +}; + +} + +#endif diff --git a/src/test/blobstore/interface/BlobStoreTest.cpp b/src/test/blobstore/interface/BlobStoreTest.cpp new file mode 100644 index 00000000..df4e30c9 --- /dev/null +++ b/src/test/blobstore/interface/BlobStoreTest.cpp @@ -0,0 +1,4 @@ +/* + * Tests that the header can be included without needing additional header includes as dependencies. + */ +#include "blobstore/interface/BlobStore.h" diff --git a/src/test/blobstore/interface/BlobTest.cpp b/src/test/blobstore/interface/BlobTest.cpp new file mode 100644 index 00000000..ab79673c --- /dev/null +++ b/src/test/blobstore/interface/BlobTest.cpp @@ -0,0 +1,4 @@ +/* + * Tests that the header can be included without needing additional header includes as dependencies. + */ +#include "blobstore/interface/Blob.h"