123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- #ifndef BOOST_RANDOM_RANDOM_DEVICE_HPP
- #define BOOST_RANDOM_RANDOM_DEVICE_HPP
- #include <string>
- #include <boost/config.hpp>
- #include <boost/noncopyable.hpp>
- #include <boost/random/detail/auto_link.hpp>
- #include <boost/system/config.hpp> // force autolink to find Boost.System
- namespace boost {
- namespace random {
- class random_device : private noncopyable
- {
- public:
- typedef unsigned int result_type;
- BOOST_STATIC_CONSTANT(bool, has_fixed_range = false);
-
- static BOOST_CONSTEXPR result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () { return 0; }
-
- static BOOST_CONSTEXPR result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () { return ~0u; }
-
- BOOST_RANDOM_DECL random_device();
-
- BOOST_RANDOM_DECL explicit random_device(const std::string& token);
- BOOST_RANDOM_DECL ~random_device();
-
- BOOST_RANDOM_DECL double entropy() const;
-
- BOOST_RANDOM_DECL unsigned int operator()();
-
- template<class Iter>
- void generate(Iter begin, Iter end)
- {
- for(; begin != end; ++begin) {
- *begin = (*this)();
- }
- }
- private:
- class impl;
- impl * pimpl;
- };
- }
- using random::random_device;
- }
- #endif
|