Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
ECS::util::HandleTable< T, handle_type, grow > Class Template Reference

#include <Handle.h>

Public Member Functions

 HandleTable ()
 
 ~HandleTable ()
 
Handle AcquireHandle (T *rawObject)
 
void ReleaseHandle (Handle handle)
 
bool IsExpired (Handle handle) const
 
Handle operator[] (typename Handle::value_type index) const
 
T * operator[] (Handle handle)
 

Private Types

using Handle = handle_type
 
using TableEntry = std::pair< typename Handle::value_type, T * >
 

Private Member Functions

void GrowTable ()
 

Private Attributes

std::vector< TableEntrym_Table
 

Detailed Description

template<class T, class handle_type, size_t grow = 1024>
class ECS::util::HandleTable< T, handle_type, grow >

Definition at line 107 of file Handle.h.

Member Typedef Documentation

◆ Handle

template<class T , class handle_type , size_t grow = 1024>
using ECS::util::HandleTable< T, handle_type, grow >::Handle = handle_type
private

Definition at line 109 of file Handle.h.

◆ TableEntry

template<class T , class handle_type , size_t grow = 1024>
using ECS::util::HandleTable< T, handle_type, grow >::TableEntry = std::pair<typename Handle::value_type, T*>
private

Definition at line 113 of file Handle.h.

Constructor & Destructor Documentation

◆ HandleTable()

template<class T , class handle_type , size_t grow = 1024>
ECS::util::HandleTable< T, handle_type, grow >::HandleTable ( )
inline

Definition at line 134 of file Handle.h.

◆ ~HandleTable()

template<class T , class handle_type , size_t grow = 1024>
ECS::util::HandleTable< T, handle_type, grow >::~HandleTable ( )
inline

Definition at line 139 of file Handle.h.

Member Function Documentation

◆ AcquireHandle()

template<class T , class handle_type , size_t grow = 1024>
Handle ECS::util::HandleTable< T, handle_type, grow >::AcquireHandle ( T *  rawObject)
inline

Definition at line 142 of file Handle.h.

◆ GrowTable()

template<class T , class handle_type , size_t grow = 1024>
void ECS::util::HandleTable< T, handle_type, grow >::GrowTable ( )
inlineprivate

Definition at line 118 of file Handle.h.

◆ IsExpired()

template<class T , class handle_type , size_t grow = 1024>
bool ECS::util::HandleTable< T, handle_type, grow >::IsExpired ( Handle  handle) const
inline

Fn: inline bool HandleTable::IsValidHandle(const Handle& handle) const

Summary: Check if a 'handle' is expired, that is, its intern version is different from actual version stored in table.

Author: Tobias Stein

Date: 1/10/2017

Parameters: handle - The handle.

Returns: True if valid handle, false if not.

Definition at line 188 of file Handle.h.

◆ operator[]() [1/2]

template<class T , class handle_type , size_t grow = 1024>
T * ECS::util::HandleTable< T, handle_type, grow >::operator[] ( Handle  handle)
inline

Fn: inline T* HandleTable::operator[](Handle handle)

Summary: Returns the raw object stored for a handle.

Author: Tobias Stein

Date: 2/10/2017

Parameters: handle - Handle of the handle.

Returns: The indexed value.

Definition at line 229 of file Handle.h.

◆ operator[]() [2/2]

template<class T , class handle_type , size_t grow = 1024>
Handle ECS::util::HandleTable< T, handle_type, grow >::operator[] ( typename Handle::value_type  index) const
inline

Fn: Handle HandleTable::operator[](HANDLE_VALUE_TYPE i) const

Summary: Returns handle from table at position described by i.

Author: Tobias Stein

Date: 1/10/2017

Parameters: i - Zero-based index of the.

Returns: The indexed value.

Definition at line 208 of file Handle.h.

◆ ReleaseHandle()

template<class T , class handle_type , size_t grow = 1024>
void ECS::util::HandleTable< T, handle_type, grow >::ReleaseHandle ( Handle  handle)
inline

Definition at line 166 of file Handle.h.

Member Data Documentation

◆ m_Table

template<class T , class handle_type , size_t grow = 1024>
std::vector<TableEntry> ECS::util::HandleTable< T, handle_type, grow >::m_Table
private

Definition at line 115 of file Handle.h.


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