FLAME  devel
 All Classes Functions Variables Typedefs Enumerations Pages
Public Member Functions | Public Attributes | Friends | List of all members
ElementVoid Struct Referenceabstract

Base class for all simulated elements. More...

#include <base.h>

Inheritance diagram for ElementVoid:
Inheritance graph
[legend]

Public Member Functions

 ElementVoid (const Config &conf)
 Construct this element using the provided Config. More...
 
virtual const char * type_name () const =0
 
virtual void advance (StateBase &s)=0
 Propogate the given State through this Element.
 
const Configconf () const
 The Config used to construct this element.
 
Observerobserver () const
 The current observer, or NULL.
 
void set_observer (Observer *o)
 
virtual void show (std::ostream &, int level) const
 
virtual void assign (const ElementVoid *other)=0
 

Public Attributes

const std::string name
 Name of this element (unique in its Machine)
 
const size_t index
 Index of this element (unique in its Machine)
 
double length
 Longitudual length of this element (added to StateBase::pos)
 

Friends

class Machine
 

Detailed Description

Base class for all simulated elements.

Sub-classes of ElementVoid must be registered with Machine::registerElement before they will be found by Machine::Machine().

Definition at line 166 of file base.h.

Constructor & Destructor Documentation

ElementVoid::ElementVoid ( const Config conf)

Construct this element using the provided Config.

Base class ctor makes use of Config parameters "name" and "length". "name" is required. "length" is option, and is 0.0 if omitted.

Sub-classes are allowed to require certain parameters to be provided.

Exceptions
KeyErrorIf a required parameter is missing
boost::bad_getIf a parameter exists, but has the wrong value type

Definition at line 54 of file base.cpp.

Member Function Documentation

void ElementVoid::assign ( const ElementVoid other)
pure virtual

Used by Machine::reconfigure() to avoid re-alloc (and iterator invalidation) Assumes other has the same type. Sub-classes must call base class assign() Come c++11 this can be replaced with a move ctor.

Implemented in MomentElementBase, and LinearElementBase< State >.

Definition at line 72 of file base.cpp.

void ElementVoid::set_observer ( Observer o)
inline

Add Observer which will inspect the output State of this Element. Observer instance musy outlive the Element.

Parameters
oA new Observer or NULL, will replace any existing pointer.

Definition at line 204 of file base.h.

void ElementVoid::show ( std::ostream &  strm,
int  level 
) const
virtual

Print information about the element. level is a hint as to the verbosity expected by the caller.

Reimplemented in MomentElementBase, and LinearElementBase< State >.

Definition at line 67 of file base.cpp.

virtual const char* ElementVoid::type_name ( ) const
pure virtual

Sub-classes must provide an approprate short description string. Must match the type name passed to Machine::registerElement().


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