AgentsQueue.h 1.03 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 22 23 24 25 26 27 28 29 30 31 32 33 34 35
class AgentsQueue
{
public:
     static void Add(std::vector<Pedestrian*>& ped);
     static void GetandClear(std::vector<Pedestrian*>& peds);
     static bool IsEmpty();
     //static std::vector<Pedestrian*> GetandClear();

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

36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
/**
 * 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();

private:
     AgentsQueueOut(){};
     virtual ~AgentsQueueOut(){};
     static std::vector<Pedestrian*> _agentsQueue;
     static std::mutex _queueMutex;
};
53
#endif /* AGENTSQUEUE_H_ */