acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
_impl.h
1// Working on it on 2023-11-27 03:34 <3ThomasBorregaardSorensen!!
2#pragma once
3
4/*
5#if !defined(WINDOWS) \
6 && !defined(LINUX) \
7 && !defined(__APPLE__) \
8 && !defined(__ANDROID__) \
9 && !defined(FREEBSD) \
10 && !defined(OPENBSD)
11
12namespace std { enum class align_val_t : std::size_t {}; }
13
14#endif
15*/
16
17
18
19//inline fork_block::fork_block(const memory_base & memory) :
20// fork_block(memory.get_data(), memory.get_size())
21//{
22//
23//}
24
25
26#ifndef __cplusplus_winrt
27
28
29
30
31#endif // __cplusplus_winrt
32
33
34//struct lparam_debug :
35// virtual matter
36//{
37//
38//};
39//
40//CLASS_DECL_ACME lparam_debug & lparam_debug();
41//
42
43//template<class TYPE>
44//inline void dump_elements(dump_context & dumpcontext, const TYPE* pElements, ::collection::count nCount)
45//{
46//
47// ENSURE((nCount == 0) || (pElements != nullptr));
48// ASSERT((nCount == 0) ||
49// is_memory_segment_ok(pElements, (size_t)nCount * sizeof(TYPE), false));
50//#ifdef WINDOWS
51// &dumpcontext; // not used
52// pElements; // not used
53// nCount; // not used
54//#endif
55// // default does nothing
56//
57//}
58
59
60
61
62//namespace acme
63//{
64//
65//
66// template < class APP >
67// ::pointer<::platform::application>single_application_library < APP > ::get_new_application(::particle * pparticle, const ::scoped_string & scopedstrAppId)
68// {
69//
70// if(!contains_app(scopedstrAppId))
71// {
72//
73// return error_not_found;
74//
75// }
76//
77// auto pappNew = allocateø APP();
78//
79// if(pappNew == nullptr)
80// {
81//
82// return error_no_memory;
83//
84// }
85//
86// ::pointer<::platform::application>papp;
87//
88// papp = pappNew;
89//
90// if (!papp)
91// {
92//
93// return error_wrong_type;
94//
95// }
96//
97// auto estatus = papp->initialize(pparticle);
98//
99// if (!estatus)
100// {
101//
102// return estatus;
103//
104// }
105//
106// return papp;
107//
108// }
109//
110//
111// template < class APP >
112// void single_application_library < APP > ::get_extension_list(string_array_base & stra)
113// {
114//
115// if (m_strFileExt.has_character())
116// {
117//
118// stra.add(m_strFileExt);
119//
120// }
121//
122// }
123//
124//
125//} // namespace acme
126
127
128
129
130
131
132
133template < typename T >
134const_char_pointer memory_counter_id(T * pthis)
135{
136
137 return typeid(*pthis).name();
138
139}
140
141
142//template < typename T >
143//void memory_counter_increment(T * pthis)
144//{
145//
146// if (memory_counter_on())
147// {
148//
149// auto psz = memory_counter_id(pthis);
150//
151// _memory_counter_increment(scopedstr);
152//
153// //synchronous_lock synchronouslock(g_pmutexMemoryCounters, DEFAULT_SYNCHRONOUS_LOCK_SUFFIX);
154//
155// //::i32 i = atoi(file_system()->as_string(path));
156//
157// //file_system()->put_contents(path, as_string(i + 1));
158// }
159//
160//}
161//
162//
163//template < typename T >
164//void memory_counter_decrement(T * pthis)
165//{
166//
167// if (memory_counter_on())
168// {
169//
170// auto psz = memory_counter_id(pthis);
171//
172// _memory_counter_decrement(scopedstr);
173//
174// //::i32 i = atoi(file_system()->as_string(path));
175//
176// //file_system()->put_contents(path, as_string(i - 1));
177//
178// }
179//
180//}
181
182//
183//namespace acme
184//{
185//
186//
187// template < typename T >
188// inline void delobj(T * & p)
189// {
190//
191// try
192// {
193//
194// if (::is_set(p))
195// {
196//
197// T * pdel = p;
198//
199// p = nullptr;
200//
201// delete pdel;
202//
203// }
204//
205// }
206// catch (...)
207// {
208//
209// }
210//
211// }
212//
213//
214//} // namespace acme
215//
216//
218//
219//
220//template < typename BASE >
221//inline ::pointer<BASE>alloc_object(::particle * pparticle)
222//{
223//
224// return BASE::g_pallocfactory->alloc_object(pparticle);
225//
226//}
227//
228//
229//template < typename BASE >
230//inline ::pointer<BASE>& alloc_object(::pointer<BASE> p, ::particle * pparticle)
231//{
232//
233// return p = ::alloc_object < BASE > (pparticle);
234//
235//}
236//
244//
245//
246//template < typename TDST, typename TSRC >
247//inline ::pointer<TDST>& clone(::pointer<TDST> dst, const ::pointer<TSRC>src)
248//{
249//
250// if (src.is_null())
251// {
252//
253// dst.release();
254//
255// return dst;
256//
257// }
258//
259// return dst = ::pointer_transfer(src->clone());
260//
261//}
262//
263//
278//template < typename T >
279//template < typename T2 >
280//inline pointer < T > & pointer < T >::clone(T2 * p)
281//{
282//
283// if (::is_null(p))
284// {
285//
286// release();
287//
288// return *this;
289//
290// }
291//
292// return operator = (p->clone());
293//
294//}
295//
296//
302//
336//
337//
338//namespace acme
339//{
340//
341//
342// namespace chill
343// {
344//
345//
346// template < typename TYPE >
347// inline TYPE default_payload()
348// {
349//
350// throw ::interface_only("template only exception");
351//
352// }
353//
354//
355// } // namespace chill
356//
357//
358//} // namespace acme
359//
360//
384//
385//#ifndef WINDOWS
386//
387//
388//inline ::i64 MulDiv(::i64 nNumber, ::i32 iNum, ::i32 iDen)
389//{
390//
391// return nNumber * iNum / iDen;
392//
393//}
394//
395//#endif
396//
397//
398//#ifndef __cplusplus_winrt
399//
400//
401//template < prototype_integral MULTIPLICATOR, prototype_integral NUMERATOR, prototype_integral DENOMINATOR, prototype_integral RESULT >
402//inline RESULT muldiv(MULTIPLICATOR iMultiplicator, NUMERATOR iNumerator, DENOMINATOR iDenominator)
403//{
404//
405// return iMultiplicator * iNumerator / iDenominator;
406//
407//}
476//
477//#endif // __cplusplus_winrt
479//
480//
481
482
483#include "allocator.h"
484
485
486//template < typename T, typename ...Args >
487//inline T * __call_allocate(Args &&... args)
488//{
489//
490// auto p = ::platform::allocator::__callnew T (::std::forward < Args >(args)...);
491//
492// return p;
493//
494//}
495
496//
497//template < typename T >
498//inline void __call__delete(T * p)
499//{
500//
501// ::platform::allocator::__call__delete < T >(p);
502//
503//}
504
505//
506//template < typename T >
507//inline T * øallocate_array(::collection::count c)
508//{
509//
510// auto p = ::platform::allocator::new T[c];
511//
512// return p;
513//
514//}
515
516
517//template < typename T >
518//inline void __delete(T * p)
519//{
520//
521// ::platform::allocator::__delete < T >(p);
522//
523//}
524
525//template < typename T >
526//inline void __delete(T* p, void * pAllocation)
527//{
528//
529// ::platform::allocator::__delete < T >(p, pAllocation);
530//
531//}
532