587 int range = nmax - nmin + 1;
594 int requiredBits = std::ceil(std::log(range) / std::log(2.0));
596 std::bitset<1> bitsRead1;
597 std::bitset<2> bitsRead2;
598 std::bitset<3> bitsRead3;
599 std::bitset<4> bitsRead4;
600 std::bitset<5> bitsRead5;
601 std::bitset<6> bitsRead6;
602 std::bitset<7> bitsRead7;
603 std::bitset<8> bitsRead8;
604 std::bitset<9> bitsRead9;
605 std::bitset<10> bitsRead10;
606 std::bitset<11> bitsRead11;
607 std::bitset<12> bitsRead12;
608 std::bitset<13> bitsRead13;
609 std::bitset<14> bitsRead14;
610 std::bitset<15> bitsRead15;
611 std::bitset<16> bitsRead16;
612 std::bitset<17> bitsRead17;
613 std::bitset<18> bitsRead18;
614 std::bitset<19> bitsRead19;
615 std::bitset<20> bitsRead20;
617 switch (requiredBits)
621 *n = (int)bitsRead1.to_ulong();
625 *n = (int)bitsRead2.to_ulong();
629 *n = (int)bitsRead3.to_ulong();
633 *n = (int)bitsRead4.to_ulong();
637 *n = (int)bitsRead5.to_ulong();
641 *n = (int)bitsRead6.to_ulong();
645 *n = (int)bitsRead7.to_ulong();
649 *n = (int)bitsRead8.to_ulong();
653 *n = (int)bitsRead9.to_ulong();
657 *n = (int)bitsRead10.to_ulong();
661 *n = (int)bitsRead11.to_ulong();
665 *n = (int)bitsRead12.to_ulong();
669 *n = (int)bitsRead13.to_ulong();
673 *n = (int)bitsRead14.to_ulong();
677 *n = (int)bitsRead15.to_ulong();
681 *n = (int)bitsRead16.to_ulong();
685 *n = (int)bitsRead17.to_ulong();
689 *n = (int)bitsRead18.to_ulong();
693 *n = (int)bitsRead19.to_ulong();
697 *n = (int)bitsRead20.to_ulong();
700 std::cout <<
"SerializeInteger Out of range!!" << std::endl;
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...