VulkanRaytracingCycles 0.0.0
Cycles Render Engine With VulkanRaytracingShaderModules. ( Experiment , in progress)
front::SyncoTank< T > Class Template Reference

#include <AllocatorVk.h>

Public Member Functions

 SyncoTank ()
 
 ~SyncoTank ()
 
bool alloc1 ()
 
void add (const T &x)
 requires std::copy_constructible<T> More...
 
void add (const T &&x)
 requires std::copy_constructible<T> More...
 
void print ()
 

Detailed Description

template<class T>
class front::SyncoTank< T >

Definition at line 1850 of file AllocatorVk.h.

Constructor & Destructor Documentation

◆ SyncoTank()

template<class T >
front::SyncoTank< T >::SyncoTank
explicit

Definition at line 2030 of file AllocatorVk.cpp.

2031 : data{ nullptr }, size{ 0 }
2032 {}

◆ ~SyncoTank()

template<class T >
front::SyncoTank< T >::~SyncoTank

Definition at line 2035 of file AllocatorVk.cpp.

2035 {
2036
2037 std::for_each_n(data, size, [](T& x) {
2038 x.dealloc();
2039 });
2040 }

Member Function Documentation

◆ add() [1/2]

template<class T >
void front::SyncoTank< T >::add ( const T &&  x)

requires std::copy_constructible<T>

Definition at line 2065 of file AllocatorVk.cpp.

2066 {
2067 if (alloc1()) {
2068 data[size - 1] = x;
2069 print();
2070 }
2071
2072 };

◆ add() [2/2]

template<class T >
void front::SyncoTank< T >::add ( const T &  x)

requires std::copy_constructible<T>

Definition at line 2055 of file AllocatorVk.cpp.

2056 {
2057 if (alloc1()) {
2058 front::asignable(data[size - 1], x);
2059 print();
2060 }
2061
2062 };
void asignable(T &dst, const T &src)
Definition: AllocatorVk.h:1599

◆ alloc1()

template<class T >
bool front::SyncoTank< T >::alloc1

Definition at line 2043 of file AllocatorVk.cpp.

2043 {
2044 T* tmp = (T*)std::realloc(data, ++size * sizeof(T));
2045 if (tmp != nullptr) {
2046
2047 data = tmp;
2048 tmp = nullptr;
2049 return true;
2050 }
2051 return false;
2052 };

◆ print()

template<class T >
void front::SyncoTank< T >::print

Definition at line 2075 of file AllocatorVk.cpp.

2076 {
2077
2078 std::for_each_n(data, size, [](const T& x) {
2079 std::cout << x << std::endl;
2080 });
2081
2082 };

The documentation for this class was generated from the following files: