openMSX
Public Types | Public Member Functions | List of all members
array_ref< T > Class Template Reference

This class implements a subset of the proposal for std::array_ref (proposed for the next c++ standard (c++1y)). More...

#include <array_ref.hh>

Public Types

using value_type = T
 
using pointer = const T *
 
using reference = const T &
 
using const_reference = const T &
 
using const_iterator = const T *
 
using iterator = const_iterator
 
using const_reverse_iterator = std::reverse_iterator< const_iterator >
 
using reverse_iterator = const_reverse_iterator
 
using size_type = size_t
 
using difference_type = ptrdiff_t
 

Public Member Functions

 array_ref ()
 
 array_ref (const array_ref &r)
 
 array_ref (const T *array, size_t length)
 
template<typename ITER >
 array_ref (ITER first, ITER last)
 
 array_ref (const std::vector< T > &v)
 
template<size_t N>
 array_ref (const T(&a)[N])
 
array_refoperator= (const array_ref &rhs)
 
const_iterator begin () const
 
const_iterator end () const
 
const_reverse_iterator rbegin () const
 
const_reverse_iterator rend () const
 
size_type size () const
 
bool empty () const
 
const T & operator[] (size_t i) const
 
const T & front () const
 
const T & back () const
 
const T * data () const
 
void clear ()
 
void remove_prefix (size_type n)
 
void remove_suffix (size_type n)
 
void pop_back ()
 
void pop_front ()
 
array_ref substr (size_type pos, size_type n=size_type(-1)) const
 

Detailed Description

template<typename T>
class array_ref< T >

This class implements a subset of the proposal for std::array_ref (proposed for the next c++ standard (c++1y)).

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3334.html#classstd_1_1array__ref

It has an interface that is close to std::vector, but it does not own the memory of the array. Basically it's just a wrapper around a pointer plus length.

Definition at line 19 of file array_ref.hh.

Member Typedef Documentation

◆ const_iterator

template<typename T>
using array_ref< T >::const_iterator = const T*

Definition at line 27 of file array_ref.hh.

◆ const_reference

template<typename T>
using array_ref< T >::const_reference = const T&

Definition at line 26 of file array_ref.hh.

◆ const_reverse_iterator

template<typename T>
using array_ref< T >::const_reverse_iterator = std::reverse_iterator<const_iterator>

Definition at line 29 of file array_ref.hh.

◆ difference_type

template<typename T>
using array_ref< T >::difference_type = ptrdiff_t

Definition at line 32 of file array_ref.hh.

◆ iterator

template<typename T>
using array_ref< T >::iterator = const_iterator

Definition at line 28 of file array_ref.hh.

◆ pointer

template<typename T>
using array_ref< T >::pointer = const T*

Definition at line 24 of file array_ref.hh.

◆ reference

template<typename T>
using array_ref< T >::reference = const T&

Definition at line 25 of file array_ref.hh.

◆ reverse_iterator

template<typename T>
using array_ref< T >::reverse_iterator = const_reverse_iterator

Definition at line 30 of file array_ref.hh.

◆ size_type

template<typename T>
using array_ref< T >::size_type = size_t

Definition at line 31 of file array_ref.hh.

◆ value_type

template<typename T>
using array_ref< T >::value_type = T

Definition at line 23 of file array_ref.hh.

Constructor & Destructor Documentation

◆ array_ref() [1/6]

template<typename T>
array_ref< T >::array_ref ( )
inline

Definition at line 35 of file array_ref.hh.

Referenced by array_ref< T >::substr().

◆ array_ref() [2/6]

template<typename T>
array_ref< T >::array_ref ( const array_ref< T > &  r)
inline

Definition at line 37 of file array_ref.hh.

◆ array_ref() [3/6]

template<typename T>
array_ref< T >::array_ref ( const T *  array,
size_t  length 
)
inline

Definition at line 39 of file array_ref.hh.

◆ array_ref() [4/6]

template<typename T>
template<typename ITER >
array_ref< T >::array_ref ( ITER  first,
ITER  last 
)
inline

Definition at line 41 of file array_ref.hh.

◆ array_ref() [5/6]

template<typename T>
array_ref< T >::array_ref ( const std::vector< T > &  v)
inline

Definition at line 43 of file array_ref.hh.

◆ array_ref() [6/6]

template<typename T>
template<size_t N>
array_ref< T >::array_ref ( const T(&)  a[N])
inline

Definition at line 45 of file array_ref.hh.

Member Function Documentation

◆ back()

template<typename T>
const T& array_ref< T >::back ( ) const
inline

Definition at line 70 of file array_ref.hh.

◆ begin()

template<typename T>
const_iterator array_ref< T >::begin ( ) const
inline

Definition at line 55 of file array_ref.hh.

Referenced by array_ref< T >::rend().

◆ clear()

template<typename T>
void array_ref< T >::clear ( )
inline

Definition at line 74 of file array_ref.hh.

Referenced by array_ref< T >::remove_prefix(), and array_ref< T >::remove_suffix().

◆ data()

template<typename T>
const T* array_ref< T >::data ( ) const
inline

Definition at line 71 of file array_ref.hh.

Referenced by openmsx::AviRecorder::getFrameHeight(), and array_ref< T >::operator=().

◆ empty()

template<typename T>
bool array_ref< T >::empty ( ) const
inline

◆ end()

template<typename T>
const_iterator array_ref< T >::end ( ) const
inline

Definition at line 56 of file array_ref.hh.

Referenced by array_ref< T >::rbegin().

◆ front()

template<typename T>
const T& array_ref< T >::front ( ) const
inline

◆ operator=()

template<typename T>
array_ref& array_ref< T >::operator= ( const array_ref< T > &  rhs)
inline

Definition at line 48 of file array_ref.hh.

References array_ref< T >::data(), and array_ref< T >::size().

◆ operator[]()

template<typename T>
const T& array_ref< T >::operator[] ( size_t  i) const
inline

Definition at line 65 of file array_ref.hh.

◆ pop_back()

template<typename T>
void array_ref< T >::pop_back ( )
inline

Definition at line 90 of file array_ref.hh.

References array_ref< T >::remove_suffix().

◆ pop_front()

template<typename T>
void array_ref< T >::pop_front ( )
inline

◆ rbegin()

template<typename T>
const_reverse_iterator array_ref< T >::rbegin ( ) const
inline

Definition at line 57 of file array_ref.hh.

References array_ref< T >::end().

◆ remove_prefix()

template<typename T>
void array_ref< T >::remove_prefix ( size_type  n)
inline

Definition at line 75 of file array_ref.hh.

References array_ref< T >::clear().

Referenced by array_ref< T >::pop_front().

◆ remove_suffix()

template<typename T>
void array_ref< T >::remove_suffix ( size_type  n)
inline

Definition at line 83 of file array_ref.hh.

References array_ref< T >::clear().

Referenced by array_ref< T >::pop_back().

◆ rend()

template<typename T>
const_reverse_iterator array_ref< T >::rend ( ) const
inline

Definition at line 58 of file array_ref.hh.

References array_ref< T >::begin().

◆ size()

template<typename T>
size_type array_ref< T >::size ( ) const
inline

Definition at line 61 of file array_ref.hh.

Referenced by openmsx::CPUCore< openmsx::Z80TYPE >::disasmCommand(), openmsx::RomInfoTopic::execute(), openmsx::MessageCommand::execute(), openmsx::NowindCommand::execute(), openmsx::HDCommand::execute(), openmsx::AfterCommand::execute(), openmsx::CDXCommand::execute(), openmsx::Sha1SumCommand::execute(), openmsx::DiskCommand::execute(), openmsx::MachineCommand::execute(), openmsx::TestMachineCommand::execute(), openmsx::LoadMachineCmd::execute(), openmsx::LSXCommand::execute(), openmsx::CreateMachineCommand::execute(), openmsx::DeleteMachineCommand::execute(), openmsx::RemoveExtCmd::execute(), openmsx::ActivateMachineCommand::execute(), openmsx::StoreMachineCommand::execute(), openmsx::DeviceInfo::execute(), openmsx::RestoreMachineCommand::execute(), openmsx::ConfigInfo::execute(), openmsx::ExtCmd::execute(), openmsx::RomDatabase::fetchRomInfo(), openmsx::MSXMixer::findDevice(), openmsx::UserSettings::findSetting(), openmsx::CassettePlayer::generateChannels(), openmsx::PluggingController::getCurrentTime(), openmsx::AviRecorder::getFrameHeight(), openmsx::DiskChanger::insertDisk(), openmsx::CartridgeSlotManager::isExternalSlot(), openmsx::SettingsManager::loadSettings(), openmsx::HDCommand::needRecord(), openmsx::DiskCommand::needRecord(), array_ref< T >::operator=(), openmsx::OSDGUI::refresh(), openmsx::PluggingController::registerPluggable(), openmsx::Display::removeLayer(), openmsx::SettingsConfig::saveSetting(), openmsx::GlobalCommandController::tabCompletion(), openmsx::Debugger::transfer(), openmsx::DiskManipulator::unregisterDrive(), and openmsx::InfoCommand::unregisterTopic().

◆ substr()

template<typename T>
array_ref array_ref< T >::substr ( size_type  pos,
size_type  n = size_type(-1) 
) const
inline

Definition at line 93 of file array_ref.hh.

References array_ref< T >::array_ref(), and gl::min().


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