VulkanRaytracingCycles 0.0.0
Cycles Render Engine With VulkanRaytracingShaderModules. ( Experiment , in progress)
front::oSyncoTank Struct Reference

#include <AllocatorVk.h>

Public Types

typedef Synco tankType
 

Public Member Functions

 oSyncoTank ()
 
 ~oSyncoTank ()
 
const tankType order (char t, int No=0)
 
void print ()
 
void flush ()
 
template<class T >
bool takeout (T *&dst, int No)
 
template<class T >
void add (T *&&x)
 

Public Attributes

size_t item = sizeof(Synco)
 
const tankType ** data = nullptr
 
std::size_t size = 0
 

Detailed Description

Definition at line 1536 of file AllocatorVk.h.

Member Typedef Documentation

◆ tankType

Definition at line 1540 of file AllocatorVk.h.

Constructor & Destructor Documentation

◆ oSyncoTank()

front::oSyncoTank::oSyncoTank ( )
explicit

Definition at line 1794 of file AllocatorVk.cpp.

1795 : data{ nullptr }, size{ 0 }
1796 {}
const tankType ** data
Definition: AllocatorVk.h:1543
std::size_t size
Definition: AllocatorVk.h:1544

◆ ~oSyncoTank()

front::oSyncoTank::~oSyncoTank ( )

Definition at line 1812 of file AllocatorVk.cpp.

1813 {
1814 flush();
1815 }

Member Function Documentation

◆ add()

template<class T >
void front::oSyncoTank::add ( T *&&  x)
inline

Definition at line 1571 of file AllocatorVk.h.

1571 {
1572 const tankType** tmp = (const tankType**)std::realloc((void*)data, ++size * sizeof(tankType*));
1573 if (tmp != nullptr) {
1574 data = tmp;
1575 tmp = nullptr;
1576
1577 tankType* syn = new Synco;
1578 syn->salting(std::move(x));
1579
1580 data[size - 1] = syn;
1581 syn = nullptr;
1582
1583 }
1584 else {
1585
1586 log_bad("Osynco Tank failed to allocate. is this full ? \n");
1587 return;
1588 }
1589 };
#define log_bad(...)
Definition: log.hpp:37
Synco * salting(T *&&ptr)
Definition: AllocatorVk.h:1506

◆ flush()

void front::oSyncoTank::flush ( )

Definition at line 1798 of file AllocatorVk.cpp.

1798 {
1799 if (data != nullptr) {
1800 for (int i = 0; i < size; i++) {
1801 delete data[i];
1802 }
1803 delete[] data;
1804 data = nullptr;
1805 }
1806 size = 0;
1807
1809 atomicType(name);
1810
1811 };
char atomicType(T type)
Definition: AllocatorVk.h:1460
#define FLUSH_TYPE

◆ order()

const oSyncoTank::tankType front::oSyncoTank::order ( char  t,
int  No = 0 
)

Definition at line 1820 of file AllocatorVk.cpp.

1820 {
1821
1822
1823 for (int i = 0; i < size; i++) {
1824 const tankType x = *data[i];
1825
1826 if (t == x.name && No == int(x.id - '0')) return x;
1827 };
1828 log_bad("your order is invalid. name %c id %d \n", t, No);
1829 return *(const tankType*)0;
1830
1831 };

◆ print()

void front::oSyncoTank::print ( )

Definition at line 1834 of file AllocatorVk.cpp.

1835 {
1836
1837 std::for_each_n(data, size, [](const tankType* x) {
1838 std::cout << "name :: " << int(x->name) << " id ::" << int(x->id) << std::endl;
1839 });
1840
1841 }

◆ takeout()

template<class T >
bool front::oSyncoTank::takeout ( T *&  dst,
int  No 
)
inline

Definition at line 1555 of file AllocatorVk.h.

1555 {
1556 char t = types::Type(dst);
1557 for (int i = 0; i < size; i++) {
1558 const tankType x = *data[i];
1559 if (t == x.name && No == int(x.id - '0')) {
1560 duplicate(dst, x.shn);
1561 return true;
1562 };
1563 };
1564
1565
1566 return false;
1567
1568 };
void duplicate(_Inout_opt_ T *&ptr, uintptr_t shn)
Definition: AllocatorVk.h:1487
TypeType Type(T *_)

Member Data Documentation

◆ data

const tankType** front::oSyncoTank::data = nullptr

Definition at line 1543 of file AllocatorVk.h.

◆ item

size_t front::oSyncoTank::item = sizeof(Synco)

Definition at line 1542 of file AllocatorVk.h.

◆ size

std::size_t front::oSyncoTank::size = 0

Definition at line 1544 of file AllocatorVk.h.


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