Drive Engine  1.0.0
Plateforme de reconstruction 3D
GarbageCollector.h
1 // Copyright (c) 2015. All rights reserved to DriveEngine Team.
2 
3 #pragma once
4 
5 #include "Public/IExportable.h"
6 #include <map>
7 #include <mutex>
8 
9 namespace DriveEngine
10 {
12  {
13  public:
14  static GarbageCollector& GetInstance()
15  {
16  static GarbageCollector instance;
17  return instance;
18  }
20 
21  private:
22  typedef std::map<const IExportable*, int> References;
23  typedef std::pair<const IExportable*, int> ReferencesPair;
24  References references;
25 
26  std::recursive_mutex mutex;
27 
29  GarbageCollector(GarbageCollector const&) = delete;
30  void operator=(GarbageCollector const&) = delete;
31 
32  public:
33  void Add(const IExportable* reference);
34  void Delete(const IExportable* reference);
35  bool IsReferenceExist(const IExportable* reference);
36  void Clear();
37  };
38 }
Definition: GarbageCollector.h:11
Definition: DefaultCalibrationInfoList.h:12
The main interface
Definition: IExportable.h:12