3#include <boost/uuid/uuid_generators.hpp>
4#include <boost/uuid/uuid_io.hpp>
5#include <boost/lexical_cast.hpp>
14 uuid_ = boost::uuids::random_generator()();
19 uuid_ = boost::uuids::random_generator()();
24 uuid_ = boost::uuids::random_generator()();
29 inject_sim_id_(
true) {
40 for (
int i = 0; i < data_.size(); ++i) {
54 for (
int i = 0; i < data_.size(); ++i) {
59 for (
int i = 0; i < count; ++i) {
62 d->AddVal(
"SimId", uuid_);
86void Recorder::AddDatum(
Datum*
d) {
87 if (index_ >= data_.size()) {
98 std::list<RecBackend*>::iterator
it;
99 for (
it = backs_.begin();
it != backs_.end();
it++) {
105void Recorder::NotifyBackends() {
107 std::list<RecBackend*>::iterator
it;
108 for (
it = backs_.begin();
it != backs_.end();
it++) {
109 (*it)->Notify(data_);
Used to specify and send a collection of key-value pairs to the Recorder for recording.
A generic mechanism to manually manage exceptions.
An abstract base class for listeners (e.g.
void RegisterBackend(RecBackend *b)
Registers b to receive Datum notifications for all Datum objects collected by the Recorder and to rec...
boost::uuids::uuid sim_id()
returns the unique id associated with this cyclus simulation.
void set_dump_count(unsigned int count)
set the Recorder to flush its collected Datum objects to registered backends every [count] Datum obje...
void Flush()
Flushes all buffered Datum objects and flushes all registered backends.
unsigned int dump_count()
Return the dump frequency, # Datum objects buffered between flushes to backends.
Datum * NewDatum(std::string title)
Creates a new datum namespaced under the specified title.
Recorder()
create a new recorder with default dump frequency, random simulation id, and simulation id injection.
void Close()
Flushes all buffered Datum objects and flushes all registered backends.
Code providing rudimentary logging capability for the Cyclus core.
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or....
static unsigned int const kDefaultDumpCount
default number of Datum objects to collect before flushing to backends.
std::vector< Datum * > DatumList
@ LEV_ERROR
Use for errors that require agent code or input file modification (use extremely sparingly)
T OptionalQuery(InfileTree *tree, std::string query, T default_val)
a query method for optional parameters