Started work on Smart Pointer Vectors (SPVs).
This commit is contained in:
parent
7bc4b9977d
commit
32f91ead4e
@ -82,6 +82,8 @@ set(EHS_SOURCES
|
||||
include/ehs/UniPtr.h
|
||||
include/ehs/ShdPtr.h
|
||||
include/ehs/WkPtr.h
|
||||
include/ehs/SPV.h
|
||||
include/ehs/SPVE.h
|
||||
|
||||
src/db/DbVarTmpl.cpp include/ehs/db/DbVarTmpl.h
|
||||
|
||||
@ -187,6 +189,8 @@ set(EHS_SOURCES
|
||||
include/ehs/io/Directory.h
|
||||
include/ehs/io/socket/ehc/NetEnc.h
|
||||
src/io/socket/ehc/NetEnc.cpp
|
||||
src/SPVE.cpp
|
||||
src/SPV.cpp
|
||||
)
|
||||
|
||||
if (IS_OS_WINDOWS)
|
||||
|
26
include/ehs/SPV.h
Normal file
26
include/ehs/SPV.h
Normal file
@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
#include "Types.h"
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
template <typename T>
|
||||
class SPVE;
|
||||
|
||||
template <typename T>
|
||||
class SPV
|
||||
{
|
||||
private:
|
||||
Size size;
|
||||
Size rawSize;
|
||||
Size stride;
|
||||
T *data;
|
||||
|
||||
public:
|
||||
SPV();
|
||||
|
||||
SPVE<T> operator[](Size index)
|
||||
{
|
||||
return SPVE<T>(data[index]);
|
||||
}
|
||||
};
|
||||
}
|
25
include/ehs/SPVE.h
Normal file
25
include/ehs/SPVE.h
Normal file
@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
namespace ehs
|
||||
{
|
||||
template <typename T>
|
||||
class SPVE
|
||||
{
|
||||
private:
|
||||
SPV *owner;
|
||||
T *value;
|
||||
|
||||
public:
|
||||
SPVE();
|
||||
|
||||
SPVE(T *value);
|
||||
|
||||
SPVE(SPVE &&spve) noexcept;
|
||||
|
||||
SPVE(const SPVE &spve);
|
||||
|
||||
SPVE &operator=(SPVE &&spve) noexcept;
|
||||
|
||||
SPVE &operator=(const SPVE &spve);
|
||||
};
|
||||
}
|
3
src/SPV.cpp
Normal file
3
src/SPV.cpp
Normal file
@ -0,0 +1,3 @@
|
||||
//
|
||||
// Created by Arron Nelson on 12/2/2024.
|
||||
//
|
3
src/SPVE.cpp
Normal file
3
src/SPVE.cpp
Normal file
@ -0,0 +1,3 @@
|
||||
//
|
||||
// Created by Arron Nelson on 12/2/2024.
|
||||
//
|
Loading…
Reference in New Issue
Block a user