PeriDyno 1.0.0
Loading...
Searching...
No Matches
STLBuffer.h
Go to the documentation of this file.
1#ifndef STLBUFFER_H
2#define STLBUFFER_H
3
4#include "Platform.h"
5
6namespace dyno
7{
13 template <typename T>
15 {
16 public:
17 using iterator = T * ;
18
19 DYN_FUNC STLBuffer() {};
20
21 DYN_FUNC void reserve(T* beg, uint buffer_size) {
22 m_startLoc = beg;
23 m_maxSize = buffer_size;
24 }
25
26 DYN_FUNC uint max_size() { return m_maxSize; }
27
28// DYN_FUNC inline T& operator[] (unsigned int) { return m_startLoc[i]; }
29// DYN_FUNC inline const T& operator[] (unsigned int) const { return m_startLoc[i]; }
30
31 protected:
32 DYN_FUNC inline T* bufferEnd() {
33 return m_startLoc + m_maxSize;
34 }
35
37
38 T* m_startLoc = nullptr;
39 };
40}
41
42#endif // STLBUFFER_H
DYN_FUNC void reserve(T *beg, uint buffer_size)
Definition STLBuffer.h:21
DYN_FUNC T * bufferEnd()
Definition STLBuffer.h:32
DYN_FUNC STLBuffer()
Definition STLBuffer.h:19
DYN_FUNC uint max_size()
Definition STLBuffer.h:26
#define T(t)
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
unsigned int uint
Definition VkProgram.h:14