acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
poolable.h
1// Created by camilo on 2025-06-30 00:48 <3ThomasBorregaardSørensen!!
2#pragma once
3
4
5#include "acme/prototype/prototype/call.h"
6#include "acme/prototype/prototype/pool.h"
7
8
9template < typename POOL_RESTORABLE >
10class poolable :
11 virtual public ::particle
12{
13public:
14
15
16 bool m_bNew;
17
18 ::pool < POOL_RESTORABLE >* m_ppool;
19
20 poolable()
21 {
22
23 m_bNew = true;
24
25 }
26
27 bool is_new() const
28 {
29
30 return m_bNew;
31
32 }
33
34 void handle(const ::call& call) override
35 {
36
37 if (call == e_call_off_to_pool)
38 {
39
40 m_ppool->m_aPool.add(this);
41
42 }
43
44 }
45
46};
47
48
49