xentara-plugin v1.2.1
The Xentara Plugin Framework
Loading...
Searching...
No Matches
xentara::memory::ReadSentinel< Object< Type > > Class Template Referencefinal

A sentinel that protects read access to memory containing a single C++ object. More...

#include <memory/ReadSentinel_Object.hpp>

+ Inheritance diagram for xentara::memory::ReadSentinel< Object< Type > >:

Public Types

using TargetObject = memory::Object< Type >
 The object type describing the structure.
 
using Element = typename TargetObject::Element
 The C++ object type.
 

Public Member Functions

 ReadSentinel (const ObjectBlock< Type > &block)
 Constructor for a memory block.
 
 ReadSentinel (const ObjectHandle< Type > &handle)
 Constructor for a handle.
 
internal auto get () const noexcept -> const Element &
 Gets the object.
 
auto operator* () const noexcept -> const Element &
 Gets the object.
 
auto operator-> () const noexcept -> const Element *
 Member access operator.
 
auto end () -> void
 Ends reading prematurely.
 

Detailed Description

template<typename Type>
class xentara::memory::ReadSentinel< Object< Type > >

A sentinel that protects read access to memory containing a single C++ object.

Note
Objects of this class can be moved, but not copied.

Member Typedef Documentation

◆ Element

template<typename Type >
using xentara::memory::ReadSentinel< Object< Type > >::Element = typename TargetObject::Element

The C++ object type.

◆ TargetObject

template<typename Type >
using xentara::memory::ReadSentinel< Object< Type > >::TargetObject = memory::Object<Type>

The object type describing the structure.

Constructor & Destructor Documentation

◆ ReadSentinel() [1/2]

template<typename Type >
xentara::memory::ReadSentinel< Object< Type > >::ReadSentinel ( const ObjectBlock< Type > &  block)

Constructor for a memory block.

Parameters
blockThe memory block you wish to read from

◆ ReadSentinel() [2/2]

template<typename Type >
xentara::memory::ReadSentinel< Object< Type > >::ReadSentinel ( const ObjectHandle< Type > &  handle)

Constructor for a handle.

Parameters
handleThe handle you wish to read from

Member Function Documentation

◆ end()

template<typename Type >
auto xentara::memory::ReadSentinel< Object< Type > >::end ( ) -> void

Ends reading prematurely.

Warning
Do not access the data after you have called end()!

◆ get()

template<typename Type >
internal auto xentara::memory::ReadSentinel< Object< Type > >::get ( ) const -> const Element &
noexcept

Gets the object.

Returns
The object

◆ operator*()

template<typename Type >
auto xentara::memory::ReadSentinel< Object< Type > >::operator* ( ) const -> const Element &
noexcept

Gets the object.

Returns
The object

◆ operator->()

template<typename Type >
auto xentara::memory::ReadSentinel< Object< Type > >::operator-> ( ) const -> const Element *
noexcept

Member access operator.

Returns
A pointer to the object