Loading...
Searching...
No Matches
PstArray< T, Size > Class Template Reference

`#include <PstArray.h>`

Collaboration diagram for PstArray< T, Size >:
[legend]

## Public Types
typedef T | value_type
typedef size_t | size_type
typedef T * | pointer
typedef const T * | const_pointer
typedef T & | reference
typedef const T & | const_reference
typedef T * | iterator
typedef const T * | const_iterator

## Public Member Functions
constexpr size_type | size () const
constexpr bool | empty () const
const_pointer | data () const
pointer | data ()
const_reference | at (size_type index) const
reference | at (size_type index)
const_reference | front () const
reference | front ()
const_reference | back () const
reference | back ()
const_iterator | cbegin () const
const_iterator | begin () const
iterator | begin ()
const_iterator | cend () const
const_iterator | end () const
iterator | end ()

## Public Attributes
value_type | _array [Size]

## Private Member Functions
void | check_bounds (size_type index)

## Detailed Description

template<typename T, size_t Size>
class PSTech::Utils::PstArray< T, Size >

Basic array class, cloning std::array<T, Size>. This class can safely be passed across the DLL boundary.

Examples
  listener.cpp, and reference.cpp.

## Member Typedef Documentation

## ◆ const_iterator

template<typename T, size_t Size>

typedef const T* const_iterator

## ◆ const_pointer

template<typename T, size_t Size>

typedef const T* const_pointer

## ◆ const_reference

template<typename T, size_t Size>

typedef const T& const_reference

## ◆ iterator

template<typename T, size_t Size>

typedef T* iterator

## ◆ pointer

template<typename T, size_t Size>

typedef T* pointer

## ◆ reference

template<typename T, size_t Size>

typedef T& reference

## ◆ size_type

template<typename T, size_t Size>

typedef size_t size_type

## ◆ value_type

template<typename T, size_t Size>

typedef T value_type

## Member Function Documentation

## ◆ at() [1/2]

template<typename T, size_t Size>

reference at | ( | size_type | index | ) |
| inline

Get a reference to the item stored at position index' in the PstArray with bounds check. If index' is larger than the size of the PstArray, a PSTech::OutOfRangeException is thrown.

Exceptions

  PSTech::OutOfRangeException |

Here is the call graph for this function:

## ◆ at() [2/2]

template<typename T, size_t Size>

const_reference at | ( | size_type | index | ) | const
| inline

Get a const reference to the item stored at position index' in the PstArray with bounds check. If index' is larger than the size of the PstArray, a PSTech::OutOfRangeException is thrown.

Exceptions

  PSTech::OutOfRangeException |

Here is the call graph for this function:

## ◆ back() [1/2]

template<typename T, size_t Size>

reference back | ( |  | ) |
| inline

Get a reference to the last element in the PstArray.

## ◆ back() [2/2]

template<typename T, size_t Size>

const_reference back | ( |  | ) | const
| inline

Get a const reference to the last element in the PstArray.

## ◆ begin() [1/2]

template<typename T, size_t Size>

iterator begin | ( |  | ) |
| inline

Get an iterator to the beginning of the PstArray.

## ◆ begin() [2/2]

template<typename T, size_t Size>

const_iterator begin | ( |  | ) | const
| inline

Get a const iterator to the beginning of the PstArray.

## ◆ cbegin()

template<typename T, size_t Size>

const_iterator cbegin | ( |  | ) | const
| inline

Get a const iterator to the beginning of the PstArray.

## ◆ cend()

template<typename T, size_t Size>

const_iterator cend | ( |  | ) | const
| inline

Get a const iterator to the end of the PstArray.

## ◆ check_bounds()

template<typename T, size_t Size>

void check_bounds | ( | size_type | index | ) |
| inline private

Here is the caller graph for this function:

## ◆ data() [1/2]

template<typename T, size_t Size>

pointer data | ( |  | ) |
| inline

Direct access to the underlying array.

## ◆ data() [2/2]

template<typename T, size_t Size>

const_pointer data | ( |  | ) | const
| inline

Direct access to the underlying array.

## ◆ empty()

template<typename T, size_t Size>

bool empty | ( |  | ) | const
| inline constexpr

Returns true if this PstArray is empty.

## ◆ end() [1/2]

template<typename T, size_t Size>

iterator end | ( |  | ) |
| inline

Get an iterator to the end of the PstArray.

## ◆ end() [2/2]

template<typename T, size_t Size>

const_iterator end | ( |  | ) | const
| inline

Get a const iterator to the end of the PstArray.

## ◆ front() [1/2]

template<typename T, size_t Size>

reference front | ( |  | ) |
| inline

Get a reference to the first element in the PstArray.

## ◆ front() [2/2]

template<typename T, size_t Size>

const_reference front | ( |  | ) | const
| inline

Get a const reference to the first element in the PstArray.

## ◆ size()

template<typename T, size_t Size>

size_type size | ( |  | ) | const
| inline constexpr

Get the number of elements in this PstArray.

## Member Data Documentation

## ◆ _array

template<typename T, size_t Size>

value_type _array[Size]

Get a const reference to the item stored at position `index' in the PstArray. */ const_reference operator [] (size_type index) const { assert(index < Size); return _array[index]; }

/** Get a reference to the item stored at position `index' in the PstArray. */ reference operator [] (size_type index) { assert(index < Size); return _array[index]; }

/** Returns true if each element in this PstArray is equal to the element at the same index in `array'. */ bool operator==(const PstArray<T, Size>& array) const { for (size_t index = 0; index < Size; ++index) { if (_array[index] != array[index]) { return false; } } return true; }

/** Returns true if any element in this PstArray is not equal to the element at the same index in `array'. */ bool operator!=(const PstArray<T, Size>& array) const {
return !(*this == array); }

/** Public member to enable aggregate initialization. Should not be accessed directly.

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

- include/PstArray.h