lintel 0.2.0
Loading...
Searching...
No Matches
DatabaseConnectionConfigurations.h
Go to the documentation of this file.
1#ifndef LINTEL_DATABASECONNECTIONCONFIGURATIONS_H
2#define LINTEL_DATABASECONNECTIONCONFIGURATIONS_H
3
4#include <map>
5#include <vector>
6
9
10namespace lintel {
15{
16private:
17 std::map<std::string, std::shared_ptr<DatabaseConnectionEntry>> m_connections;
18 std::shared_ptr<DatabaseConnectionEntry> m_defaultConnection;
19
25 static std::map<std::string, std::shared_ptr<DatabaseConnectionEntry>> build(
26 std::vector<std::shared_ptr<Entry>> entries);
27
33 static std::shared_ptr<DatabaseConnectionEntry> findDefault(const std::vector<std::shared_ptr<Entry>> &entries);
34
35public:
40 explicit DatabaseConnectionConfigurations(const std::shared_ptr<Configuration> &configuration);
41
43 [[nodiscard]] std::shared_ptr<DatabaseConnectionEntry> ofDefault();
44
50 [[nodiscard]] std::shared_ptr<DatabaseConnectionEntry> of(const std::string &connectionName);
51
53 [[nodiscard]] std::vector<std::shared_ptr<DatabaseConnectionEntry>> allOf();
54};
55
56}// namespace lintel
57#endif// LINTEL_DATABASECONNECTIONCONFIGURATIONS_H
Definition DatabaseConnectionConfigurations.h:15
std::shared_ptr< DatabaseConnectionEntry > of(const std::string &connectionName)
std::shared_ptr< DatabaseConnectionEntry > ofDefault()
std::vector< std::shared_ptr< DatabaseConnectionEntry > > allOf()
DatabaseConnectionConfigurations(const std::shared_ptr< Configuration > &configuration)
Definition BaseFeature.h:6
constexpr std::string_view type_name()
Definition TypeName.h:9