LILAC
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
writer Class Reference

This class defines the interface for sending data to the engine for writing. More...

#include <writer.h>

Public Types

enum  w_type {
  FINAL_SCORE, FINAL_FUNC, INTERMEDIATE_FUNC, INTERMEDIATE_SCORE,
  INDEX, PARAMETER, OTHER, BEGIN = FINAL_SCORE,
  END = OTHER
}
 Labels for various input types. More...

Public Member Functions

virtual void write (std::ostream &ofile) const
virtual void add_data (std::shared_ptr< const data > inval, const w_type dat_t)
std::string to_string () const
void set_rule (w_type inval, bool rule)
virtual ~writer ()
 writer (bool def=true)
 writer (const std::map< int, bool > &writevals, bool def=true)

Static Private Member Functions

static bool is_w_type (int inval)
 Writes the current data to a file.

Private Attributes

std::list< std::shared_ptr
< const data > > 
dvals
 Holds each data point.
std::map< int, bool > will_write
 Maps enum parameters to a bool deciding whether that label will write or not.

Friends

class engineimp

Detailed Description

This class defines the interface for sending data to the engine for writing.

Definition at line 28 of file writer.h.

Member Enumeration Documentation

Labels for various input types.

Enumerator:
FINAL_SCORE 
FINAL_FUNC 
INTERMEDIATE_FUNC 
INTERMEDIATE_SCORE 
INDEX 
PARAMETER 
OTHER 
BEGIN 
END 

Definition at line 39 of file writer.h.

Constructor & Destructor Documentation

writer::~writer ( )
virtual

Definition at line 65 of file writer.cpp.

writer::writer ( bool  def = true)

This creates a new writer class with all of the type rules set to def

Parameters
defThe default rule for all of the types

Definition at line 44 of file writer.cpp.

writer::writer ( const std::map< int, bool > &  writevals,
bool  def = true 
)

This constructs a writer that has the same rules as the map writevals, with any rule that isn't in writevals set to def

Parameters
writevalsThe current set of rules being used
defThe default rule for values not mapped by writevals

Definition at line 57 of file writer.cpp.

Here is the call graph for this function:

Member Function Documentation

void writer::add_data ( std::shared_ptr< const data inval,
const w_type  dat_t 
)
virtual

This functions adds the data to the list of values to be written, as long as the rule corresponding to the type is set to true

Parameters
invalThe data to be saved
dat_tThe type of the input data

Definition at line 26 of file writer.cpp.

bool writer::is_w_type ( int  inval)
staticprivate

Writes the current data to a file.

Definition at line 67 of file writer.cpp.

Here is the caller graph for this function:

void writer::set_rule ( w_type  inval,
bool  rule 
)

This functions sets the rule for the input type

Parameters
invalThe type which is having a rule reset
rulethe new rule for the type

Definition at line 36 of file writer.cpp.

std::string writer::to_string ( ) const

Definition at line 86 of file writer.cpp.

Here is the call graph for this function:

void writer::write ( std::ostream &  ofile) const
virtual

Definition at line 77 of file writer.cpp.

Here is the caller graph for this function:

Friends And Related Function Documentation

friend class engineimp
friend

Definition at line 33 of file writer.h.

Member Data Documentation

std::list<std::shared_ptr<const data> > writer::dvals
private

Holds each data point.

Definition at line 30 of file writer.h.

std::map<int, bool> writer::will_write
private

Maps enum parameters to a bool deciding whether that label will write or not.

Definition at line 32 of file writer.h.


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