// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. /** * @class storage::ServiceLayerNodeContext * @ingroup storageserver * * @brief Context needed by node, that can also be used by others * * This utility class sets up the default component register implementation. * It also sets up the clock and the threadpool, such that the most basic * features are available to the provider, before the service layer is set up. */ #pragma once #include #include namespace storage { struct ServiceLayerNodeContext : public StorageNodeContext { // Typedefs to simplify the remainder of the interface using ComponentRegister = ServiceLayerComponentRegisterImpl; /** * You can provide your own clock implementation. Useful in testing where * you want to fake the clock. */ ServiceLayerNodeContext(std::unique_ptr clock, const ContentBucketDbOptions& db_opts); /** * Get the actual component register. Available as the actual type as the * storage server need to set implementations, and the components need the * actual component register interface. */ ComponentRegister& getComponentRegister() { return _componentRegister; } private: ComponentRegister& _componentRegister; }; } // storage