Loading...
Searching...
No Matches
instance.hpp
Go to the documentation of this file.
1
2#pragma once
3
4#include <map>
5
8
9struct byeolTest;
10
11namespace by {
12
13 class life;
14 class instancer;
15
41 class _nout instance: public typeProvidable, public clonable {
42 BY(ADT(instance))
43 friend class memliteInternal;
44
45 public:
46 class vault {
47 public:
48 void set(void* ptr, nidx chkN);
49 nidx get(void* ptr);
50 ncnt len() const;
51 nbool rel();
52 std::map<void*, int>& getVaults();
53
54 private:
55 std::map<void*, int> _vaults;
56 };
57
58 // instance:
59 instance();
60 explicit instance(id newId);
61 instance(const me& rhs);
62 virtual ~instance();
63
64 public:
65 me& operator=(const me& rhs) = default;
66 void* operator new(size_t sz) noexcept;
67 void operator delete(void* pt, size_t sz) noexcept;
68
69 public:
70 virtual id getId() const;
76 virtual nbool isHeap() const;
83 const life* getBindTag() const;
84
85 static vault& getVault();
86
87 protected:
88 // instance:
89 nbool _setId(id new1);
90 static instancer* _getMgr();
91
92 private:
93 id _id;
94 static vault _vault;
95 };
96} // namespace by
Interface for objects that can be cloned.
Definition clonable.hpp:13
Definition instance.hpp:46
Base class for all managed instances in memlite system.
Definition instance.hpp:41
virtual nbool isHeap() const
Checks if this instance is allocated on the heap.
const life * getBindTag() const
Returns a pointer to the associated life object for reference counting.
Singleton manager for instance lifecycle and memory allocation.
Definition instancer.hpp:16
Binding tag for instance reference tracking and lifecycle management.
Definition life.hpp:21
Definition memliteInternal.hpp:12
Interface for objects that can provide their type information.
Definition typeProvidable.hpp:13
Rich logging support with polymorphic type conversion.
Definition richLog.hpp:34