aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/s3-binary-cache-store.cc
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-12-20 15:33:12 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-12-20 15:47:14 +0000
commit1a1af75338cb9ed28dc00de2e696d8efc5d37287 (patch)
tree75d1c9758d5b2cf1ae453145ed170fdbf108ab10 /src/libstore/s3-binary-cache-store.cc
parentec3e20283216374c15843c403363a890221d3fcb (diff)
Overhaul store subclassing
We embrace virtual the rest of the way, and get rid of the `assert(false)` 0-param constructors. We also list config base classes first, so the constructor order is always: 1. all the configs 2. all the stores Each in the same order
Diffstat (limited to 'src/libstore/s3-binary-cache-store.cc')
-rw-r--r--src/libstore/s3-binary-cache-store.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/libstore/s3-binary-cache-store.cc b/src/libstore/s3-binary-cache-store.cc
index d6edafd7e..6bfbee044 100644
--- a/src/libstore/s3-binary-cache-store.cc
+++ b/src/libstore/s3-binary-cache-store.cc
@@ -177,6 +177,11 @@ S3Helper::FileTransferResult S3Helper::getObject(
return res;
}
+S3BinaryCacheStore::S3BinaryCacheStore(const Params & params)
+ : BinaryCacheStoreConfig(params)
+ , BinaryCacheStore(params)
+{ }
+
struct S3BinaryCacheStoreConfig : virtual BinaryCacheStoreConfig
{
using BinaryCacheStoreConfig::BinaryCacheStoreConfig;
@@ -195,7 +200,7 @@ struct S3BinaryCacheStoreConfig : virtual BinaryCacheStoreConfig
const std::string name() override { return "S3 Binary Cache Store"; }
};
-struct S3BinaryCacheStoreImpl : public S3BinaryCacheStore, virtual S3BinaryCacheStoreConfig
+struct S3BinaryCacheStoreImpl : virtual S3BinaryCacheStoreConfig, public virtual S3BinaryCacheStore
{
std::string bucketName;
@@ -208,6 +213,10 @@ struct S3BinaryCacheStoreImpl : public S3BinaryCacheStore, virtual S3BinaryCache
const std::string & bucketName,
const Params & params)
: StoreConfig(params)
+ , BinaryCacheStoreConfig(params)
+ , S3BinaryCacheStoreConfig(params)
+ , Store(params)
+ , BinaryCacheStore(params)
, S3BinaryCacheStore(params)
, bucketName(bucketName)
, s3Helper(profile, region, scheme, endpoint)