Oxygine  1
2g game engine
Restorable.h
1 #pragma once
2 #include "oxygine-include.h"
3 #include "closure/closure.h"
4 #include <vector>
5 
6 namespace oxygine
7 {
8  class Restorable
9  {
10  public:
11  Restorable();
12  virtual ~Restorable();
13 
14  typedef std::vector<Restorable*> restorable;
15  static const restorable& getObjects();
16  static void restoreAll();
17  static void releaseAll();
18  static bool isRestored();
19 
20  virtual void* _getRestorableObject() = 0;
21  virtual void release() = 0;
22 
23  void restore();
24  typedef Closure<void (Restorable*, void* userData)> RestoreCallback;
25 
26  void reg(RestoreCallback cb, void* user);
27  void unreg();
28 
29  protected:
30 
31  private:
32  //non copyable
33  Restorable(const Restorable&);
34  const Restorable& operator=(const Restorable&);
35 
36  RestoreCallback _cb;
37  void* _userData;
38  bool _registered;
39  };
40 }
–oxgl-end–!
Definition: Actor.h:14
Definition: Restorable.h:8