LogDevice API
ClientSettings.h
1 
8 #pragma once
9 
10 #include <string>
11 #include <utility>
12 #include <vector>
13 
14 #include <folly/Optional.h>
15 
21 namespace facebook { namespace logdevice {
22 
23 class ClientSettingsImpl; // private implementation
24 
26  public:
30  static ClientSettings* create();
31 
32  virtual ~ClientSettings() {}
33 
95  int set(const char* name, const char* value);
96 
97  // Overload for std::string
98  int set(const std::string& name, const std::string& value) {
99  return set(name.c_str(), value.c_str());
100  }
101 
102  // Overload for settings with integral settings, for convenience
103  int set(const char* name, int64_t value);
104 
110  int set(const std::vector<std::pair<std::string, std::string>>& settings);
111 
117  folly::Optional<std::string> get(const std::string& name);
118 
124  bool isOverridden(const std::string& name);
125 
129  std::vector<std::pair<std::string, std::string>> getAll();
130 
131  private:
132  ClientSettings() {}
133 
134  friend class ClientSettingsImpl;
135  ClientSettingsImpl* impl(); // downcasts (this)
136 };
137 
138 }} // namespace facebook::logdevice
static ClientSettings * create()
bool isOverridden(const std::string &name)
Definition: AsyncReader.h:16
Definition: ClientSettings.h:25
std::vector< std::pair< std::string, std::string > > getAll()