about summary refs log tree commit diff
path: root/third_party/abseil_cpp/absl/flags/internal/registry.h
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-06-17T13·53+0100
committerVincent Ambo <tazjin@google.com>2020-06-17T13·53+0100
commit543379ce4572a4015c62812f93acb02938caece1 (patch)
tree797b0cbcc4795bbc73d9d5b2913e06156fa8614a /third_party/abseil_cpp/absl/flags/internal/registry.h
parentc224a738e7524fd0b6c8bed134f43b307bdbc9e8 (diff)
parent8f2828c4b4ce502d242eca80a80269448857f4a6 (diff)
merge(3p/abseil_cpp): Merge upstream at 'ccdbb5941' r/1011
Change-Id: I6e85fc7b5f76bba1f1eef15e600a8acb64e97ef5
Diffstat (limited to 'third_party/abseil_cpp/absl/flags/internal/registry.h')
-rw-r--r--third_party/abseil_cpp/absl/flags/internal/registry.h43
1 files changed, 4 insertions, 39 deletions
diff --git a/third_party/abseil_cpp/absl/flags/internal/registry.h b/third_party/abseil_cpp/absl/flags/internal/registry.h
index af8ed6b99b78..6f5006a016fd 100644
--- a/third_party/abseil_cpp/absl/flags/internal/registry.h
+++ b/third_party/abseil_cpp/absl/flags/internal/registry.h
@@ -17,11 +17,9 @@
 #define ABSL_FLAGS_INTERNAL_REGISTRY_H_
 
 #include <functional>
-#include <map>
-#include <string>
 
 #include "absl/base/config.h"
-#include "absl/base/macros.h"
+#include "absl/flags/commandlineflag.h"
 #include "absl/flags/internal/commandlineflag.h"
 #include "absl/strings/string_view.h"
 
@@ -32,19 +30,16 @@ namespace absl {
 ABSL_NAMESPACE_BEGIN
 namespace flags_internal {
 
-CommandLineFlag* FindCommandLineFlag(absl::string_view name);
-CommandLineFlag* FindRetiredFlag(absl::string_view name);
-
 // Executes specified visitor for each non-retired flag in the registry.
 // Requires the caller hold the registry lock.
-void ForEachFlagUnlocked(std::function<void(CommandLineFlag*)> visitor);
+void ForEachFlagUnlocked(std::function<void(CommandLineFlag&)> visitor);
 // Executes specified visitor for each non-retired flag in the registry. While
 // callback are executed, the registry is locked and can't be changed.
-void ForEachFlag(std::function<void(CommandLineFlag*)> visitor);
+void ForEachFlag(std::function<void(CommandLineFlag&)> visitor);
 
 //-----------------------------------------------------------------------------
 
-bool RegisterCommandLineFlag(CommandLineFlag*);
+bool RegisterCommandLineFlag(CommandLineFlag&);
 
 //-----------------------------------------------------------------------------
 // Retired registrations:
@@ -87,36 +82,6 @@ inline bool RetiredFlag(const char* flag_name) {
   return flags_internal::Retire(flag_name, base_internal::FastTypeId<T>());
 }
 
-// If the flag is retired, returns true and indicates in |*type_is_bool|
-// whether the type of the retired flag is a bool.
-// Only to be called by code that needs to explicitly ignore retired flags.
-bool IsRetiredFlag(absl::string_view name, bool* type_is_bool);
-
-//-----------------------------------------------------------------------------
-// Saves the states (value, default value, whether the user has set
-// the flag, registered validators, etc) of all flags, and restores
-// them when the FlagSaver is destroyed.
-//
-// This class is thread-safe.  However, its destructor writes to
-// exactly the set of flags that have changed value during its
-// lifetime, so concurrent _direct_ access to those flags
-// (i.e. FLAGS_foo instead of {Get,Set}CommandLineOption()) is unsafe.
-
-class FlagSaver {
- public:
-  FlagSaver();
-  ~FlagSaver();
-
-  FlagSaver(const FlagSaver&) = delete;
-  void operator=(const FlagSaver&) = delete;
-
-  // Prevents saver from restoring the saved state of flags.
-  void Ignore();
-
- private:
-  class FlagSaverImpl* impl_;  // we use pimpl here to keep API steady
-};
-
 }  // namespace flags_internal
 ABSL_NAMESPACE_END
 }  // namespace absl