29 #ifndef ABSL_FLAGS_FLAG_H_ 30 #define ABSL_FLAGS_FLAG_H_ 67 using Flag = flags_internal::Flag<T>;
87 #define ABSL_FLAGS_INTERNAL_LOCK_FREE_VALIDATE(BIT) \ 89 !std::is_same<T, BIT>::value, \ 90 "Do not specify explicit template parameters to absl::GetFlag"); 92 #undef ABSL_FLAGS_INTERNAL_LOCK_FREE_VALIDATE 116 flag.
internal.
Read(&u.value, &flags_internal::FlagOps<T>);
121 #define ABSL_FLAGS_INTERNAL_LOCK_FREE_EXPORT(T) \ 122 extern T GetFlag(const absl::Flag<T>& flag); 124 #undef ABSL_FLAGS_INTERNAL_LOCK_FREE_EXPORT 133 template <
typename T>
141 template <
typename T,
typename V>
144 SetFlag<T>(flag,
value);
177 #define ABSL_FLAG(Type, name, default_value, help) \ 178 ABSL_FLAG_IMPL(Type, name, default_value, help) 207 #if ABSL_FLAGS_STRIP_NAMES 208 #define ABSL_FLAG_IMPL_FLAGNAME(txt) "" 209 #define ABSL_FLAG_IMPL_FILENAME() "" 210 #define ABSL_FLAG_IMPL_REGISTRAR(T, flag) \ 211 absl::flags_internal::FlagRegistrar<T, false>(&flag) 213 #define ABSL_FLAG_IMPL_FLAGNAME(txt) txt 214 #define ABSL_FLAG_IMPL_FILENAME() __FILE__ 215 #define ABSL_FLAG_IMPL_REGISTRAR(T, flag) \ 216 absl::flags_internal::FlagRegistrar<T, true>(&flag) 221 #if ABSL_FLAGS_STRIP_HELP 222 #define ABSL_FLAG_IMPL_FLAGHELP(txt) absl::flags_internal::kStrippedFlagHelp 224 #define ABSL_FLAG_IMPL_FLAGHELP(txt) txt 227 #define ABSL_FLAG_IMPL_DECLARE_HELP_WRAPPER(name, txt) \ 228 static std::string AbslFlagsWrapHelp##name() { \ 229 return ABSL_FLAG_IMPL_FLAGHELP(txt); \ 232 #define ABSL_FLAG_IMPL_DECLARE_DEF_VAL_WRAPPER(name, Type, default_value) \ 233 static void* AbslFlagsInitFlag##name() { \ 234 return absl::flags_internal::MakeFromDefaultValue<Type>(default_value); \ 242 #define ABSL_FLAG_IMPL(Type, name, default_value, help) \ 244 ABSL_FLAG_IMPL_DECLARE_DEF_VAL_WRAPPER(name, Type, default_value) \ 245 ABSL_FLAG_IMPL_DECLARE_HELP_WRAPPER(name, help) \ 246 absl::Flag<Type> FLAGS_##name( \ 247 ABSL_FLAG_IMPL_FLAGNAME(#name), \ 248 &AbslFlagsWrapHelp##name, \ 249 ABSL_FLAG_IMPL_FILENAME(), \ 250 &absl::flags_internal::FlagMarshallingOps<Type>, \ 251 &AbslFlagsInitFlag##name); \ 252 extern bool FLAGS_no##name; \ 253 bool FLAGS_no##name = ABSL_FLAG_IMPL_REGISTRAR(Type, FLAGS_##name) 276 #define ABSL_RETIRED_FLAG(type, flagname, default_value, explanation) \ 277 ABSL_ATTRIBUTE_UNUSED static const bool ignored_##flagname = \ 278 ([] { return type(default_value); }, \ 279 absl::flags_internal::RetiredFlag<type>(#flagname)) 281 #endif // ABSL_FLAGS_FLAG_H_
#define ABSL_FLAGS_INTERNAL_FOR_EACH_LOCK_FREE(A)
flags_internal::Flag< T > Flag
absl::flags_internal::CommandLineFlag internal
#define ABSL_FLAGS_INTERNAL_LOCK_FREE_VALIDATE(BIT)
#define ABSL_FLAGS_INTERNAL_LOCK_FREE_EXPORT(T)
T GetFlag(const absl::Flag< T > &flag)
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
void SetFlag(absl::Flag< T > *flag, const T &v)
void Read(void *dst, const flags_internal::FlagOpFn dst_op) const
void Write(const void *src, const flags_internal::FlagOpFn src_op)