16 #include <corsika/framework/utility/Singleton.hpp> 18 #include <corsika/detail/framework/random/random_iterator/Stream.hpp> 25 template <
typename CBPRNG = random_iterator::philox>
31 typedef CBPRNG prng_type;
32 typedef std::uint64_t seed_type;
33 typedef std::string string_type;
34 typedef std::map<std::string, prng_type> streams_type;
57 inline bool isRegistered(string_type
const& streamName)
const;
63 inline std::stringstream
dumpState()
const;
73 const streams_type& getRngs()
const {
return rngs_; }
83 streams_type&
Rngs() {
return rngs_; }
85 seed_type getSeed()
const {
return seed_; }
87 void setSeed(seed_type seed) {
90 for (
auto& [streamName, rng] : rngs_) rng.setSeed(seed_);
94 RNGManager() =
default;
101 typedef typename RNGManager<>::prng_type default_prng_type;
105 #include <corsika/detail/framework/random/RNGManager.inl> streams_type & Rngs()
Non-constant access to the streams.
CORSIKA8 logging utilities.
void registerRandomStream(string_type const &streamName)
Curiously Recurring Template Pattern (CRTP) for Meyers singleton.
bool isRegistered(string_type const &streamName) const
std::stringstream dumpState() const
`, since they are used everywhere as integral part of the framework.
prng_type & getRandomStream(string_type const &streamName)