Dakota  Version 6.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members
ResultsManager Class Reference

Results manager for iterator final data. More...

Public Member Functions

 ResultsManager ()
 default constructor: no databases active until initialize called
 
void initialize (const std::string &base_filename)
 initialize the results manager to manage an in-core database, writing to the specified file name
 
bool active () const
 whether any databases are active
 
void write_databases ()
 Write in-core databases to file.
 
template<typename StoredType >
void insert (const StrStrSizet &iterator_id, const std::string &data_name, const StoredType &sent_data, const MetaDataType metadata=MetaDataType())
 insert data
 
void insert (const StrStrSizet &iterator_id, const std::string &data_name, StringMultiArrayConstView sma_labels, const MetaDataType metadata=MetaDataType())
 
template<typename StoredType >
void array_allocate (const StrStrSizet &iterator_id, const std::string &data_name, size_t array_size, const MetaDataType metadata=MetaDataType())
 allocate an entry with array of StoredType of array_size for future insertion; likely move to non-templated accessors for these
 
template<typename StoredType >
void array_insert (const StrStrSizet &iterator_id, const std::string &data_name, size_t index, const StoredType &sent_data)
 insert into a previously allocated array of StoredType at index specified; metadata must be specified at allocation
 
template<typename StoredType >
void array_insert (const StrStrSizet &iterator_id, const std::string &data_name, size_t index, StringMultiArrayConstView sent_data)
 specialization: insert a SMACV into a previously allocated array of StringArrayStoredType at index specified; metadata must be specified at allocation
 

Public Attributes

ResultsNames results_names
 Copy of valid results names for when manager is passed around.
 

Private Member Functions

template<typename StoredType >
StoredType core_lookup (const StrStrSizet &iterator_id, const std::string &data_name) const
 retrieve in-core entry given by id and name
 
template<typename StoredType >
StoredType * core_lookup_ptr (const StrStrSizet &iterator_id, const std::string &data_name) const
 retrieve data via pointer to avoid copy; work-around for Boost any use of pointer (could use utilib::Any)
 
template<typename StoredType >
StoredType core_lookup (const StrStrSizet &iterator_id, const std::string &data_name, size_t index) const
 retrieve data from in-core array of StoredType at given index
 
template<typename StoredType >
const StoredType * core_lookup_ptr (const StrStrSizet &iterator_id, const std::string &data_name, size_t index) const
 retrieve data via pointer to entry in in-core array
 
template<typename StoredType >
void file_lookup (StoredType &db_data, const StrStrSizet &iterator_id, const std::string &data_name) const
 retrieve requested data into provided db_data StoredType
 

Private Attributes

bool coreDBActive
 whether the in-core database in active
 
std::string coreDBFilename
 filename for the in-core database
 
bool hdf5DBActive
 whether the file database is active
 
boost::scoped_ptr< ResultsDBAnycoreDB
 In-core database, with option to flush to file at end.
 
boost::shared_ptr< ResultsDBHDF5 > hdf5DB
 File-based database; using shared_ptr due to potentially incomplete type and requirements for checked_delete in debug builds.
 

Friends

template<typename StoredType >
class ResultsEntry
 ResultsEntry is a friend of ResultsManager.
 

Detailed Description

Results manager for iterator final data.

The results manager provides the API for posting and retrieving iterator results data (and eventually run config/statistics). It can manage a set of underlying results databases, in or out of core, depending on configuration

The key for a results entry is documented in results_types.hpp, e.g., tuple<std::string, std::string, size_t, std::string>

For now, using concrete types for most insertion, since underlying databases like HDF5 might need concrete types; though template parameter for array allocation and retrieval.

All insertions overwrite any previous data.


The documentation for this class was generated from the following files: