Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
ImChunkStream< T > Struct Template Reference

#include <src/imgui/imgui_internal.h>

+ Inheritance diagram for ImChunkStream< T >:
+ Collaboration diagram for ImChunkStream< T >:

Public Member Functions

void clear ()
 
bool empty () const
 
int size () const
 
T * alloc_chunk (size_t sz)
 
T * begin ()
 
T * next_chunk (T *p)
 
int chunk_size (const T *p)
 
T * end ()
 
int offset_from_ptr (const T *p)
 
T * ptr_from_offset (int off)
 
void swap (ImChunkStream< T > &rhs)
 

Public Attributes

ImVector< char > Buf
 

Detailed Description

template<typename T>
struct ImChunkStream< T >

Member Function Documentation

◆ alloc_chunk()

template<typename T >
T * ImChunkStream< T >::alloc_chunk ( size_t  sz)
inline
641{ size_t HDR_SZ = 4; sz = IM_MEMALIGN(HDR_SZ + sz, 4u); int off = Buf.Size; Buf.resize(off + (int)sz); ((int*)(void*)(Buf.Data + off))[0] = (int)sz; return (T*)(void*)(Buf.Data + off + (int)HDR_SZ); }
#define IM_MEMALIGN(_OFF, _ALIGN)
Definition imgui_internal.h:229
ImVector< char > Buf
Definition imgui_internal.h:636
int Size
Definition imgui.h:1655
T * Data
Definition imgui.h:1657
void resize(int new_size)
Definition imgui.h:1690

References ImVector< T >::Data, IM_MEMALIGN, ImVector< T >::resize(), and ImVector< T >::Size.

Referenced by ImGui::CreateNewWindowSettings(), ImGui::TableGcCompactSettings(), and ImGui::TableSettingsCreate().

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

◆ begin()

template<typename T >
T * ImChunkStream< T >::begin ( )
inline
642{ size_t HDR_SZ = 4; if (!Buf.Data) return NULL; return (T*)(void*)(Buf.Data + HDR_SZ); }

References ImVector< T >::Data.

Referenced by ImGui::FindWindowSettings(), ImGui::ShowMetricsWindow(), ImGui::TableGcCompactSettings(), ImGui::TableSettingsFindByID(), TableSettingsHandler_WriteAll(), WindowSettingsHandler_ApplyAll(), and WindowSettingsHandler_WriteAll().

+ Here is the caller graph for this function:

◆ chunk_size()

template<typename T >
int ImChunkStream< T >::chunk_size ( const T *  p)
inline
644{ return ((const int*)p)[-1]; }

◆ clear()

template<typename T >
void ImChunkStream< T >::clear ( )
inline
638{ Buf.clear(); }
void clear()
Definition imgui.h:1678

References ImVector< T >::clear().

Referenced by ImGui::Shutdown(), TableSettingsHandler_ClearAll(), and WindowSettingsHandler_ClearAll().

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

◆ empty()

template<typename T >
bool ImChunkStream< T >::empty ( ) const
inline
639{ return Buf.Size == 0; }

References ImVector< T >::Size.

Referenced by ImGui::UpdateSettings().

+ Here is the caller graph for this function:

◆ end()

template<typename T >
T * ImChunkStream< T >::end ( )
inline
645{ return (T*)(void*)(Buf.Data + Buf.Size); }

References ImVector< T >::Data, and ImVector< T >::Size.

◆ next_chunk()

template<typename T >
T * ImChunkStream< T >::next_chunk ( T *  p)
inline
643{ size_t HDR_SZ = 4; IM_ASSERT(p >= begin() && p < end()); p = (T*)(void*)((char*)(void*)p + chunk_size(p)); if (p == (T*)(void*)((char*)end() + HDR_SZ)) return (T*)0; IM_ASSERT(p < end()); return p; }
#define IM_ASSERT(_EXPR)
Definition imgui.h:81
T * begin()
Definition imgui_internal.h:642
int chunk_size(const T *p)
Definition imgui_internal.h:644
T * end()
Definition imgui_internal.h:645

References IM_ASSERT.

Referenced by ImGui::FindWindowSettings(), ImGui::ShowMetricsWindow(), ImGui::TableGcCompactSettings(), ImGui::TableSettingsFindByID(), TableSettingsHandler_WriteAll(), WindowSettingsHandler_ApplyAll(), and WindowSettingsHandler_WriteAll().

+ Here is the caller graph for this function:

◆ offset_from_ptr()

template<typename T >
int ImChunkStream< T >::offset_from_ptr ( const T *  p)
inline
646{ IM_ASSERT(p >= begin() && p < end()); const ptrdiff_t off = (const char*)p - Buf.Data; return (int)off; }

References ImVector< T >::Data, and IM_ASSERT.

Referenced by CreateNewWindow(), ImGui::TableLoadSettings(), ImGui::TableSaveSettings(), and WindowSettingsHandler_WriteAll().

+ Here is the caller graph for this function:

◆ ptr_from_offset()

template<typename T >
T * ImChunkStream< T >::ptr_from_offset ( int  off)
inline
647{ IM_ASSERT(off >= 4 && off < Buf.Size); return (T*)(void*)(Buf.Data + off); }

References ImVector< T >::Data, IM_ASSERT, and ImVector< T >::Size.

Referenced by ImGui::TableGetBoundSettings(), and WindowSettingsHandler_WriteAll().

+ Here is the caller graph for this function:

◆ size()

template<typename T >
int ImChunkStream< T >::size ( ) const
inline
640{ return Buf.Size; }

References ImVector< T >::Size.

Referenced by ImGui::ShowMetricsWindow(), and WindowSettingsHandler_WriteAll().

+ Here is the caller graph for this function:

◆ swap()

template<typename T >
void ImChunkStream< T >::swap ( ImChunkStream< T > &  rhs)
inline
648{ rhs.Buf.swap(Buf); }
void swap(ImVector< T > &rhs)
Definition imgui.h:1687

References ImChunkStream< T >::Buf, and ImVector< T >::swap().

Referenced by ImGui::TableGcCompactSettings().

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

Member Data Documentation

◆ Buf

template<typename T >
ImVector<char> ImChunkStream< T >::Buf

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