3#include <boost/pool/singleton_pool.hpp>
12 std::vector<int>* shape) {
13 vals_.push_back(std::pair<const char*, boost::spirit::hold_any>(field, val));
18 shapes_.push_back(*shape);
23 std::vector<int>* shape) {
24 fields_.push_back(std::string(field));
25 return AddValBase(field, val, shape);
29 std::vector<int>* shape) {
30 fields_.push_back(field);
31 return AddValBase(field.c_str(), val, shape);
36 manager_->AddDatum(
this);
40Datum::Datum(
Recorder* m, std::string title) : title_(title), manager_(m) {
69void* Datum::operator
new(
size_t size) {
70 if (size !=
sizeof(
Datum)) {
71 return ::operator
new(size);
75 void*
ptr = DatumPool::malloc();
86 throw std::bad_alloc();
92void Datum::operator
delete(
void*
rawMemory)
throw() {
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.
std::vector< std::string > Fields
std::vector< Shape > Shapes
const Fields & fields()
Returns a vector of all field names that have been added to this datum.
const Shapes & shapes()
Returns a vector of all shapes (pointers to vectors of ints) that have been added to this datum.
void Record()
Record this datum to its Recorder.
std::vector< Entry > Vals
std::string title()
Returns the datum's title as specified during the datum's creation.
const Vals & vals()
Returns a vector of all field-value pairs that have been added to this datum.
Collects and manages output data generation for the cyclus core and agents during a simulation.
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or....
boost::singleton_pool< Datum, sizeof(Datum)> DatumPool
T OptionalQuery(InfileTree *tree, std::string query, T default_val)
a query method for optional parameters