CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch1/src/SimDataFormats/RandomEngine/interface/RandomEngineState.h

Go to the documentation of this file.
00001 #ifndef RandomEngine_RandomEngineState_h
00002 #define RandomEngine_RandomEngineState_h
00003 // -*- C++ -*-
00004 //
00005 // Package:     RandomEngine
00006 // Class  :     RandomEngineState
00007 // 
00017 //
00018 // Original Author:  W. David Dagenhart, Fermilab
00019 //         Created:  Tue Oct  3 09:56:36 CDT 2006
00020 // $Id: RandomEngineState.h,v 1.2 2011/01/04 17:55:19 wdd Exp $
00021 //
00022 
00023 #include <vector>
00024 #include <string>
00025 #include <boost/cstdint.hpp>
00026 
00027 
00028 class RandomEngineState {
00029 
00030   public:
00031 
00032   RandomEngineState();
00033 
00034   ~RandomEngineState();
00035 
00036   const std::string& getLabel() const { return label_; }
00037   const std::vector<uint32_t>& getState() const { return state_; }
00038   const std::vector<uint32_t>& getSeed() const { return seed_; }
00039 
00040   void setLabel(const std::string& value) { label_ = value; }
00041   void setState(const std::vector<uint32_t>& value) { state_ = value; }
00042   void setSeed(const std::vector<uint32_t>& value) { seed_ = value; }
00043 
00044   void clearSeedVector() { seed_.clear(); }
00045   void reserveSeedVector(std::vector<uint32_t>::size_type n) { seed_.reserve(n); }
00046   void push_back_seedVector(uint32_t v) { seed_.push_back(v); }
00047 
00048   void clearStateVector() { state_.clear(); }
00049   void reserveStateVector(std::vector<uint32_t>::size_type n) { state_.reserve(n); }
00050   void push_back_stateVector(uint32_t v) { state_.push_back(v); }
00051 
00052   bool operator<(RandomEngineState const& rhs) { return label_ < rhs.label_; }
00053 
00054   private:
00055 
00056   std::string label_;
00057   std::vector<uint32_t> state_;
00058   std::vector<uint32_t> seed_;
00059 };
00060 
00061 #endif