acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
call.h
1// Created by camilo on 2025-06-30 <3ThomasBorregaardSørensen!!
2#pragma once
3
4
5#include "acme/constant/call.h"
6
7
8class call
9{
10public:
11
12
13 enum_call m_ecall;
14 ::i64 m_i64;
15 ::i64 m_ll2; // here you should be able to put a pointer that has stable lifetime
16 ::subparticle * m_psubparticle; // here there can lie a object with reference count lifetime
17
18
19 call(enum_call ecall, ::i64 ll = 0ll, ::i64 ll2 = 0ll) :
20 m_ecall(ecall),
21 m_i64(ll),
22 m_ll2(ll2),
23 m_psubparticle(nullptr)
24 {
25
26
27 }
28
29
30 call(enum_call ecall, ::i64 ll, ::i64 ll2, ::subparticle* psubparticle) :
31 m_ecall(ecall),
32 m_i64(ll),
33 m_ll2(ll2),
34 m_psubparticle(psubparticle)
35 {
36
37 m_psubparticle->increment_reference_count();
38
39 }
40
41
42 call(const call& call) :
43 m_ecall(call.m_ecall),
44 m_i64(call.m_i64),
45 m_ll2(call.m_ll2),
46 m_psubparticle(call.m_psubparticle)
47 {
48
49 m_psubparticle->increment_reference_count();
50
51 }
52
53
54 call(call&& call) :
55 m_ecall(call.m_ecall),
56 m_i64(call.m_i64),
57 m_ll2(call.m_ll2),
58 m_psubparticle(call.m_psubparticle)
59 {
60
61 call.m_ecall = (enum_call)0;
62 call.m_psubparticle = nullptr;
63
64 }
65
66
67 ~call()
68 {
69
70 if (m_psubparticle)
71 {
72
73 try
74 {
75
76 m_psubparticle->release();
77
78 }
79 catch (...)
80 {
81
82
83 }
84
85 }
86
87 }
88
89
90 bool operator == (enum_call ecall) const
91 {
92
93 return m_ecall == ecall;
94
95 }
96
97
98};
99
100
101
Definition subparticle.h:78