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) {
70 Datum* d = data_[index_];
86 void Recorder::AddDatum(
Datum* d) {
87 if (index_ >= data_.size()) {
98 std::list<RecBackend*>::iterator it;
99 for (it = backs_.begin(); it != backs_.end(); it++) {
105 void Recorder::NotifyBackends() {
107 std::list<RecBackend*>::iterator it;
108 for (it = backs_.begin(); it != backs_.end(); it++) {
109 (*it)->Notify(data_);
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 Close()
Flushes all buffered Datum objects and flushes all registered backends.
double b(int nuc)
Computes the scattering length [cm] from the coherent and incoherent components.
A generic mechanism to manually manage exceptions.
unsigned int dump_count()
Return the dump frequency, # Datum objects buffered between flushes to backends.
Recorder()
create a new recorder with default dump frequency, random simulation id, and simulation id injection...
static unsigned int const kDefaultDumpCount
default number of Datum objects to collect before flushing to backends.
Used to specify and send a collection of key-value pairs to the Recorder for recording.
Datum * AddVal(const char *field, boost::spirit::hold_any val, std::vector< int > *shape=NULL)
Add an arbitrary field-value pair to the datum.
void Flush()
Flushes all buffered Datum objects and flushes all registered backends.
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...
Datum * NewDatum(std::string title)
Creates a new datum namespaced under the specified title.
Code providing rudimentary logging capability for the Cyclus core.
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or.org/Osi/browser/trunk.
virtual const char * what() const
Returns the error message associated with this Error.
std::vector< Datum * > DatumList
Use for errors that require agent code or input file modification (use extremely sparingly) ...
bool inject_sim_id()
returns whether or not the unique simulation id will be injected.