Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Forward declarations
- class A;
- class B
- {
- public:
- B(A* aPtr) : m_pA(aPtr)
- void Schedule();
- void Update();
- private:
- A* m_pA;
- }
- void B::Schedule()
- {
- Timer::ref().Schedule(1000, [this]() { Update(); });
- }
- void B::Update()
- {
- m_pA->DoSomething();
- }
- class A
- {
- public:
- void Create() { m_B = std::make_unique<B>(); }
- void DoSomething() {}
- private:
- std::unique_ptr<B> m_B;
- }
Add Comment
Please, Sign In to add comment