SimObjectVariationFactory.h

Go to the documentation of this file.
00001 
00011 #ifndef SIMOBJECTVARIATIONFACTORY_H_
00012 #define SIMOBJECTVARIATIONFACTORY_H_
00013 
00014 #include "SimObjectFactory.h"
00015 
00016 #include <string>
00017 using std::string;
00018 
00019 #include <map>
00020 using std::map;
00021 
00022 class SimObject;
00023 class Field;
00024 
00025 class RandomDistribution;
00026 class RandomEngine;
00027 
00029 
00032 class SimObjectVariationFactory : public SimObjectFactory {
00033   
00034     public:
00036         SimObjectVariationFactory( SimObjectFactory const& model );
00037         
00038         // copy constructor
00039         SimObjectVariationFactory( SimObjectVariationFactory const& model );
00040 
00042         virtual ~SimObjectVariationFactory();
00043 
00045         void set( string const& fieldname, RandomDistribution const& rd );
00046 
00048         virtual SimObject* create( void ) const;
00049 
00051         virtual SimObject* create( RandomEngine *eng ) const;
00052 
00054         virtual object_type_t getObjectTypeID() const;
00055 
00057 
00058         void setRandomEngine( RandomEngine *eng ) {
00059             rnd_eng = eng;
00060         };
00061 
00063         void unsetRandomEngine( void );
00064 
00065     protected:
00066 
00067         SimObject *m_base;
00068         RandomEngine *rnd_eng;
00069 
00070         struct FieldRngPair {
00071             FieldRngPair() : field(NULL), rng( NULL ) {}
00072             ;
00073             FieldRngPair( Field const* field, RandomDistribution *rng) : field(field), rng(rng) {}
00074             ;
00075             Field const* field;
00076             RandomDistribution *rng;
00077         };
00078 
00079         typedef map< string, FieldRngPair* > var_fields_t;
00080         var_fields_t m_var_fields;
00081 };
00082 
00083 #endif /*SIMOBJECTVARIATIONFACTORY_H_*/

Generated on Wed Jul 9 16:34:37 2008 for PCSIM by  doxygen 1.5.5