Memory block
We need to implement an abstract base class for all arbitrary data container objects called "memory_block".
Approach A:
* We cannot use built "const" of C++ on memory_block because it easy to have by accident privileged escalation.
It is better approach to have memory_block and const_memory_block as iterators do it.
A memory_block can be given wherever a const_memory_block is requested.
* We need to create a connector or reference of memory_blocks with already allocated memory. like a variable
Approach B
* Use built-in const but dont allow copy and copy constructable of ABC memory_block
Approach C
* Create a templated STL "Container" compliant type named array_ref<T> and create two type definitions mem_ref (byte) and cmem_ref (const byte)
- array_ref should be able to bind on any C array.
- array_ref must behave as an array except A = B must copy reference
- array_ref<byte> is a specialized version with a alias typedef "mem_ref" and can be constructed from a "MemoryContainer" concept
- array_ref<const byte> is a specialized version with a alias typedef "cmem_ref" and can be constructed from a "ContMemoryCont
RawMemoryContainer
members:
- byte * raw_ptr(size_t offset);
- size * raw_size() const;
ConstRawMemoryC
- inherit MemoryContainer
- const byte * raw_ptr(size_t offset) const;
Blueprint information
Whiteboard
Approach C seems to be the best of all. Implementation has already been started and seems robust
- Issue 1: The approach is not expandable.
- Issue 2: Cannot work well with objects that dont have a static memory space.
Work Items
Dependency tree
* Blueprints in grey have been implemented.