Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

PsNullOutputCreator Class Reference

#include <PsNullOutputCreator.h>

Collaboration diagram for PsNullOutputCreator:

Collaboration graph
[legend]
List of all members.

Static Public Methods

void setController (PsController *)
template<typename Type> PsOutput< Type > * getNullOutput ()

Static Protected Methods

PsControllergetController ()
PsSimulatedObjectgetSimulatedObject ()

Static Protected Attributes

PsController_theController = 0
PsSimulatedObject_theEmptyObject = 0
map< const char *, PsOutputNT * > _theNullOutputs

Member Function Documentation

PsController & PsNullOutputCreator::getController   [static, protected]
 

Definition at line 35 of file PsNullOutputCreator.cxx.

References _theController.

Referenced by getSimulatedObject().

00036 {
00037    assert ( _theController != 0 ) ;
00038    return *_theController ;
00039 }

template<typename Type>
PsOutput< Type > * PsNullOutputCreator::getNullOutput   [static]
 

Definition at line 44 of file PsNullOutputCreator.h.

References _theNullOutputs, map< const char *, PsOutputNT * >::end(), map< const char *, PsOutputNT * >::find(), pair< iterator, bool >::first, getSimulatedObject(), and map< const char *, PsOutputNT * >::insert().

00046 {
00047    PsOutput<Type> * result ;
00048    map <const char *, PsOutputNT *>::iterator i = _theNullOutputs.find ( typeid(Type).name() ) ;
00049    if ( i == _theNullOutputs.end() ) 
00050       {
00051          result  = new PsNullOutput<Type>( PsNullOutputCreator::getSimulatedObject() ) ;
00052          i = _theNullOutputs.insert(map <const char *, PsOutputNT *>::value_type (typeid(Type).name(), 
00053                                                                                        result ) ).first ;
00054       }
00055    else 
00056       {
00057          result = dynamic_cast <PsNullOutput<Type> *> (i->second) ;
00058          assert ( result != NULL );
00059       }
00060    return result ;

PsSimulatedObject & PsNullOutputCreator::getSimulatedObject   [static, protected]
 

Definition at line 41 of file PsNullOutputCreator.cxx.

References _theEmptyObject, and getController().

Referenced by getNullOutput().

00042 {
00043    static const PsObjectDescriptor emptyObjectDescriptor("NullObject",
00044                                                          "BaseSimulatedObject",
00045                                                          "NoProcess",
00046                                                          0,
00047                                                          NULL) ;
00048    if ( _theEmptyObject == 0 )
00049       {
00050          _theEmptyObject = new PsSimulatedObject (getController(), emptyObjectDescriptor ) ;
00051       }
00052    return *_theEmptyObject ;
00053 }

void PsNullOutputCreator::setController PsController   [static]
 

Definition at line 27 of file PsNullOutputCreator.cxx.

References _theController.

Referenced by PsController::PsController().

00028 {
00029    if ( _theController == 0 )
00030       {
00031          _theController = ctrl ;
00032       }
00033 }


Member Data Documentation

PsController * PsNullOutputCreator::_theController = 0 [static, protected]
 

Definition at line 23 of file PsNullOutputCreator.cxx.

Referenced by getController(), and setController().

PsSimulatedObject * PsNullOutputCreator::_theEmptyObject = 0 [static, protected]
 

Definition at line 24 of file PsNullOutputCreator.cxx.

Referenced by getSimulatedObject().

map< const char *, PsOutputNT * > PsNullOutputCreator::_theNullOutputs [static, protected]
 

Definition at line 25 of file PsNullOutputCreator.cxx.

Referenced by getNullOutput().


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

Documentation generated on Mon Nov 25 15:26:16 2002

Generated with doxygen 1.2.12 by Dimitri van Heesch ,   1997-2001