Thrill
0.1
|
JsonLine is an object used to aggregate a set of key:value pairs for output into a JSON log.
Definition at line 119 of file json_logger.hpp.
#include <json_logger.hpp>
Classes | |
struct | ArrayTag |
struct | DictionaryTag |
Public Member Functions | |
JsonLine (JsonLogger *logger, std::ostream &os) | |
ctor: bind output More... | |
JsonLine (const JsonLine &)=delete | |
non-copyable: delete copy-constructor More... | |
JsonLine (JsonLine &&o) | |
move-constructor: unlink pointer More... | |
~JsonLine () | |
destructor: deliver to output More... | |
template<typename Key > | |
JsonLine | arr (const Key &key) |
return JsonLine has sub-dictionary of this one More... | |
void | Close () |
close the line More... | |
size_t | items () const |
number of items already put More... | |
JsonLine | obj () |
return JsonLine has sub-dictionary of this one More... | |
template<typename Type > | |
JsonLine & | operator<< (Type const &t) |
output any type More... | |
JsonLine & | operator<< (const JsonBeginObj &t) |
JsonLine & | operator<< (const JsonEndObj &) |
JsonLine & | operator= (const JsonLine &)=delete |
non-copyable: delete assignment operator More... | |
void | PutEscapedChar (char ch) |
void | PutSeparator () |
put an items separator (either ',' or ':') and increment counter. More... | |
template<typename Key > | |
JsonLine | sub (const Key &key) |
return JsonLine has sub-dictionary of this one More... | |
Public Attributes | |
size_t | items_ = 0 |
items counter for output stream More... | |
std::ostream & | os_ |
reference to output stream More... | |
bool | sub_array_ = false |
indicator for sub-array. More... | |
bool | sub_dict_ = false |
indicator for sub-dictionaries. More... | |
Private Member Functions | |
JsonLine (struct DictionaryTag, JsonLine &parent) | |
construct sub-dictionary More... | |
JsonLine (struct ArrayTag, JsonLine &parent) | |
construct sub-dictionary More... | |
Private Attributes | |
std::unique_lock< std::mutex > | lock_ |
lock on the logger output stream More... | |
JsonLogger * | logger_ = nullptr |
when destructed this object is delivered to the output. More... | |
|
inline |
ctor: bind output
Definition at line 123 of file json_logger.hpp.
move-constructor: unlink pointer
Definition at line 134 of file json_logger.hpp.
|
inline |
destructor: deliver to output
Definition at line 161 of file json_logger.hpp.
|
inlineprivate |
construct sub-dictionary
Definition at line 254 of file json_logger.hpp.
construct sub-dictionary
Definition at line 258 of file json_logger.hpp.
|
inline |
return JsonLine has sub-dictionary of this one
Definition at line 197 of file json_logger.hpp.
References thrill::api::ArrayTag, and thrill::api::operator<<().
|
inline |
close the line
Definition at line 166 of file json_logger.hpp.
|
inline |
number of items already put
Definition at line 183 of file json_logger.hpp.
|
inline |
return JsonLine has sub-dictionary of this one
Definition at line 206 of file json_logger.hpp.
|
inline |
output any type
template << forwards to Put for ADL type switching
Definition at line 407 of file json_logger.hpp.
References thrill::common::Put().
|
inline |
Definition at line 146 of file json_logger.hpp.
References thrill::api::operator<<(), and JsonBeginObj::str_.
|
inline |
Definition at line 155 of file json_logger.hpp.
|
inline |
Definition at line 222 of file json_logger.hpp.
Referenced by thrill::common::Put().
|
inline |
put an items separator (either ',' or ':') and increment counter.
Definition at line 215 of file json_logger.hpp.
|
inline |
return JsonLine has sub-dictionary of this one
Definition at line 187 of file json_logger.hpp.
References thrill::api::operator<<().
Referenced by Manager::RunTask(), and thrill::mem::update_memprofile().
size_t items_ = 0 |
items counter for output stream
Definition at line 266 of file json_logger.hpp.
Referenced by thrill::common::Put().
|
private |
lock on the logger output stream
Definition at line 251 of file json_logger.hpp.
|
private |
when destructed this object is delivered to the output.
Definition at line 248 of file json_logger.hpp.
std::ostream& os_ |
reference to output stream
Definition at line 263 of file json_logger.hpp.
Referenced by thrill::common::Put().
bool sub_array_ = false |
indicator for sub-array.
Definition at line 272 of file json_logger.hpp.
bool sub_dict_ = false |
indicator for sub-dictionaries.
Definition at line 269 of file json_logger.hpp.