Poco

template < class T, std::size_t N >

class Array

File Information

Library: Foundation
Package: Core
Header: Poco/Array.h

Description

STL container like C-style array replacement class.

This implementation is based on the idea of Nicolai Josuttis. His original implementation can be found at http://www.josuttis.com/cppcode/array.html .

Member Summary

Member Functions: assign, at, back, begin, c_array, data, empty, end, front, max_size, operator =, operator [], rbegin, rend, size, swap

Types

const_iterator

typedef const T * const_iterator;

const_reference

typedef const T & const_reference;

const_reverse_iterator

typedef std::reverse_iterator < const_iterator > const_reverse_iterator;

difference_type

typedef std::ptrdiff_t difference_type;

iterator

typedef T * iterator;

reference

typedef T & reference;

reverse_iterator

typedef std::reverse_iterator < iterator > reverse_iterator;

size_type

typedef std::size_t size_type;

value_type

typedef T value_type;

Enumerations

Anonymous

static_size = N

Member Functions

assign inline

void assign(
    const T & value
);

Assign one value to all elements

at inline

reference at(
    size_type i
);

Element access with range check. Throws Poco::InvalidArgumentException if the index is over range.

at inline

const_reference at(
    size_type i
) const;

Element access with range check. Throws Poco::InvalidArgumentException if the index is over range.

back inline

reference back();

back inline

const_reference back() const;

begin inline

iterator begin();

begin inline

const_iterator begin() const;

c_array inline

T * c_array();

Use array as C array (direct read/write access to data)

data inline

const T * data() const;

Direct access to data (read-only)

data inline

T * data();

empty static inline

static bool empty();

end inline

iterator end();

end inline

const_iterator end() const;

front inline

reference front();

front inline

const_reference front() const;

max_size static inline

static size_type max_size();

operator = inline

template < typename Other > Array < T, N > & operator = (
    const Array < Other, N > & rhs
);

Assignment with type conversion

operator [] inline

reference operator[] (
    size_type i
);

Element access without range check. If the index is not small than the given size, the behavior is undefined.

operator [] inline

const_reference operator[] (
    size_type i
) const;

Element access without range check. If the index is not small than the given size, the behavior is undefined.

rbegin inline

reverse_iterator rbegin();

rbegin inline

const_reverse_iterator rbegin() const;

rend inline

reverse_iterator rend();

rend inline

const_reverse_iterator rend() const;

size static inline

static size_type size();

swap inline

void swap(
    Array < T, N > & y
);

Variables

elems

T elems[N];

Fixed-size array of elements of type T, public specifier used to make this class a aggregate.

Securely control IoT edge devices from anywhere   Connect a Device