Manager.hpp
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <etk/types.hpp>
9 #include <ewol/object/Object.hpp>
10 #include <esignal/Signal.hpp>
11 #include <ewol/event/Time.hpp>
12 #include <echrono/Steady.hpp>
13 #include <echrono/Duration.hpp>
14 
15 namespace ewol {
16  class Context;
17  namespace object {
18  class Manager : public esignal::Interface {
19  protected:
20  std::recursive_mutex m_mutex;
21  private:
22  std::vector<ewol::ObjectWeak> m_eObjectList; // all widget allocated == > all time increment ... never removed ...
23  Context& m_context;
24  public:
25  Manager(Context& _context);
26  virtual ~Manager();
30  void unInit();
35  int32_t getNumberObject();
39  void displayListObject();
40  private:
42  friend class ewol::Object;
48  void add(const ewol::ObjectShared& _object);
49  public:
53  void cleanInternalRemoved();
59  ewol::ObjectShared get(const std::string& _name);
60  public:
66  ewol::ObjectShared getObjectNamed(const std::string& _name);
67  private:
68  std::vector<ewol::ObjectShared> m_workerList;
69  public:
74  void workerAdd(const ewol::ObjectShared& _worker);
79  void workerRemove(const ewol::ObjectShared& _worker);
80  public:
81  esignal::Signal<ewol::event::Time> periodicCall;
82  private:
83  echrono::Clock m_applWakeUpTime;
84  echrono::Clock m_lastPeriodicCallTime;
85  public: // ewol system internal :
90  void timeCall(const echrono::Clock& _localTime);
95  void timeCallResume(const echrono::Clock& _localTime);
100  bool timeCallHave();
101 
102  };
103  };
104 };
void unInit()
remove all resources (un-init) out of the destructor (due to the system implementation) ...
Basic message classes for ewol system this class mermit at every Object to communicate between them...
Definition: Object.hpp:113
void workerRemove(const ewol::ObjectShared &_worker)
Remove a worker on the system list.
void workerAdd(const ewol::ObjectShared &_worker)
Add a worker on the system list.
ewol::ObjectShared getObjectNamed(const std::string &_name)
retrive an object with his name
void displayListObject()
Display all object Open.
Definition: Area.hpp:16
int32_t getNumberObject()
Get the number of loaded object in the system.
void timeCallResume(const echrono::Clock &_localTime)
If the application is suspended The Ewol Object manager does not know it, just call this to update de...
Definition: Context.hpp:26
void cleanInternalRemoved()
clean the weak pointer list (remove weak_ptr that is remoed)
Definition: Manager.hpp:18
void timeCall(const echrono::Clock &_localTime)
Call every time we can with the current time.