Functions and classes that could be used with or without coroutine environment.
Those classes and functions reside in CMake target userver-universal, that is a base target for all the userver-* targets, so all these the classes and functions are available while using any of the userver parts.
Files | |
| file | using_namespace_userver.hpp |
For samples and snippets only! Has a using namespace / USERVER_NAMESPACE; if the USERVER_NAMESPACE is not empty. | |
| file | merge_schemas.hpp |
| Merge parent and child components schemas of static configs. | |
| file | assert.hpp |
| Assertion macros UASSERT, UASSERT_MSG, UINVARIANT and AbortWithStacktrace() function. | |
| file | rand.hpp |
| Random number generators. | |
| file | mock_now.hpp |
| Mocking and getting mocked time values. | |
| file | assert_macros.hpp |
| Extensions to the gtest macros for printing and testing exceptions that could work even without coroutine environment. | |
| file | common_containers.hpp |
| Parsers and converters for Standard Library containers and std::optional. | |
| file | common_containers.hpp |
| Serializers for standard containers and optional. | |
| file | meta_light.hpp |
| Lightweight concepts. | |
| file | strong_typedef_fwd.hpp |
| Forward declarations and options for StrongTypedef. | |
| file | death_tests.hpp |
| Contains facilities for testing service crashes. | |
| file | log_capture_fixture.hpp |
| Fixture that allows to capture and extract log written into the default logger. | |
| file | to.hpp |
| Helper for parsers. | |
| file | to.hpp |
| Helper for serializers. | |
| file | meta.hpp |
| Metaprogramming helpers for converters detection. | |
| file | hex.hpp |
| Encoders, decoders and helpers for hexadecimal representations. | |
| file | common.hpp |
| Parsers and converters for std::chrono::seconds, std::chrono::system_clock::time_point and integral types. | |
| file | select.hpp |
| Utilities for selection of platform specific values. | |
| file | fmt_compat.hpp |
| Compatibility shims for different {fmt} library versions. | |
| file | base64.hpp |
| Cryptographic hashing, base64 encoding and decoding helpers. | |
| file | from_string.hpp |
| Extract the number contained in the string. No space characters or other extra characters allowed. Supported types: | |
| file | hash.hpp |
| Cryptographic hashing. | |
| file | datetime_light.hpp |
| Date and Time related converters. | |
| file | str_icase.hpp |
| Case insensitive ASCII comparators and hashers. | |
| file | algo.hpp |
| Small useful algorithms. | |
| file | datetime.hpp |
| Date, Time, and Timezone related converters. | |
| file | common_headers.hpp |
| Common HTTP header names. | |
| file | url.hpp |
| URL manipulation functions. | |
| file | demangle.hpp |
| Returns a human-readable representation of provided type name. | |
| file | error.hpp |
| Decompression errors. | |
| file | zstd.hpp |
| Decompresses the string. | |
| file | algorithm.hpp |
| Miscellaneous cryptographic routines. | |
| file | signers.hpp |
| Digital signature generators. | |
| file | verifiers.hpp |
| Digital signature verifiers. | |
| file | decimal64.hpp |
| Decimal data type for fixed-point arithmetic. | |
| file | format_options.hpp |
| Structure storing format options for decimal. | |
| file | items.hpp |
| Wrapper for handy python-like iteration over a map. | |
| file | iterator_direction.hpp |
| Helper to distinguish forward and reverse iterators for Value. | |
| file | merge.hpp |
Add to original new non-object elements from patch (overwriting the old ones, if any) and merge object elements recursively. | |
| file | type.hpp |
| Common enum of types. | |
| file | utils.hpp |
formats::common::GetAtPath and formats::common::RemoveAtPath utils for Value and ValueBuilder | |
| file | json.hpp |
| Include-all header for JSON support. | |
| file | exception.hpp |
| Exception classes for JSON module. | |
| file | inline.hpp |
| Inline value builders. | |
| file | array_parser.hpp |
| SAX parser that fills arrays or sets from JSON arrays. | |
| file | base_parser.hpp |
| Base class for SAX parser. | |
| file | bool_parser.hpp |
| SAX parser for JSON boolean values. | |
| file | dummy_parser.hpp |
| No-op SAX parser for tests and plumbing. | |
| file | exception.hpp |
| Exception types for JSON streaming parsers. | |
| file | int_parser.hpp |
| SAX parsers for JSON integral numbers. | |
| file | map_parser.hpp |
| SAX parser that fills maps from JSON objects. | |
| file | number_parser.hpp |
| SAX parsers for JSON floating-point numbers. | |
| file | parser.hpp |
| Convenience umbrella header for JSON SAX parser components. | |
| file | parser_handler.hpp |
| Dispatches JSON SAX events to a parser stack. | |
| file | parser_json.hpp |
| SAX-parser for formats::json::Value. | |
| file | parser_state.hpp |
| Parser stack and streaming driver for JSON SAX parsing. | |
| file | string_parser.hpp |
| SAX parser for JSON string values. | |
| file | typed_parser.hpp |
| Main base class for SAX parsers. | |
| file | validator.hpp |
| Lightweight validators for parsed JSON values. | |
| file | serialize_boost_variant.hpp |
| Serializers for boost::variant types. | |
| file | serialize_container.hpp |
| JSON serialization entry points for common containers. | |
| file | serialize_duration.hpp |
| Serializers for std::chrono::duration types. | |
| file | serialize_variant.hpp |
| Serializers for std::variant. Deprecated include, use userver/formats/serialize/variant.hpp instead of. | |
| file | boost_optional.hpp |
| Parsers and converters for boost::optional. | |
| file | boost_uuid.hpp |
| boost::uuids::uuid parser for any format | |
| file | boost_variant.hpp |
| Ineffective but generic parser for boost::variant type. | |
| file | time_of_day.hpp |
| utils::datetime::TimeOfDay parser for any format | |
| file | variant.hpp |
| Ineffective but generic parser for std::variant type. | |
| file | boost_optional.hpp |
| Serializers for boost::optional. | |
| file | boost_uuid.hpp |
| boost::uuids::uuid serializer to any format | |
| file | time_of_day.hpp |
| utils::datetime::TimeOfDay to any format | |
| file | variant.hpp |
| Serializers for std::variant. | |
| file | write_to_stream.hpp |
| Common WriteToStream functions for SAX serializers. | |
| file | yaml.hpp |
| Include-all header for YAML support. | |
| file | exception.hpp |
| Exception classes for YAML module. | |
| file | serialize_container.hpp |
| YAML serialization entry points for common containers. | |
| file | open_mode.hpp |
| A set of OpenFlags. | |
| file | read.hpp |
| functions for synchronous (blocking) file read operations | |
| file | write.hpp |
| Functions for synchronous (blocking) file write operations. | |
| file | get_hostname.hpp |
| Returns host name. | |
| file | read_groups.hpp |
| Reads Conductor groups from conductor-hostinfo file. | |
| file | cpu_limit.hpp |
| Information about CPU limits in container. | |
| file | header_map.hpp |
| Container that maps case-insensitive header name into header value. | |
| file | parse_status_code.hpp |
| file | http_request_parse_args.hpp |
| Strict URL arguments parsing. | |
| file | predefined_header.hpp |
| Predefined HTTP header names and related helpers. | |
| file | stacktrace_cache.hpp |
| Cached stringification for Boost stack traces. | |
| file | opentelemetry.hpp |
| OpenTelemetry traceparent header parsing and building. | |
| file | atomic.hpp |
| Helper algorithms to work with atomics. | |
| file | boost_filesystem_file_status.hpp |
| Lightweight include of Boost.Filesystem file_status. | |
| file | bytes_per_second.hpp |
Data type that represents bytes per second unit. | |
| file | cpp_20_calendar.hpp |
| Helpers for C++20 calendar. | |
| file | from_string_saturating.hpp |
| Saturating converters from strings to time points. | |
| file | timepoint_tz.hpp |
| Timepoint with timezone. | |
| file | tskv.hpp |
| Encoders, decoders and helpers for TSKV representations. | |
| file | enumerate.hpp |
| Implementation of python-style enumerate function for range-for loops. | |
| file | get_if.hpp |
| file | make_intrusive_ptr.hpp |
| Factory function for boost::intrusive_ptr, like std::make_unique. | |
| file | meta.hpp |
| Metaprogramming, template variables and concepts. | |
| file | optionals.hpp |
| Helper functions for std optionals. | |
| file | small_string_fwd.hpp |
| Forward declaration for stack-friendly SmallString. | |
| file | small_string_serialization.hpp |
| Parse, serialize, and fmt formatting for SmallString. | |
| file | fmt.hpp |
| deprecated header, fmt formatters now reside near the types. | |
| file | str_icase_containers.hpp |
| Contains utilities for working with containers with utils::StrCaseHash and utils::StrIcaseHash. | |
| file | string_literal.hpp |
Non-empty string view to a compile time known null terminated char array that lives for the lifetime of program, as per [lex.string]; a drop-in replacement for static const std::string kVar = "value" and constexpr std::string_view kVar = "value". | |
| file | string_to_duration.hpp |
| Converts strings like "10s", "5d", "1h" to durations. | |
| file | swappingsmart.hpp |
| Deprecated RCU-like shared_ptr cell with swap-based updates for readers. | |
| file | text_light.hpp |
| Text utilities that do not use locales. | |
| file | thread_name.hpp |
| Functions for thread name manipulation. | |
| file | threads.hpp |
| Functions to work with OS threads. | |
| file | trivial_map_fwd.hpp |
| Forward declarations of utils::TrivialBiMap and utils::TrivialSet types. | |
| file | underlying_value.hpp |
| file | uuid4.hpp |
| Generate a UUIDv4 string. | |
| file | uuid7.hpp |
| Generate a UUIDv7 string. | |
| file | zstring_view.hpp |
Non-empty string view type that guarantees null-termination and has a c_str() member function. | |
| file | fwd.hpp |
| Forward declarations of YamlConfig type and formats::parse::To. | |
| file | iterator.hpp |
| Forward iterator adapter over YAML-backed configuration containers. | |
| file | map_to_array.hpp |
| Parses YAML object maps into vectors of named elements. | |
| file | default_logger_fixture.hpp |
| Fixture that allows to set the default logger and manages its lifetime. | |
| file | literals.hpp |
| Brings format literals into scope for unit tests. | |
| file | parameter_names.hpp |
| Test name printer for parameterized tests written in gtest. | |
| file | serialize_duration.hpp |
| Serializers for std::chrono::duration types. | |
Classes | |
| class | utils::datetime::Date |
| Date in format YYYY-MM-DD, std::chrono::year_month_day like type. More... | |
| class | utils::InvariantError |
| Exception that is thrown on UINVARIANT violation. More... | |
| class | utils::datetime::TimeOfDay< Duration > |
| A simple implementation of a "time since midnight" datatype. More... | |
| class | formats::json::ValueBuilder |
| Builder for JSON. More... | |
| struct | formats::parse::To< T > |
| struct | formats::serialize::To< T > |
| class | utils::TracefulException |
| Exception that remembers the backtrace at the point of its construction. More... | |
| class | utils::FastPimpl< T, Size, Alignment, Strict > |
| Implements pimpl idiom without dynamic memory allocation. More... | |
| struct | utils::datetime::WallCoarseClock |
| System clock with up to a few millisecond resolution that is slightly faster than the std::chrono::system_clock. More... | |
| class | cache::LruMap< T, U, Hash, Equal > |
| class | cache::LruSet< T, Hash, Equal > |
| class | crypto::Certificate |
| class | crypto::PrivateKey |
| class | crypto::PublicKey |
| class | crypto::SslCtx |
| class | decimal64::Decimal< Prec, TRoundPolicy > |
| Fixed-point decimal data type for use in deterministic calculations, oftentimes involving money. More... | |
| class | formats::common::Path |
| class | formats::json::Array |
| Non-mutable JSON array representation. More... | |
| class | formats::json::Object |
| Non-mutable JSON object representation. More... | |
| class | formats::json::StringBuilder |
| SAX like builder of JSON string. Use with extreme caution and only in performance critical part of your code. More... | |
| class | formats::json::Value |
| Non-mutable JSON value representation. More... | |
| class | formats::yaml::Value |
| Non-mutable YAML value representation. More... | |
| class | formats::yaml::ValueBuilder |
| Builder for YAML. More... | |
| class | fs::blocking::CFile |
A std::FILE* wrapper. More... | |
| class | fs::blocking::FileDescriptor |
| A file descriptor wrapper. More... | |
| class | fs::blocking::TempDirectory |
A unique directory for temporary files. The directory is deleted when the TempDirectory is destroyed. More... | |
| class | fs::blocking::TempFile |
A unique temporary file. The file is deleted when the TempFile object is destroyed. More... | |
| class | http::ContentType |
| Content-Type representation. More... | |
| class | http::headers::HeaderMap |
| Container that maps case-insensitive header name into header value. More... | |
| class | http::headers::PredefinedHeader |
| A struct to represent compile-time known header name. More... | |
| class | utils::AnyMovable |
Replacement for std::any that is not copyable. It allows to store non-copyable and even non-movable types. More... | |
| class | utils::AnyStorage< StorageTag > |
| map-like heterogeneous data storage More... | |
| struct | utils::CachedHash< Key > |
| Holds the key and its hash for faster comparisons and hashing. More... | |
| class | utils::CheckedPtr< T > |
| Utility template for returning a pointer to an object that is owned by someone else; throws std::runtime_error if nullptr is stored. More... | |
| struct | utils::datetime::SteadyCoarseClock |
| Steady clock with up to a few millisecond resolution that is slightly faster than the std::chrono::steady_clock. More... | |
| class | utils::DefaultDict< ValueType > |
| Dictionary that for missing keys falls back to a default value stored by key utils::kDefaultDictDefaultName. More... | |
| class | utils::expected< S, E > |
| For holding a value or an error. More... | |
| class | utils::FastScopeGuard< Callback > |
| a helper class to perform actions on scope exit More... | |
| class | utils::FilterBloom< T, Counter, Hash1, Hash2 > |
| Space-efficient probabilistic data structure. More... | |
| class | utils::FixedArray< T > |
| A fixed-size array with the size determined at runtime. More... | |
| class | utils::Flags< Enum > |
| Wrapper to extend enum with flags interface. More... | |
| class | utils::AtomicFlags< Enum > |
| Wrapper to extend enum with atomic flags interface. More... | |
| class | utils::LazyPrvalue< Func > |
| Can be used with various emplace functions to allow in-place constructing a non-movable value using a callable. More... | |
| class | utils::NotNull< T > |
| Restricts a pointer or smart pointer to only hold non-null values. More... | |
| class | utils::OptionalRef< T > |
| Class that behaves as a nullable reference. Main difference from the pointer - value comparison of pointed values. More... | |
| struct | utils::Overloaded< Ts > |
| Utility to define std::variant visitors in a simple way. More... | |
| class | utils::regex |
A drop-in replacement for std::regex without huge includes and with better performance characteristics. More... | |
| class | utils::match_results |
A drop-in replacement for std::match_results without huge includes and with better performance characteristics. Represents capturing groups of a single match result. More... | |
| class | utils::ResultStore< T > |
| class | utils::ResultStore< void > |
| class | utils::ScopeGuard |
| a helper class to perform actions on scope exit More... | |
| class | utils::SharedReadablePtr< T > |
std::shared_ptr<const T> wrapper that makes sure that the pointer is stored before dereferencing. Protects from dangling references. More... | |
| class | utils::SlidingInterval< T > |
Sliding interval of values that provides functions to compute average, min and max values from the last window_size values of interval. More... | |
| class | utils::SmallString< N > |
| An alternative to std::string with a custom SSO (small string optimization) container size. Unlike std::string, SmallString is not null-terminated thus it has no c_str(), data() returns a not null-terminated buffer. More... | |
| class | utils::statistics::Histogram |
| A histogram with a dynamically-allocated array of buckets. More... | |
| class | utils::statistics::HistogramView |
| The non-owning reader API for "histogram" metrics. More... | |
| class | utils::statistics::LabelView |
| Non owning label name+value storage. More... | |
| class | utils::statistics::Label |
| Label name+value storage. More... | |
| class | utils::statistics::LabelsSpan |
| View over a continuous range of LabelView. More... | |
| class | utils::statistics::MetricValue |
| The value of a metric. More... | |
| struct | utils::statistics::Rate |
Rate metrics (or "counter" metrics) are metrics that only monotonically increase or are reset to zero on restart. Some monitoring systems give them special treatment with regard to maintaining proper non-negative derivative. More... | |
| class | utils::statistics::RateCounter |
| Atomic counter of type Rate with relaxed memory ordering by default. More... | |
| class | utils::statistics::Request |
| Class describing the request for metrics data. More... | |
| class | utils::statistics::Writer |
| Class for writing metrics that is provided by utils::statistics::Storage. More... | |
| class | utils::StrongTypedef< Tag, T, Ops > |
| Strong typedef for a type T. More... | |
| class | utils::TokenBucket |
| class | utils::TrivialBiMap< BuilderFunc > |
| Bidirectional unordered map for trivial types, including string literals; could be efficiently used as a unordered non-bidirectional map. More... | |
| class | utils::TrivialSet< BuilderFunc > |
| Unordered set for trivial types, including string literals. More... | |
| struct | yaml_config::Schema |
| JSON Schema-like type definition. More... | |
| class | yaml_config::YamlConfig |
| Datatype that represents YAML with substituted variables. More... | |
| class | utils::statistics::MonotonicByLabelStorage< Labels, Metric > |
| Thread-safe monotonic storage of metrics indexed by label values. More... | |
Macros | |
| #define | USERVER_FILEPATH |
| Short utils::zstring_view with source path for logging. | |
Typedefs | |
| template<typename U> | |
| using | utils::SharedRef = NotNull<std::shared_ptr<U>> |
A std::shared_ptr that is guaranteed to be not-null. | |
| template<typename U> | |
| using | utils::UniqueRef = NotNull<std::unique_ptr<U>> |
A std::unique_ptr that is guaranteed to be not-null. | |
| template<typename Value, auto Projection, typename Hash = void, typename Equal = std::equal_to<>, typename Allocator = std::allocator<Value>> | |
| using | utils::ProjectedUnorderedSet |
A std::unordered_set that compares its elements (of type Value) based on their Projection. It allows to create, essentially, an equivalent of std::unordered_map where keys are stored inside values. | |
| template<typename Value, auto Projection, typename Compare = std::less<>, typename Allocator = std::allocator<Value>> | |
| using | utils::ProjectedSet = std::set<Value, impl::projected_set::Compare<Value, Projection, Compare>, Allocator> |
Same as utils::ProjectedUnorderedSet, but for std::set. | |
| template<typename... T> | |
| using | utils::void_t = std::void_t<T...> |
| std::void_t implementation with workarounds for compiler bugs | |
Enumerations | |
| enum class | utils::BytesPerSecond : long long |
Data type that represents bytes per second unit. More... | |
| #define USERVER_FILEPATH |
Short utils::zstring_view with source path for logging.
Definition at line 20 of file log_filepath.hpp.
| using utils::ProjectedSet = std::set<Value, impl::projected_set::Compare<Value, Projection, Compare>, Allocator> |
Same as utils::ProjectedUnorderedSet, but for std::set.
Definition at line 106 of file projected_set.hpp.
| using utils::ProjectedUnorderedSet |
A std::unordered_set that compares its elements (of type Value) based on their Projection. It allows to create, essentially, an equivalent of std::unordered_map where keys are stored inside values.
Usage example:
Definition at line 97 of file projected_set.hpp.
| using utils::SharedRef = NotNull<std::shared_ptr<U>> |
A std::shared_ptr that is guaranteed to be not-null.
Definition at line 140 of file not_null.hpp.
| using utils::UniqueRef = NotNull<std::unique_ptr<U>> |
A std::unique_ptr that is guaranteed to be not-null.
Definition at line 147 of file not_null.hpp.
| using utils::void_t = std::void_t<T...> |
std::void_t implementation with workarounds for compiler bugs
Definition at line 19 of file void_t.hpp.
|
strong |
Data type that represents bytes per second unit.
Definition at line 18 of file bytes_per_second.hpp.