Github   Telegram
Loading...
Searching...
No Matches
Public Member Functions | List of all members
components::ComponentConfig Class Referencefinal
+ Inheritance diagram for components::ComponentConfig:
+ Collaboration diagram for components::ComponentConfig:

Public Member Functions

 ComponentConfig (std::string name)
 Creates an empty config.
 
 ComponentConfig (yaml_config::YamlConfig value)
 
const std::string & Name () const
 
void SetName (std::string name)
 
- Public Member Functions inherited from yaml_config::YamlConfig
 YamlConfig (formats::yaml::Value yaml, formats::yaml::Value config_vars)
 YamlConfig = config + config_vars.
 
const formats::yaml::ValueYaml () const
 Get the plain Yaml without substitutions. It may contain raw references.
 
YamlConfig operator[] (std::string_view key) const
 Access member by key for read. More...
 
YamlConfig operator[] (size_t index) const
 Access member by index for read. More...
 
std::size_t GetSize () const
 Returns array size or object members count. More...
 
bool IsMissing () const
 Returns true if *this holds nothing. When IsMissing() returns true any attempt to get the actual value or iterate over *this will throw MemberMissingException.
 
bool IsNull () const
 Returns true if *this holds 'null'.
 
bool IsInt64 () const
 Returns true if *this is convertible to int64_t. More...
 
bool IsUInt64 () const
 Returns true if *this is convertible to uint64_t. More...
 
void CheckArrayOrNull () const
 
void CheckObjectOrNull () const
 
template<typename T >
As () const
 Returns value of *this converted to T. More...
 
template<typename T , typename First , typename... Rest>
As (First &&default_arg, Rest &&... more_default_args) const
 Returns value of *this converted to T or T(args) if this->IsMissing(). More...
 
template<typename T >
As (DefaultConstructed) const
 Returns value of *this converted to T or T() if this->IsMissing(). More...
 
bool HasMember (std::string_view key) const
 Returns true if *this holds a key. More...
 
std::string GetPath () const
 Returns full path to this value.
 
const_iterator begin () const
 Returns an iterator to the beginning of the held array or map. More...
 
const_iterator end () const
 Returns an iterator to the end of the held array or map. More...
 
template<>
bool As () const
 
template<>
int64_t As () const
 
template<>
uint64_t As () const
 
template<>
double As () const
 

Additional Inherited Members

- Public Types inherited from yaml_config::YamlConfig
using const_iterator = Iterator< IterTraits >
 
using Exception = yaml_config::Exception
 
using ParseException = yaml_config::ParseException
 

Detailed Description

Examples
components/component_sample_test.cpp, components/component_sample_test.hpp, samples/config_service/config_service.cpp, samples/flatbuf_service/flatbuf_service.cpp, samples/grpc_service/grpc_service.cpp, samples/http_caching/http_caching.cpp, samples/mongo_service/mongo_service.cpp, samples/postgres_service/postgres_service.cpp, samples/redis_service/redis_service.cpp, samples/tcp_full_duplex_service/tcp_full_duplex_service.cpp, and samples/tcp_service/tcp_service.cpp.

Definition at line 13 of file component_config.hpp.


The documentation for this class was generated from the following file: