.TH "kdb::Context" 3elektra "Sun May 29 2016" "Version 0.8.14" "Elektra" \" -*- nroff -*- .ad l .nh .SH NAME kdb::Context \- Provides a context for configuration\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits kdb::Subject\&. .PP Inherited by kdb::ThreadContext\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "std::string \fBoperator[]\fP (std::string const &layer) const " .br .RI "\fILookup value for a current active layer\&. \fP" .ti -1c .RI "size_t \fBsize\fP () const " .br .ti -1c .RI "void \fBattachByName\fP (std::string const &key_name, \fBValueObserver\fP &observer)" .br .RI "\fIAttach observer using to all events given by its specification (name) \fP" .ti -1c .RI "std::string \fBevaluate\fP (std::string const &key_name) const " .br .RI "\fIEvaluate a specification (name) and return a key name under current context\&. \fP" .ti -1c .RI "std::string \fBevaluate\fP (std::string const &key_name, std::function< bool(std::string const &, std::string &, bool in_group)> const &on_layer) const " .br .RI "\fIEvaluate specification with this context\&. \fP" .ti -1c .RI "template std::shared_ptr< \fBLayer\fP > \fBactivate\fP (Args &&\&.\&.\&.args)" .br .RI "\fIGlobally activate the layer\&. \fP" .in -1c .SH "Detailed Description" .PP Provides a context for configuration\&. Is a subject for observers\&. .PP Holds currently active layers and allows global/scoped activation of layers\&. .SH "Member Function Documentation" .PP .SS "template std::shared_ptr<\fBLayer\fP> kdb::Context::activate (Args &&\&.\&.\&. args)\fC [inline]\fP" .PP Globally activate the layer\&. .PP \fBTemplate Parameters:\fP .RS 4 \fIT\fP the layer to activate .br \fIArgs\fP the types for the arguments to pass to layer construction .RE .PP \fBParameters:\fP .RS 4 \fIargs\fP the arguments to pass to layer construction .RE .PP .SS "void kdb::Context::attachByName (std::string const & key_name, \fBValueObserver\fP & observer)\fC [inline]\fP" .PP Attach observer using to all events given by its specification (name) .PP \fBParameters:\fP .RS 4 \fIkey_name\fP the name with placeholders to be used for attaching .br \fIobserver\fP the observer to attach to .RE .PP .SS "std::string kdb::Context::evaluate (std::string const & key_name) const\fC [inline]\fP" .PP Evaluate a specification (name) and return a key name under current context\&. .PP \fBParameters:\fP .RS 4 \fIkey_name\fP the name with placeholders to be evaluated .RE .PP .SS "std::string kdb::Context::evaluate (std::string const & key_name, std::function< bool(std::string const &, std::string &, bool in_group)> const & on_layer) const\fC [inline]\fP" .PP Evaluate specification with this context\&. .PP \fBParameters:\fP .RS 4 \fIkey_name\fP the keyname with placeholders to evaluate .br \fIon_layer\fP the function to be called for every placeholder found .RE .PP \fBon_layer is called for every layer in the\fP .RS 4 specification\&. .RE .PP \fBReturns:\fP .RS 4 the evaluated string .RE .PP .SS "std::string kdb::Context::operator[] (std::string const & layer) const\fC [inline]\fP" .PP Lookup value for a current active layer\&. .PP \fBParameters:\fP .RS 4 \fIlayer\fP the name of the requested layer .RE .PP \fBReturns:\fP .RS 4 the layer .RE .PP .SS "size_t kdb::Context::size () const\fC [inline]\fP" .PP \fBReturns:\fP .RS 4 size of all current layers (to be used with operator[]) .RE .PP .SH "Author" .PP Generated automatically by Doxygen for Elektra from the source code\&.