|
@ -6,77 +6,74 @@ |
|
|
|
|
|
|
|
|
#include <thread> |
|
|
#include <thread> |
|
|
|
|
|
|
|
|
void get_status() { |
|
|
//void get_status() {
|
|
|
switch (BasicRanges::status()) { |
|
|
// switch (BasicRanges::status()) {
|
|
|
case BasicRanges::NO_INIT: |
|
|
// case BasicRanges::NO_INIT:
|
|
|
std::cout << "basic ranges no init" << std::endl; |
|
|
// std::cout << "basic ranges no init" << std::endl;
|
|
|
break; |
|
|
// break;
|
|
|
case BasicRanges::BUILDING: |
|
|
// case BasicRanges::BUILDING:
|
|
|
std::cout << "basic ranges building" << std::endl; |
|
|
// std::cout << "basic ranges building" << std::endl;
|
|
|
break; |
|
|
// break;
|
|
|
case BasicRanges::AVAILABLE: |
|
|
// case BasicRanges::AVAILABLE:
|
|
|
std::cout << "basic ranges available" << std::endl; |
|
|
// std::cout << "basic ranges available" << std::endl;
|
|
|
break; |
|
|
// break;
|
|
|
} |
|
|
// }
|
|
|
|
|
|
//
|
|
|
switch (AllCases::status()) { |
|
|
// switch (AllCases::status()) {
|
|
|
case AllCases::NO_INIT: |
|
|
// case AllCases::NO_INIT:
|
|
|
std::cout << "all cases no init" << std::endl; |
|
|
// std::cout << "all cases no init" << std::endl;
|
|
|
break; |
|
|
// break;
|
|
|
case AllCases::BUILDING: |
|
|
// case AllCases::BUILDING:
|
|
|
std::cout << "all cases building" << std::endl; |
|
|
// std::cout << "all cases building" << std::endl;
|
|
|
break; |
|
|
// break;
|
|
|
case AllCases::AVAILABLE: |
|
|
// case AllCases::AVAILABLE:
|
|
|
std::cout << "all cases available" << std::endl; |
|
|
// std::cout << "all cases available" << std::endl;
|
|
|
break; |
|
|
// break;
|
|
|
} |
|
|
// }
|
|
|
} |
|
|
//}
|
|
|
|
|
|
|
|
|
int main() { |
|
|
int main() { |
|
|
|
|
|
|
|
|
printf("%p\n", BasicRanges::build); |
|
|
// printf("%p\n", BasicRanges::build);
|
|
|
printf("%p\n", AllCases::build); |
|
|
// printf("%p\n", AllCases::build);
|
|
|
|
|
|
//
|
|
|
printf("%p\n", BasicRanges::status); |
|
|
// printf("%p\n", BasicRanges::status);
|
|
|
printf("%p\n", AllCases::status); |
|
|
// printf("%p\n", AllCases::status);
|
|
|
|
|
|
//
|
|
|
printf("%p\n", BasicRanges::fetch); |
|
|
// printf("%p\n", BasicRanges::fetch);
|
|
|
printf("%p\n", AllCases::fetch); |
|
|
// printf("%p\n", AllCases::fetch);
|
|
|
|
|
|
//
|
|
|
get_status(); |
|
|
// get_status();
|
|
|
BasicRanges::build(); |
|
|
// BasicRanges::build();
|
|
|
get_status(); |
|
|
// get_status();
|
|
|
AllCases::build(); |
|
|
// AllCases::build();
|
|
|
get_status(); |
|
|
// get_status();
|
|
|
|
|
|
//
|
|
|
std::cout << BasicRanges::fetch()->size() << std::endl; |
|
|
// std::cout << BasicRanges::fetch()->size() << std::endl;
|
|
|
|
|
|
//
|
|
|
uint32_t sum = 0; |
|
|
// uint32_t sum = 0;
|
|
|
for (auto const &all_case : *AllCases::fetch()) { |
|
|
// for (auto const &all_case : *AllCases::fetch()) {
|
|
|
sum += all_case.size(); |
|
|
// sum += all_case.size();
|
|
|
std::cout << " " << all_case.size() << std::endl; |
|
|
// std::cout << " " << all_case.size() << std::endl;
|
|
|
} |
|
|
// }
|
|
|
std::cout << sum << std::endl; |
|
|
// std::cout << sum << std::endl;
|
|
|
|
|
|
//
|
|
|
|
|
|
// std::cout << AllCases::fetch() << std::endl;
|
|
|
|
|
|
// std::cout << AllCases::BasicRanges::fetch() << std::endl;
|
|
|
|
|
|
// std::cout << BasicRanges::fetch() << std::endl;
|
|
|
|
|
|
|
|
|
std::cout << AllCases::fetch() << std::endl; |
|
|
|
|
|
std::cout << AllCases::BasicRanges::fetch() << std::endl; |
|
|
|
|
|
std::cout << BasicRanges::fetch() << std::endl; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::cout << CommonCode::check(0x123456789) << std::endl; |
|
|
|
|
|
std::cout << CommonCode::check(0x4FEA13400) << std::endl; |
|
|
|
|
|
|
|
|
// std::cout << CommonCode::check(0x123456789) << std::endl;
|
|
|
printf("%09lX\n", CommonCode("1A9bF0c0").unwrap()); |
|
|
// std::cout << CommonCode::check(0x4FEA13400) << std::endl;
|
|
|
std::cout << CommonCode(0x1A9BF0C00).to_string() << std::endl; |
|
|
//
|
|
|
std::cout << CommonCode(0x1A9BF0C00).to_string(true) << std::endl; |
|
|
// // TODO: should we return a CommonCode object like String::new(...) in rust?
|
|
|
|
|
|
// printf("%09lX\n", CommonCode::from_string("1A9bF0c0"));
|
|
|
|
|
|
// std::cout << CommonCode::to_string(0x1A9BF0C00) << std::endl;
|
|
|
|
|
|
// std::cout << CommonCode::to_string(0x1A9BF0C00, true) << std::endl;
|
|
|
|
|
|
|
|
|
|
|
|
// auto c = CommonCode("1A9bF0c0");
|
|
|
auto c = CommonCode("4Fea13400"); |
|
|
// std::cout << c.to_string(true) << std::endl;
|
|
|
std::cout << c.to_string(true) << std::endl; |
|
|
// std::cout << c.to_string() << std::endl;
|
|
|
std::cout << c.to_string() << std::endl; |
|
|
// printf("%09lX\n", c.unwrap());
|
|
|
printf("%09lX\n", c.unwrap()); |
|
|
//
|
|
|
|
|
|
// std::cout << CommonCode(0x1A9BF0C00).to_string() << std::endl;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// std::cout << ShortCode::check_mode() << std::endl;
|
|
|
// std::cout << ShortCode::check_mode() << std::endl;
|
|
|