forked from safeng/Online_Adaptive_Multi-Object_Tracking
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TrackSpaceAlloc.h
25 lines (23 loc) · 841 Bytes
/
TrackSpaceAlloc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#pragma once
#include "ObjTrack.h"
#include <queue>
typedef std::queue<ObjTrack*> ObjTrackQueue;
typedef std::queue<ObjSubTrack*> ObjSubTrackQueue;
/*space management of objtracks & objsubtracks*/
class TrackSpaceAlloc
{
private:
ObjTrack *trackSet; // Defines the internal space for object trajectories
ObjSubTrack *subTrackSet;//Defines pool of instances
int subTrackNO;
ObjTrackQueue objTrackQueue;
ObjSubTrackQueue objSubTrackQueue;
int IncreaseSubTrackCount(){if(subTrackNO>INT_MAX) subTrackNO = 1; else ++subTrackNO; return subTrackNO;} //assign a unique index
public:
void push_free_objTrack(ObjTrack *objTrack);
ObjTrack *pop_free_objTrack();
ObjSubTrack *pop_free_objSubTrack();
void push_free_objSubTrack(ObjSubTrack *subTrack);
TrackSpaceAlloc(void);//space allocation
~TrackSpaceAlloc(void);//space deallocation
};