Symulacja NAT na przedmiot Symulacje Komputerowe
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

50 lines
763 B

/*
* Simulation.h
*
* Created on: 16.01.2017
* Author: piotrek
*/
#ifndef SIMULATION_H_
#define SIMULATION_H_
#include "common.h"
#include "Log.h"
enum THREAD_TYPE
{
NODE_RECV,
SIM_TIMER,
SIM_RESIZE,
NAT_FP,
};
struct threadParams
{
THREAD_TYPE type;
void *context;
pthread_t thread_id;
};
class Simulation : public Log
{
map<string, struct threadParams> threads;
int cols, rows;
string name;
unsigned long startTime;
public:
Simulation();
~Simulation();
void createThread(string name, THREAD_TYPE type, void * context);
void destroyThread(string name);
static void * threadWrapper(void * context);
void resizeWnd();
void timer();
void p2pSimulation();
void natOverflowSimulation(int nNodes);
};
#endif /* SIMULATION_H_ */