Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
ImSpanAllocator< CHUNKS > Struct Template Reference

#include <src/imgui/imgui_internal.h>

Public Member Functions

 ImSpanAllocator ()
 
void Reserve (int n, size_t sz, int a=4)
 
int GetArenaSizeInBytes ()
 
void SetArenaBasePtr (void *base_ptr)
 
voidGetSpanPtrBegin (int n)
 
voidGetSpanPtrEnd (int n)
 
template<typename T >
void GetSpan (int n, ImSpan< T > *span)
 

Public Attributes

char * BasePtr
 
int CurrOff
 
int CurrIdx
 
int Offsets [CHUNKS]
 
int Sizes [CHUNKS]
 

Detailed Description

template<int CHUNKS>
struct ImSpanAllocator< CHUNKS >

Constructor & Destructor Documentation

◆ ImSpanAllocator()

template<int CHUNKS>
ImSpanAllocator< CHUNKS >::ImSpanAllocator ( )
inline
592{ memset(this, 0, sizeof(*this)); }

Member Function Documentation

◆ GetArenaSizeInBytes()

template<int CHUNKS>
int ImSpanAllocator< CHUNKS >::GetArenaSizeInBytes ( )
inline
594{ return CurrOff; }
int CurrOff
Definition imgui_internal.h:587

References ImSpanAllocator< CHUNKS >::CurrOff.

Referenced by ImGui::TableBeginInitMemory().

+ Here is the caller graph for this function:

◆ GetSpan()

template<int CHUNKS>
template<typename T >
void ImSpanAllocator< CHUNKS >::GetSpan ( int  n,
ImSpan< T > *  span 
)
inline
599{ span->set((T*)GetSpanPtrBegin(n), (T*)GetSpanPtrEnd(n)); }
void * GetSpanPtrBegin(int n)
Definition imgui_internal.h:596
void * GetSpanPtrEnd(int n)
Definition imgui_internal.h:597
void set(T *data, int size)
Definition imgui_internal.h:564

References ImSpanAllocator< CHUNKS >::GetSpanPtrBegin(), ImSpanAllocator< CHUNKS >::GetSpanPtrEnd(), and ImSpan< T >::set().

Referenced by ImGui::TableBeginInitMemory().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetSpanPtrBegin()

template<int CHUNKS>
void * ImSpanAllocator< CHUNKS >::GetSpanPtrBegin ( int  n)
inline
596{ IM_ASSERT(n >= 0 && n < CHUNKS && CurrIdx == CHUNKS); return (void*)(BasePtr + Offsets[n]); }
#define IM_ASSERT(_EXPR)
Definition imgui.h:81
char * BasePtr
Definition imgui_internal.h:586
int Offsets[CHUNKS]
Definition imgui_internal.h:589
int CurrIdx
Definition imgui_internal.h:588

References ImSpanAllocator< CHUNKS >::BasePtr, ImSpanAllocator< CHUNKS >::CurrIdx, IM_ASSERT, and ImSpanAllocator< CHUNKS >::Offsets.

Referenced by ImSpanAllocator< CHUNKS >::GetSpan().

+ Here is the caller graph for this function:

◆ GetSpanPtrEnd()

template<int CHUNKS>
void * ImSpanAllocator< CHUNKS >::GetSpanPtrEnd ( int  n)
inline
597{ IM_ASSERT(n >= 0 && n < CHUNKS && CurrIdx == CHUNKS); return (void*)(BasePtr + Offsets[n] + Sizes[n]); }
int Sizes[CHUNKS]
Definition imgui_internal.h:590

References ImSpanAllocator< CHUNKS >::BasePtr, ImSpanAllocator< CHUNKS >::CurrIdx, IM_ASSERT, ImSpanAllocator< CHUNKS >::Offsets, and ImSpanAllocator< CHUNKS >::Sizes.

Referenced by ImSpanAllocator< CHUNKS >::GetSpan().

+ Here is the caller graph for this function:

◆ Reserve()

template<int CHUNKS>
void ImSpanAllocator< CHUNKS >::Reserve ( int  n,
size_t  sz,
int  a = 4 
)
inline
593{ IM_ASSERT(n == CurrIdx && n < CHUNKS); CurrOff = IM_MEMALIGN(CurrOff, a); Offsets[n] = CurrOff; Sizes[n] = (int)sz; CurrIdx++; CurrOff += (int)sz; }
#define IM_MEMALIGN(_OFF, _ALIGN)
Definition imgui_internal.h:229

References ImSpanAllocator< CHUNKS >::CurrIdx, ImSpanAllocator< CHUNKS >::CurrOff, IM_ASSERT, IM_MEMALIGN, ImSpanAllocator< CHUNKS >::Offsets, and ImSpanAllocator< CHUNKS >::Sizes.

Referenced by ImGui::TableBeginInitMemory().

+ Here is the caller graph for this function:

◆ SetArenaBasePtr()

template<int CHUNKS>
void ImSpanAllocator< CHUNKS >::SetArenaBasePtr ( void base_ptr)
inline
595{ BasePtr = (char*)base_ptr; }

References ImSpanAllocator< CHUNKS >::BasePtr.

Referenced by ImGui::TableBeginInitMemory().

+ Here is the caller graph for this function:

Member Data Documentation

◆ BasePtr

◆ CurrIdx

◆ CurrOff

template<int CHUNKS>
int ImSpanAllocator< CHUNKS >::CurrOff

◆ Offsets

◆ Sizes

template<int CHUNKS>
int ImSpanAllocator< CHUNKS >::Sizes[CHUNKS]

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