CatapultServer  v0.5.0.1 (Elephant)
DatabaseConfiguration.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include <boost/filesystem/path.hpp>
23 #include <string>
24 #include <unordered_set>
25 
26 namespace catapult { namespace utils { class ConfigurationBag; } }
27 
28 namespace catapult { namespace mongo {
29 
32  public:
34  std::string DatabaseUri;
35 
37  std::string DatabaseName;
38 
40  uint32_t MaxWriterThreads;
41 
43  std::unordered_set<std::string> Plugins;
44 
45  private:
46  DatabaseConfiguration() = default;
47 
48  public:
51 
52  public:
55 
57  static DatabaseConfiguration LoadFromPath(const boost::filesystem::path& resourcesPath);
58  };
59 }}
catapult::utils::VerifyBagSizeLte
void VerifyBagSizeLte(const ConfigurationBag &bag, size_t expectedSize)
Verifies that the number of properties in bag is no greater than expectedSize.
Definition: utils/ConfigurationUtils.cpp:38
catapult::mongo::DatabaseConfiguration::DatabaseConfiguration
DatabaseConfiguration()=default
catapult::mongo::DatabaseConfiguration::Uninitialized
static DatabaseConfiguration Uninitialized()
Creates an uninitialized database configuration.
Definition: DatabaseConfiguration.cpp:30
LOAD_DB_PROPERTY
#define LOAD_DB_PROPERTY(NAME)
catapult::mongo::DatabaseConfiguration::MaxWriterThreads
uint32_t MaxWriterThreads
Maximum number of database writer threads.
Definition: DatabaseConfiguration.h:40
catapult::mongo::DatabaseConfiguration::DatabaseUri
std::string DatabaseUri
Database uri.
Definition: DatabaseConfiguration.h:34
catapult::utils::ConfigurationBag
A simple bag of properties.
Definition: ConfigurationBag.h:57
ConfigurationFileLoader.h
catapult::mongo::DatabaseConfiguration::LoadFromPath
static DatabaseConfiguration LoadFromPath(const boost::filesystem::path &resourcesPath)
Loads a database configuration from resourcesPath.
Definition: DatabaseConfiguration.cpp:54
catapult::mongo::DatabaseConfiguration::DatabaseName
std::string DatabaseName
Database name.
Definition: DatabaseConfiguration.h:37
DatabaseConfiguration.h
catapult::mongo::DatabaseConfiguration::Plugins
std::unordered_set< std::string > Plugins
Named database plugins to enable.
Definition: DatabaseConfiguration.h:43
ConfigurationUtils.h
catapult::mongo::DatabaseConfiguration::LoadFromBag
static DatabaseConfiguration LoadFromBag(const utils::ConfigurationBag &bag)
Loads a database configuration from bag.
Definition: DatabaseConfiguration.cpp:34
ConfigurationBag.h
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::mongo::DatabaseConfiguration
Database configuration settings.
Definition: DatabaseConfiguration.h:31
catapult::utils::ExtractSectionAsUnorderedSet
std::pair< std::unordered_set< std::string >, size_t > ExtractSectionAsUnorderedSet(const ConfigurationBag &bag, const char *section)
Definition: utils/ConfigurationUtils.cpp:49