AgentsQueue.h 1.09 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/*
 * AgentsQueue.h
 *
 *  Created on: 14.04.2015
 *      Author: piccolo
 */

#ifndef AGENTSQUEUE_H_
#define AGENTSQUEUE_H_


#include <mutex>
#include <vector>

//forward declaration
class Pedestrian;

18 19 20
/**
 * Queue for incoming agents
 */
21
class AgentsQueueIn
22 23 24 25 26
{
public:
     static void Add(std::vector<Pedestrian*>& ped);
     static void GetandClear(std::vector<Pedestrian*>& peds);
     static bool IsEmpty();
27
     static int Size();
28 29 30
     //static std::vector<Pedestrian*> GetandClear();

private:
31 32
     AgentsQueueIn(){};
     virtual ~AgentsQueueIn(){};
33 34 35 36
     static std::vector<Pedestrian*> _agentsQueue;
     static std::mutex _queueMutex;
};

37 38 39 40 41 42 43 44 45 46
/**
 * Queue for outgoing agents
 */
class AgentsQueueOut
{
public:
     static void Add(std::vector<Pedestrian*>& ped);
     static void Add(Pedestrian* ped);
     static void GetandClear(std::vector<Pedestrian*>& peds);
     static bool IsEmpty();
47
     static int Size();
48 49 50 51 52 53 54

private:
     AgentsQueueOut(){};
     virtual ~AgentsQueueOut(){};
     static std::vector<Pedestrian*> _agentsQueue;
     static std::mutex _queueMutex;
};
55

56
#endif /* AGENTSQUEUE_H_ */