File indexing completed on 2024-04-06 12:29:43
0001 #ifndef RandomEngine_RandomEngineState_h
0002 #define RandomEngine_RandomEngineState_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #include <vector>
0023 #include <string>
0024 #include <cstdint>
0025
0026 class RandomEngineState {
0027 public:
0028 RandomEngineState();
0029
0030 ~RandomEngineState();
0031
0032 const std::string& getLabel() const { return label_; }
0033 const std::vector<uint32_t>& getState() const { return state_; }
0034 const std::vector<uint32_t>& getSeed() const { return seed_; }
0035
0036 void setLabel(const std::string& value) { label_ = value; }
0037 void setState(const std::vector<uint32_t>& value) { state_ = value; }
0038 void setSeed(const std::vector<uint32_t>& value) { seed_ = value; }
0039
0040 void clearSeedVector() { seed_.clear(); }
0041 void reserveSeedVector(std::vector<uint32_t>::size_type n) { seed_.reserve(n); }
0042 void push_back_seedVector(uint32_t v) { seed_.push_back(v); }
0043
0044 void clearStateVector() { state_.clear(); }
0045 void reserveStateVector(std::vector<uint32_t>::size_type n) { state_.reserve(n); }
0046 void push_back_stateVector(uint32_t v) { state_.push_back(v); }
0047
0048 bool operator<(RandomEngineState const& rhs) const { return label_ < rhs.label_; }
0049
0050 private:
0051 std::string label_;
0052 std::vector<uint32_t> state_;
0053 std::vector<uint32_t> seed_;
0054 };
0055
0056 #endif