KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | List of all members
Ostream_recorder< Recorder > Class Template Reference

#include <sample_recorder.h>

Public Types

typedef Recorder::Model_type Model_type
 
typedef Recorder::Value_type Value_type
 
typedef boost::function2
< std::ostream &, std::ostream
&, const Value_type & > 
Write_function
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((ModelRecorder< Recorder >))
 
 Ostream_recorder (const Recorder &recorder, std::ostream &os, const std::string &separator="\n", const Write_function &write_func=Ostream_recorder::default_write)
 
virtual void operator() (const Model_type &m, const Step_log< Model_type > &step_log)
 
const Value_typeget () const
 

Static Public Member Functions

static std::ostream & default_write (std::ostream &ost, const Value_type &v)
 

Detailed Description

template<class Recorder>
class Ostream_recorder< Recorder >

"Wraps" and existing recorder, making it output the recorded value to the given stream.

Template Parameters
RecorderA type implemeting the ModelRecorder concept.
Warning
The wrapped recorder is stored by reference, so the caller must ensure it isn't freed while Modulo_recorder is in use.

Member Typedef Documentation

template<class Recorder>
typedef Recorder::Model_type Ostream_recorder< Recorder >::Model_type
template<class Recorder>
typedef Recorder::Value_type Ostream_recorder< Recorder >::Value_type
template<class Recorder>
typedef boost::function2<std::ostream&, std::ostream&, const Value_type&> Ostream_recorder< Recorder >::Write_function

Constructor & Destructor Documentation

template<class Recorder>
Ostream_recorder< Recorder >::Ostream_recorder ( const Recorder &  recorder,
std::ostream &  os,
const std::string &  separator = "\n",
const Write_function write_func = Ostream_recorder< Recorder >::default_write 
)
inline
Parameters
recorderThe recorder to wrap. This will be stored be value, so the caller is responsible for making sure the recorder remains in scope
osostream to output.
recorderThe recorder to wrap. This will be stored be value, so the caller is responsible for making sure the recorder remains in scope
osostream to output.
write_funcThe write function to call (alternative to operator>>, with same signature)

Member Function Documentation

template<class Recorder>
Ostream_recorder< Recorder >::BOOST_CONCEPT_ASSERT ( (ModelRecorder< Recorder >)  )
template<class Recorder>
static std::ostream& Ostream_recorder< Recorder >::default_write ( std::ostream &  ost,
const Value_type v 
)
inlinestatic
template<class Recorder>
const Value_type& Ostream_recorder< Recorder >::get ( ) const
inline
template<class Recorder>
virtual void Ostream_recorder< Recorder >::operator() ( const Model_type m,
const Step_log< Model_type > &  step_log 
)
inlinevirtual

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