EGSnrc C++ class library  Report PIRS-898 (2021)
Iwan Kawrakow, Ernesto Mainegra-Hing, Frederic Tessier, Reid Townson and Blake Walters
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
EGS_AusgabObject Class Referenceabstract
Inheritance diagram for EGS_AusgabObject:
EGS_Object BEAM_DoseScoring EGS_DoseScoring EGS_FluenceScoring EGS_PhspScoring EGS_RadiativeSplitting EGS_TrackScoring EGS_PlanarFluence EGS_VolumetricFluence

Public Member Functions

 EGS_AusgabObject (const string &Name="", EGS_ObjectFactory *f=0)
 Construct an ausgab object named Name.
 
 EGS_AusgabObject (EGS_Input *input, EGS_ObjectFactory *f=0)
 Construct an ausgab object from the input pointed to by inp. More...
 
virtual int processEvent (EGS_Application::AusgabCall iarg)=0
 Process an ausgab call for event iarg. More...
 
virtual int processEvent (EGS_Application::AusgabCall iarg, int ir)
 
virtual bool needsCall (EGS_Application::AusgabCall iarg) const
 Is the ausgab call iarg relevant for this object? More...
 
virtual void setApplication (EGS_Application *App)
 Set the application this object belongs to.
 
virtual void setCurrentCase (EGS_I64 ncase)
 Set the current event.
 
const char * getObjectDescription () const
 Get a short description of this ausgab object. More...
 
virtual bool storeState (ostream &data_out) const
 Store the source state into the stream data_out. More...
 
virtual bool setState (istream &data_in)
 Set the ausgab object state based on data from the stream data_in. More...
 
virtual bool addState (istream &data_in)
 Add data from the stream data_in to the ausgab object state. More...
 
virtual void resetCounter ()
 Reset the ausgab object state. More...
 
virtual void reportResults ()
 Report results. More...
 
- Public Member Functions inherited from EGS_Object
 EGS_Object (const string &Name="", EGS_ObjectFactory *f=0)
 Create an EGS_Object named Name belonging to the object factory f. More...
 
 EGS_Object (EGS_Input *inp, EGS_ObjectFactory *f=0)
 Create an EGS_Object from the information pointed to by inp that belongs to object factory f. More...
 
const string & getObjectName () const
 Get the object name.
 
void setObjectName (const string &Name)
 Set the object name to Name.
 
const string & getObjectType () const
 Get the object type.
 
virtual EGS_ObjectcreateObject (EGS_Input *inp)
 Create an object from the infromation pointed to by inp. More...
 
void setName (EGS_Input *inp)
 Set the name of the object from the information provided by inp. More...
 
int ref ()
 Increase the reference count to this object.
 
int deref ()
 Decrease the reference count to this object.
 
void setFactory (EGS_ObjectFactory *f)
 Set the factory to which the object belongs. More...
 

Static Public Member Functions

static void createAusgabObjects (EGS_Input *)
 Create ausgab objects from the information pointed to by input. More...
 
static EGS_AusgabObjectgetAusgabObject (const string &Name)
 Get a pointer to the ausgab object named Name. More...
 
static void addKnownAusgabObject (EGS_AusgabObject *o)
 Add a known ausgab object to the ausgab object factory. More...
 
static void addKnownTypeId (const char *name)
 Add a known ausgab object typeid to the ausgab object factory. More...
 
static int nObjects ()
 Returns the number of ausgab objects in the internal list.
 
static EGS_AusgabObjectgetObject (int j)
 Returns the j'th ausgab object in the internal list.
 
- Static Public Member Functions inherited from EGS_Object
static string getUniqueName (const EGS_Object *o=0)
 Create and return a unique object name. More...
 
static void deleteObject (EGS_Object *o)
 Delete an object. More...
 

Protected Attributes

string description
 A short ausgab object description. More...
 
EGS_Applicationapp
 The application this object belongs to.
 
- Protected Attributes inherited from EGS_Object
string name
 The object name.
 
string otype
 The object type.
 
int nref
 Number of references to the object.
 
EGS_ObjectFactoryfactory
 The factory this object belongs to.
 

Detailed Description

Definition at line 64 of file egs_ausgab_object.h.

Constructor & Destructor Documentation

EGS_AusgabObject::EGS_AusgabObject ( EGS_Input input,
EGS_ObjectFactory f = 0 
)

Construct an ausgab object from the input pointed to by inp.

The property tree pointed to by inp must contain at least the following key-value pairs:

name = name of this ausgab object
library = ausgab object library

plus additional information as needed by the ausgab object being created.

Definition at line 80 of file egs_ausgab_object.h.

Member Function Documentation

virtual int EGS_AusgabObject::processEvent ( EGS_Application::AusgabCall  iarg)
pure virtual

Process an ausgab call for event iarg.

Derived classes should implement scoring of quantities of interest or manipulations of the particle stack in this function.

virtual bool EGS_AusgabObject::needsCall ( EGS_Application::AusgabCall  iarg) const
virtual

Is the ausgab call iarg relevant for this object?

Derived classes should re-implement this function to return true for ausgab calls that are of interest to them.

Definition at line 100 of file egs_ausgab_object.h.

Referenced by EGS_Application::addAusgabObject().

const char* EGS_AusgabObject::getObjectDescription ( ) const

Get a short description of this ausgab object.

Derived classes should set description to a short string describing the ausgab object.

Definition at line 117 of file egs_ausgab_object.h.

virtual bool EGS_AusgabObject::storeState ( ostream &  data_out) const
virtual

Store the source state into the stream data_out.

Every ausgab object should reimplement this method to store the data needed to set the state of the object to its current state into the stream data_out. This is used for restarted calculations. Should return true on success, false on failure.

See Also
setState(), addState(), resetCounter().

Definition at line 129 of file egs_ausgab_object.h.

virtual bool EGS_AusgabObject::setState ( istream &  data_in)
virtual

Set the ausgab object state based on data from the stream data_in.

Every ausgab object should reimplement this method to read from the stream data_in data previously stored using storeState() and to set its state according to this data. This is used for restarted calculations. Should return true on success, false on failure (e.g. I/O error).

See Also
addState(), storeState(), resetCounter()

Definition at line 142 of file egs_ausgab_object.h.

virtual bool EGS_AusgabObject::addState ( istream &  data_in)
virtual

Add data from the stream data_in to the ausgab object state.

This method is required for combining the results of parallel runs. It should therefore be re-implemented in derived classes to update its own state with the data read from the input stream data_in.

See Also
storeState(), setState(), resetCounter().

Definition at line 154 of file egs_ausgab_object.h.

virtual void EGS_AusgabObject::resetCounter ( )
virtual

Reset the ausgab object state.

Derived ausgab objects should reimplement this method to reset all data describing their state to a "pristine" state. This is needed for combining the results of parallel runs where the generic implementation of EGS_Application::combineResults() uses this method to reset the ausgab object state and then uses the addState() function to add the ausgab object data from all other parallel jobs.

Definition at line 169 of file egs_ausgab_object.h.

virtual void EGS_AusgabObject::reportResults ( )
virtual

Report results.

Derived classes should reimplement this function to report results accumulated during the simulation.

Definition at line 177 of file egs_ausgab_object.h.

void EGS_AusgabObject::createAusgabObjects ( EGS_Input i)
static

Create ausgab objects from the information pointed to by input.

This static function creates all ausgab objects specified by the information stored in an EGS_Input object and pointed to by inp. It looks for a composite property ausgab object definition in the input tree. If such property exists, it looks for sub-properties ausgab object and for each such property that contains a library and name key-value pairs, loads the DSO specified by the library key, resolves the address of the createAusgabObject function that must be provided by the DSO and calls this function passing the ausgab object property to it. If the ausgab object property contains a valid information sufficient to create an ausgab object of the given type, the createAusgabObject function creates the ausgab object and returns a pointer to it. The process is continued until there are no further ausgab object properties in the ausgab object definition input. All ausgab objects created in this way are added to a global list list of ausgab objects and can be retrieved later by name using the getAusgabObject() static function.

Definition at line 46 of file egs_ausgab_object.cpp.

Referenced by EGS_Application::initAusgabObjects().

EGS_AusgabObject * EGS_AusgabObject::getAusgabObject ( const string &  Name)
static

Get a pointer to the ausgab object named Name.

A static list of ausgab objects created so far is maintained internally and this method can be used to get an ausgab object with a given name. Returns a pointer to the ausgab object, if an ausgab object named Name exists, null otherwise.

Definition at line 51 of file egs_ausgab_object.cpp.

References egsWarning, and EGS_Object::getObjectType().

void EGS_AusgabObject::addKnownAusgabObject ( EGS_AusgabObject o)
static

Add a known ausgab object to the ausgab object factory.

This function adds the object o to the list of known ausgab objects maintained internally by the static ausgab object factory. That way, an application can define its own ausgab objects (in addition to the ausgab objects provided by egspp) and use them.

Definition at line 66 of file egs_ausgab_object.cpp.

References egsInformation, and EGS_Object::getObjectType().

void EGS_AusgabObject::addKnownTypeId ( const char *  name)
static

Add a known ausgab object typeid to the ausgab object factory.

For whatever reason dynamic_cast to EGS_AusgabObject* from EGS_Object* fails when an application is made into a shared library and dynamically loads an ausgab object DSO. I'm therefore adding this method so that ausgab object classes can add their typeid to allow for an additional check in such cases.

Definition at line 72 of file egs_ausgab_object.cpp.

Member Data Documentation

string EGS_AusgabObject::description
protected

A short ausgab object description.

Derived ausgab object classes should set this data member to a short descriptive string.

Definition at line 242 of file egs_ausgab_object.h.

Referenced by EGS_PlanarFluence::describeMe(), and EGS_VolumetricFluence::describeMe().


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