/* * RandomNumberEngine_Encapsulation.hpp * * Created on: Jan 01, 2011 * Author: heber */ #ifndef RANDOMNUMBERENGINE_ENCAPSULATION_HPP_ #define RANDOMNUMBERENGINE_ENCAPSULATION_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "CodePatterns/Creator.hpp" #include "RandomNumberEngine.hpp" //#include "RandomNumberGeneratorFactory.hpp" //#include "unittests/RandomNumberGeneratorFactoryUnitTest.hpp" class RandomNumberGeneratorFactory; class RandomNumberGeneratorFactoryTest; /** Template class that encapsulates the random number engines from * random::boost. * * * We need one template parameters: * -# the engine - generates uniform random numbers */ template class RandomNumberEngine_Encapsulation : public RandomNumberEngine, public Creator< RandomNumberEngine, RandomNumberEngine_Encapsulation > { /** * Factory is friend such that it can access private cstor. */ friend class RandomNumberGeneratorFactory; friend class RandomNumberGeneratorFactoryTest; public: /** Set the engine's seed. * * @param _seed seed to set to */ void seed(unsigned int _seed) { engine_type.seed(_seed); } /** Getter for the type name of the internal engine. * */ std::string name() { return typeid(engine_type).name(); } /** Getter for the engine instance. * * @return reference to instance */ engine& getEngine() { return engine_type; } /** Constructor that instantiates a specific random number generator and * distribution. * @param _engine_type instance of the desired engine */ RandomNumberEngine_Encapsulation() {} /** Destructor of the class. * */ virtual ~RandomNumberEngine_Encapsulation() {} private: engine engine_type; }; #endif /* RANDOMNUMBERENGINE_ENCAPSULATION_HPP_ */