Simple-Log
alpha-v0.7
|
Convenience class for setting up style policies for a given Record member. More...
#include <ConsoleSink.hpp>
Public Types | |
using | Projection_t = std::remove_cvref_t< TProjection > |
using | Table_t = std::remove_cvref_t< TTable > |
using | Key_t = typename Table_t::key_type |
Public Member Functions | |
ConsoleTextStyleTable (TProjection projection, TTable table) | |
Constructor. More... | |
template<Record TRecord> | |
ConsoleTextStyle | operator() (const TRecord &record) const |
Invocation operator. More... | |
void | insert (Key_t key, ConsoleTextStyle style) |
Inserts a style policy. More... | |
Convenience class for setting up style policies for a given Record member.
TProjection | The type of the projection |
TTable | The type of the internally used container. Can be either std::map or std::unordered_map |
Users have to provide a finally established container, which will then used for determining the appearance of the current Record. If no matching entry is found, defaultConsoleTextStyle will be used instead.
Instead of directly constructing instances of this class, users should use the makeConsoleTextStyleTableFor function.
using sl::log::ConsoleTextStyleTable< TProjection, TTable >::Key_t = typename Table_t::key_type |
using sl::log::ConsoleTextStyleTable< TProjection, TTable >::Projection_t = std::remove_cvref_t<TProjection> |
using sl::log::ConsoleTextStyleTable< TProjection, TTable >::Table_t = std::remove_cvref_t<TTable> |
|
inline |
Constructor.
projection | The projection to a member of the currently used Record type |
table | The finally established container object |
|
inline |
Inserts a style policy.
key | The key, on which the style will be applied |
style | The style which will be used, when the key is detected |
Inserts or, if key is already present, overrides the style.
|
inline |
Invocation operator.
TRecord | The currently used Record type |
record | The actual Record object |
If no matching established is found, defaultConsoleTextStyle will be used instead.