9 #define MAX_NUM_OF_CORES 32
12 int gettimeofday(
struct timeval* tp,
struct timezone* tzp);
38 return Id == other.
Id;
115 typedef uint32_t CoreMask;
195 static std::string m_AppName;
202 static void init(
int argc,
char* argv[])
213 size_t lastPos = m_AppName.rfind(
'/');
214 if (lastPos != std::string::npos)
216 m_AppName = m_AppName.substr(lastPos + 1);
220 lastPos = m_AppName.rfind(
'\\');
221 if (lastPos != std::string::npos)
223 m_AppName = m_AppName.substr(lastPos + 1);
227 lastPos = m_AppName.rfind(
'.');
228 if (lastPos != std::string::npos)
230 m_AppName.resize(lastPos);
235 static const std::string&
get()
269 void* m_ApplicationInterruptedCookie;
275 static int handlerRoutine(
unsigned long fdwCtrlType);
277 static void handlerRoutine(
int signum);
Definition: SystemUtils.h:193
static void init(int argc, char *argv[])
Definition: SystemUtils.h:202
static const std::string & get()
Definition: SystemUtils.h:235
Definition: SystemUtils.h:245
static ApplicationEventHandler & getInstance()
Definition: SystemUtils.h:254
void(* EventHandlerCallback)(void *cookie)
Definition: SystemUtils.h:250
void onApplicationInterrupted(EventHandlerCallback handler, void *cookie)
The main namespace for the PcapPlusPlus lib.
CoreMask createCoreMaskFromCoreIds(const std::vector< int > &coreIds)
void multiPlatformMSleep(uint32_t milliseconds)
std::string executeShellCommand(const std::string &command)
CoreMask createCoreMaskFromCoreVector(const std::vector< SystemCore > &cores)
CoreMask getCoreMaskForAllMachineCores()
void createCoreVectorFromCoreMask(CoreMask coreMask, std::vector< SystemCore > &resultVec)
uint32_t netToHost32(uint32_t net)
uint16_t hostToNet16(uint16_t host)
uint32_t hostToNet32(uint32_t host)
uint16_t netToHost16(uint16_t net)
int clockGetTime(long &sec, long &nsec)
void multiPlatformSleep(uint32_t seconds)
bool directoryExists(const std::string &dirPath)
Definition: SystemUtils.h:23
bool operator==(const SystemCore &other) const
Definition: SystemUtils.h:36
uint32_t Mask
Definition: SystemUtils.h:29
uint8_t Id
Core ID - a value between 0 and 31.
Definition: SystemUtils.h:32
Definition: SystemUtils.h:46
static const SystemCore Core9
Static representation of core #9.
Definition: SystemUtils.h:66
static const SystemCore Core16
Static representation of core #16.
Definition: SystemUtils.h:80
static const SystemCore Core15
Static representation of core #15.
Definition: SystemUtils.h:78
static const SystemCore Core29
Static representation of core #29.
Definition: SystemUtils.h:106
static const SystemCore Core26
Static representation of core #26.
Definition: SystemUtils.h:100
static const SystemCore Core13
Static representation of core #13.
Definition: SystemUtils.h:74
static const SystemCore Core22
Static representation of core #22.
Definition: SystemUtils.h:92
static const SystemCore Core10
Static representation of core #10.
Definition: SystemUtils.h:68
static const SystemCore Core8
Static representation of core #8.
Definition: SystemUtils.h:64
static const SystemCore Core1
Static representation of core #1.
Definition: SystemUtils.h:50
static const SystemCore Core23
Static representation of core #23.
Definition: SystemUtils.h:94
static const SystemCore Core17
Static representation of core #17.
Definition: SystemUtils.h:82
static const SystemCore Core14
Static representation of core #14.
Definition: SystemUtils.h:76
static const SystemCore Core20
Static representation of core #20.
Definition: SystemUtils.h:88
static const SystemCore Core3
Static representation of core #3.
Definition: SystemUtils.h:54
static const SystemCore Core27
Static representation of core #27.
Definition: SystemUtils.h:102
static const SystemCore Core30
Static representation of core #30.
Definition: SystemUtils.h:108
static const SystemCore Core18
Static representation of core #18.
Definition: SystemUtils.h:84
static const SystemCore Core0
Static representation of core #0.
Definition: SystemUtils.h:48
static const SystemCore Core12
Static representation of core #12.
Definition: SystemUtils.h:72
static const SystemCore Core24
Static representation of core #24.
Definition: SystemUtils.h:96
static const SystemCore Core25
Static representation of core #25.
Definition: SystemUtils.h:98
static const SystemCore Core11
Static representation of core #11.
Definition: SystemUtils.h:70
static const SystemCore Core28
Static representation of core #28.
Definition: SystemUtils.h:104
static const SystemCore Core7
Static representation of core #7.
Definition: SystemUtils.h:62
static const SystemCore Core19
Static representation of core #19.
Definition: SystemUtils.h:86
static const SystemCore Core4
Static representation of core #4.
Definition: SystemUtils.h:56
static const SystemCore IdToSystemCore[32]
A static array for mapping core ID (integer) to the corresponding static SystemCore representation.
Definition: SystemUtils.h:112
static const SystemCore Core31
Static representation of core #31.
Definition: SystemUtils.h:110
static const SystemCore Core2
Static representation of core #2.
Definition: SystemUtils.h:52
static const SystemCore Core5
Static representation of core #5.
Definition: SystemUtils.h:58
static const SystemCore Core6
Static representation of core #6.
Definition: SystemUtils.h:60
static const SystemCore Core21
Static representation of core #21.
Definition: SystemUtils.h:90