ALib C++ Framework
by
Library Version: 2605 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::system::MappedFile::Data< T > Class Template Reference

Description:

template<typename T>
class alib::system::MappedFile::Data< T >

A minimal sequential-only cursor over the file data. Enforces the "forward-only" usage pattern in calling code.

Template Parameters
TThe data type to sequentially load from this cursor.

Definition at line 23 of file mappedfile.hpp.

#include <mappedfile.hpp>

Public Method Index:

 Data ()
 Defaulted default-constructor.
 Data (const void *pStart, size_t length)
template<typename U>
Data< U > Clone () const noexcept
const T Current () const noexcept
bool IsEOF () const noexcept
template<typename TCheck = alib::CHK>
Next ()
template<typename TCheck = alib::CHK>
operator() ()
const T operator* () const noexcept
integer Remaining () const noexcept
template<typename TIntegral>
void Skip (TIntegral n)

Protected Field Index:

const T * end
 Pointer to the end of the data.
const T * start
 Current pointer position.

Field Details:

◆ end

template<typename T>
const T* alib::system::MappedFile::Data< T >::end
protected

Pointer to the end of the data.

Definition at line 26 of file mappedfile.hpp.

◆ start

template<typename T>
const T* alib::system::MappedFile::Data< T >::start
protected

Current pointer position.

Definition at line 25 of file mappedfile.hpp.

Constructor(s) / Destructor Details:

◆ Data() [1/2]

template<typename T>
alib::system::MappedFile::Data< T >::Data ( )
inline

Defaulted default-constructor.

Definition at line 30 of file mappedfile.hpp.

◆ Data() [2/2]

template<typename T>
alib::system::MappedFile::Data< T >::Data ( const void * pStart,
size_t length )
inline

Constructor.

Parameters
pStartPointer to the start of the data.
lengthThe length of the data.

Definition at line 35 of file mappedfile.hpp.

Method Details:

◆ Clone()

template<typename T>
template<typename U>
Data< U > alib::system::MappedFile::Data< T >::Clone ( ) const
inlinenoexcept

Clones this object to represent values of template type U.

Template Parameters
UThe type of the cloned data instance
Returns
A clone of this instance.

Definition at line 97 of file mappedfile.hpp.

Here is the call graph for this function:

◆ Current()

template<typename T>
const T alib::system::MappedFile::Data< T >::Current ( ) const
inlinenoexcept

Get a pointer to the current position (read-only).

Returns
Pointer to current position.

Definition at line 80 of file mappedfile.hpp.

◆ IsEOF()

template<typename T>
bool alib::system::MappedFile::Data< T >::IsEOF ( ) const
inlinenoexcept

True if at end.

Returns
true if the current position reached end, false otherwise.

Definition at line 53 of file mappedfile.hpp.

◆ Next()

template<typename T>
template<typename TCheck = alib::CHK>
T alib::system::MappedFile::Data< T >::Next ( )
inline

Get the next value and advance.

Template Parameters
TCheckDefaults to alib::CHK, which is the normal invocation mode. If alib::NC is given, no range check is performed. In debug builds, an assertion is raised if the cursor is at end.
Returns
The value at current position.

Definition at line 61 of file mappedfile.hpp.

◆ operator()()

template<typename T>
template<typename TCheck = alib::CHK>
T alib::system::MappedFile::Data< T >::operator() ( )
inline

Shortcut to method Next.

Template Parameters
TCheckDefaults to alib::CHK, which is the normal invocation mode. If alib::NC is given, no range check is performed. In debug builds, an assertion is raised if the cursor is at end.
Returns
The value at current position.

Definition at line 76 of file mappedfile.hpp.

Here is the call graph for this function:

◆ operator*()

template<typename T>
const T alib::system::MappedFile::Data< T >::operator* ( ) const
inlinenoexcept

Same as Current.

Returns
Pointer to current position.

Definition at line 84 of file mappedfile.hpp.

◆ Remaining()

template<typename T>
integer alib::system::MappedFile::Data< T >::Remaining ( ) const
inlinenoexcept

Remaining value.

Returns
The number of bytes from current position to end.

Definition at line 48 of file mappedfile.hpp.

◆ Skip()

template<typename T>
template<typename TIntegral>
void alib::system::MappedFile::Data< T >::Skip ( TIntegral n)
inline

Advance by n values (must stay within range).

Parameters
nNumber of values to advance.
Template Parameters
TIntegralThe type of the parameter n.

Definition at line 91 of file mappedfile.hpp.


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