\hypertarget{classkdb_1_1Context}{\section{kdb\-:\-:Context Class Reference}
\label{classkdb_1_1Context}\index{kdb\-::\-Context@{kdb\-::\-Context}}
}


Provides a context for configuration.  




{\ttfamily \#include $<$kdbcontext.\-hpp$>$}



Inherits kdb\-::\-Subject.



Inherited by kdb\-::\-Thread\-Context.

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
std\-::string \hyperlink{classkdb_1_1Context_a331463d2eec8d2a5fdb8ffe4bfc181f6}{operator\mbox{[}$\,$\mbox{]}} (std\-::string const \&layer) const 
\begin{DoxyCompactList}\small\item\em Lookup value for a current active layer. \end{DoxyCompactList}\item 
size\-\_\-t \hyperlink{classkdb_1_1Context_add39417df86eb963a1f04a8812c51917}{size} () const 
\item 
void \hyperlink{classkdb_1_1Context_afcbfe897ee36eb4fee23640051122e54}{attach\-By\-Name} (std\-::string const \&key\-\_\-name, \hyperlink{classkdb_1_1ValueObserver}{Value\-Observer} \&observer)
\begin{DoxyCompactList}\small\item\em Attach observer using to all events given by its specification (name) \end{DoxyCompactList}\item 
std\-::string \hyperlink{classkdb_1_1Context_a130675fbe20f1b20eaa462ec6a9fe98e}{evaluate} (std\-::string const \&key\-\_\-name) const 
\begin{DoxyCompactList}\small\item\em Evaluate a specification (name) and return a key name under current context. \end{DoxyCompactList}\item 
std\-::string \hyperlink{classkdb_1_1Context_a0687e0df9fbb3e2670fb45f1f9afdfc9}{evaluate} (std\-::string const \&key\-\_\-name, std\-::function$<$ bool(std\-::string const \&, std\-::string \&, bool in\-\_\-group)$>$ const \&on\-\_\-layer) const 
\begin{DoxyCompactList}\small\item\em Evaluate specification with this context. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename T , typename... Args$>$ }\\std\-::shared\-\_\-ptr$<$ \hyperlink{classkdb_1_1Layer}{Layer} $>$ \hyperlink{classkdb_1_1Context_a28b78596e359631e452d768b7861fb84}{activate} (Args \&\&...args)
\begin{DoxyCompactList}\small\item\em Globally activate the layer. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Provides a context for configuration. 

Is a subject for observers.

Holds currently active layers and allows global/scoped activation of layers. 

\subsection{Member Function Documentation}
\hypertarget{classkdb_1_1Context_a28b78596e359631e452d768b7861fb84}{\index{kdb\-::\-Context@{kdb\-::\-Context}!activate@{activate}}
\index{activate@{activate}!kdb::Context@{kdb\-::\-Context}}
\subsubsection[{activate}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T , typename... Args$>$ std\-::shared\-\_\-ptr$<${\bf Layer}$>$ kdb\-::\-Context\-::activate (
\begin{DoxyParamCaption}
\item[{Args \&\&...}]{args}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{classkdb_1_1Context_a28b78596e359631e452d768b7861fb84}


Globally activate the layer. 


\begin{DoxyTemplParams}{Template Parameters}
{\em T} & the layer to activate \\
\hline
{\em Args} & the types for the arguments to pass to layer construction \\
\hline
\end{DoxyTemplParams}

\begin{DoxyParams}{Parameters}
{\em args} & the arguments to pass to layer construction \\
\hline
\end{DoxyParams}
\hypertarget{classkdb_1_1Context_afcbfe897ee36eb4fee23640051122e54}{\index{kdb\-::\-Context@{kdb\-::\-Context}!attach\-By\-Name@{attach\-By\-Name}}
\index{attach\-By\-Name@{attach\-By\-Name}!kdb::Context@{kdb\-::\-Context}}
\subsubsection[{attach\-By\-Name}]{\setlength{\rightskip}{0pt plus 5cm}void kdb\-::\-Context\-::attach\-By\-Name (
\begin{DoxyParamCaption}
\item[{std\-::string const \&}]{key\-\_\-name, }
\item[{{\bf Value\-Observer} \&}]{observer}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}}\label{classkdb_1_1Context_afcbfe897ee36eb4fee23640051122e54}


Attach observer using to all events given by its specification (name) 


\begin{DoxyParams}{Parameters}
{\em key\-\_\-name} & the name with placeholders to be used for attaching \\
\hline
{\em observer} & the observer to attach to \\
\hline
\end{DoxyParams}
\hypertarget{classkdb_1_1Context_a130675fbe20f1b20eaa462ec6a9fe98e}{\index{kdb\-::\-Context@{kdb\-::\-Context}!evaluate@{evaluate}}
\index{evaluate@{evaluate}!kdb::Context@{kdb\-::\-Context}}
\subsubsection[{evaluate}]{\setlength{\rightskip}{0pt plus 5cm}std\-::string kdb\-::\-Context\-::evaluate (
\begin{DoxyParamCaption}
\item[{std\-::string const \&}]{key\-\_\-name}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}}\label{classkdb_1_1Context_a130675fbe20f1b20eaa462ec6a9fe98e}


Evaluate a specification (name) and return a key name under current context. 


\begin{DoxyParams}{Parameters}
{\em key\-\_\-name} & the name with placeholders to be evaluated \\
\hline
\end{DoxyParams}
\hypertarget{classkdb_1_1Context_a0687e0df9fbb3e2670fb45f1f9afdfc9}{\index{kdb\-::\-Context@{kdb\-::\-Context}!evaluate@{evaluate}}
\index{evaluate@{evaluate}!kdb::Context@{kdb\-::\-Context}}
\subsubsection[{evaluate}]{\setlength{\rightskip}{0pt plus 5cm}std\-::string kdb\-::\-Context\-::evaluate (
\begin{DoxyParamCaption}
\item[{std\-::string const \&}]{key\-\_\-name, }
\item[{std\-::function$<$ bool(std\-::string const \&, std\-::string \&, bool in\-\_\-group)$>$ const \&}]{on\-\_\-layer}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}}\label{classkdb_1_1Context_a0687e0df9fbb3e2670fb45f1f9afdfc9}


Evaluate specification with this context. 


\begin{DoxyParams}{Parameters}
{\em key\-\_\-name} & the keyname with placeholders to evaluate \\
\hline
{\em on\-\_\-layer} & the function to be called for every placeholder found\\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{on\-\_\-layer is called for every layer in the}
specification. 
\end{DoxyParagraph}
\begin{DoxyReturn}{Returns}
the evaluated string 
\end{DoxyReturn}
\hypertarget{classkdb_1_1Context_a331463d2eec8d2a5fdb8ffe4bfc181f6}{\index{kdb\-::\-Context@{kdb\-::\-Context}!operator\mbox{[}$\,$\mbox{]}@{operator[]}}
\index{operator\mbox{[}$\,$\mbox{]}@{operator[]}!kdb::Context@{kdb\-::\-Context}}
\subsubsection[{operator[]}]{\setlength{\rightskip}{0pt plus 5cm}std\-::string kdb\-::\-Context\-::operator\mbox{[}$\,$\mbox{]} (
\begin{DoxyParamCaption}
\item[{std\-::string const \&}]{layer}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}}\label{classkdb_1_1Context_a331463d2eec8d2a5fdb8ffe4bfc181f6}


Lookup value for a current active layer. 


\begin{DoxyParams}{Parameters}
{\em layer} & the name of the requested layer \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the layer 
\end{DoxyReturn}
\hypertarget{classkdb_1_1Context_add39417df86eb963a1f04a8812c51917}{\index{kdb\-::\-Context@{kdb\-::\-Context}!size@{size}}
\index{size@{size}!kdb::Context@{kdb\-::\-Context}}
\subsubsection[{size}]{\setlength{\rightskip}{0pt plus 5cm}size\-\_\-t kdb\-::\-Context\-::size (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}}}\label{classkdb_1_1Context_add39417df86eb963a1f04a8812c51917}
\begin{DoxyReturn}{Returns}
size of all current layers (to be used with operator\mbox{[}\mbox{]}) 
\end{DoxyReturn}


The documentation for this class was generated from the following file\-:\begin{DoxyCompactItemize}
\item 
kdbcontext.\-hpp\end{DoxyCompactItemize}
