Written first version of the blobstore interface

This commit is contained in:
Sebastian Messmer 2014-12-05 04:50:50 +01:00
parent 47a35c94b4
commit 90c49dabc6
4 changed files with 51 additions and 0 deletions

View File

@ -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

View File

@ -0,0 +1,25 @@
#pragma once
#ifndef FSPP_BLOBSTORE_BLOBSTORE_H_
#define FSPP_BLOBSTORE_BLOBSTORE_H_
#include <string>
#include <memory>
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<Blob> create(const std::string &key) = 0;
virtual std::unique_ptr<Blob> 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

View File

@ -0,0 +1,4 @@
/*
* Tests that the header can be included without needing additional header includes as dependencies.
*/
#include "blobstore/interface/BlobStore.h"

View File

@ -0,0 +1,4 @@
/*
* Tests that the header can be included without needing additional header includes as dependencies.
*/
#include "blobstore/interface/Blob.h"