Aeon Engine c550894
AeonGames Open Source Game Engine
Loading...
Searching...
No Matches
AeonGames::FlyWeight< Key, Value >::Handle Class Reference

Lightweight handle providing read-only access to a packed FlyWeight object. More...

#include <aeongames/FlyWeight.hpp>

Collaboration diagram for AeonGames::FlyWeight< Key, Value >::Handle:
Collaboration graph

Public Member Functions

 Handle (const Key &aKey)
 Construct a Handle for the given key.
const Value *const Get () const
 Retrieve a pointer to the stored Value.
const Handle GetHandle () const
 Get a copy of this Handle.
bool IsValid () const
 Check whether the referenced FlyWeight object is currently packed.
const Value *const operator-> () const
 Arrow operator for accessing the stored Value.
const Value & operator* () const
 Dereference operator for accessing the stored Value.
const Value *const operator& () const
 Address-of operator for obtaining a pointer to the stored Value.

Detailed Description

template<class Key, class Value>
class AeonGames::FlyWeight< Key, Value >::Handle

Lightweight handle providing read-only access to a packed FlyWeight object.

Definition at line 79 of file FlyWeight.hpp.

Constructor & Destructor Documentation

◆ Handle()

template<class Key, class Value>
AeonGames::FlyWeight< Key, Value >::Handle::Handle ( const Key & aKey)
inline

Construct a Handle for the given key.

Parameters
aKeyThe key identifying the FlyWeight object. Must not be the null/empty key.
Exceptions
std::runtime_errorif aKey is the null/empty key.

Definition at line 87 of file FlyWeight.hpp.

Member Function Documentation

◆ Get()

template<class Key, class Value>
const Value *const AeonGames::FlyWeight< Key, Value >::Handle::Get ( ) const
inline

Retrieve a pointer to the stored Value.

Returns
Pointer to the Value if found, nullptr otherwise.

Definition at line 97 of file FlyWeight.hpp.

◆ GetHandle()

template<class Key, class Value>
const Handle AeonGames::FlyWeight< Key, Value >::Handle::GetHandle ( ) const
inline

Get a copy of this Handle.

Returns
A new Handle with the same key.

Definition at line 109 of file FlyWeight.hpp.

◆ IsValid()

template<class Key, class Value>
bool AeonGames::FlyWeight< Key, Value >::Handle::IsValid ( ) const
inline

Check whether the referenced FlyWeight object is currently packed.

Returns
true if the object exists in the store, false otherwise.

Definition at line 116 of file FlyWeight.hpp.

◆ operator&()

template<class Key, class Value>
const Value *const AeonGames::FlyWeight< Key, Value >::Handle::operator& ( ) const
inline

Address-of operator for obtaining a pointer to the stored Value.

Returns
Pointer to the Value.
Exceptions
std::runtime_errorif the object is not packed.

Definition at line 150 of file FlyWeight.hpp.

◆ operator*()

template<class Key, class Value>
const Value & AeonGames::FlyWeight< Key, Value >::Handle::operator* ( ) const
inline

Dereference operator for accessing the stored Value.

Returns
Reference to the Value.
Exceptions
std::runtime_errorif the object is not packed.

Definition at line 137 of file FlyWeight.hpp.

◆ operator->()

template<class Key, class Value>
const Value *const AeonGames::FlyWeight< Key, Value >::Handle::operator-> ( ) const
inline

Arrow operator for accessing the stored Value.

Returns
Pointer to the Value.
Exceptions
std::runtime_errorif the object is not packed.

Definition at line 124 of file FlyWeight.hpp.


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