Utils of manipulating integers, parsing configuration files and so on. More...
Classes | |
| class | ConfigParser |
| Parse config file and return its configurations in a versatile manner. More... | |
| class | DynamicIntX |
| Integer of any fixed length. More... | |
| class | PcapParser |
| Pcap Parser. More... | |
Functions | |
| template<typename T > | |
| T | Mangle (T key) |
| Mangling a multi-byte object. More... | |
| bool | IsPrime (int32_t n) |
| Compute primality of a 32-bit number. More... | |
| int32_t | NextPrime (int32_t n) |
| Find the next prime number. More... | |
| uint16_t | Net2Host16 (uint16_t val) |
| Convert a 2-byte word from network endian to the host endian. More... | |
| uint32_t | Net2Host32 (uint32_t val) |
| Convert a 4-byte word from network endian to host endian. More... | |
| bool | Endianness () |
| Endianness of the platform. More... | |
Utils of manipulating integers, parsing configuration files and so on.
Implementation of some utils.
Implementation of templated methods.
|
inline |
Endianness of the platform.
true on big endian; false on small endian. | bool OmniSketch::Util::IsPrime | ( | int32_t | n | ) |
Compute primality of a 32-bit number.
| n | Number to be checked |
true if is a prime; false otherwise.n must be positive. Otherwise an exception would be thrown. | T OmniSketch::Util::Mangle | ( | T | key | ) |
Mangling a multi-byte object.
| T | object type |
| key | the object |
| uint16_t OmniSketch::Util::Net2Host16 | ( | uint16_t | val | ) |
Convert a 2-byte word from network endian to the host endian.
| uint32_t OmniSketch::Util::Net2Host32 | ( | uint32_t | val | ) |
Convert a 4-byte word from network endian to host endian.
| int32_t OmniSketch::Util::NextPrime | ( | int32_t | n | ) |
Find the next prime number.
| n | Starting number |
n must be positive. Otherwise an exception would be thrown.