00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "CLHEP/Random/RandBit.h"
00018 #include <string>
00019
00020 namespace CLHEP {
00021
00022 std::string RandBit::name() const {return "RandBit";}
00023
00024 RandBit::~RandBit() {
00025 }
00026
00027 std::ostream & RandBit::put ( std::ostream & os ) const {
00028 os << " " << name() << "\n";
00029 RandFlat::put(os);
00030 return os;
00031 }
00032
00033 std::istream & RandBit::get ( std::istream & is ) {
00034 std::string inName;
00035 is >> inName;
00036 if (inName != name()) {
00037 is.clear(std::ios::badbit | is.rdstate());
00038 std::cerr << "Mismatch when expecting to read state of a "
00039 << name() << " distribution\n"
00040 << "Name found was " << inName
00041 << "\nistream is left in the badbit state\n";
00042 return is;
00043 }
00044 RandFlat::get(is);
00045 return is;
00046 }
00047
00048 }
00049