Astra SDK  v2.1.3
Public 成员函数 | 所有成员列表
astra::Array< T > 模板类 参考

Simple wrapper around primitive arrays 更多...

#include <Array.hpp>

Public 成员函数

 Array ()
 Default constructs zero-length array
 
 Array (decltype(nullptr))
 Implicit conversion constructor from nullptr to a zero-length array
 
 Array (T *ptr, size_t size)
 Constructs array from pointer and size
 
 Array (T *begin, T *end)
 Constructs array from begin and end iterators
 
size_t size () const
 Gets size of array
 
bool empty () const
 Returns true if array is zero length
 
T * data ()
 Gets mutable raw pointer to array data
 
const T * data () const
 Gets immutable raw pointer to array data
 
T * begin ()
 Gets mutable iterator pointing to beginning of array
 
const T * begin () const
 Gets immutable iterator pointing to beginning of array
 
T * end ()
 Gets mutable iterator pointing to one past the end of array
 
const T * end () const
 Gets iterator pointing to one past the end of array
 
T & front ()
 Gets mutable reference to first array element
 
const T & front () const
 Gets immutable reference to first array element
 
T & back ()
 Gets mutable reference to last array element
 
const T & back () const
 Gets immutable reference to last array element
 
T & operator[] (size_t index)
 Mutable index operator into array 更多...
 
const T & operator[] (size_t index) const
 Immutable index operator into array 更多...
 
Array< T > slice (size_t start, size_t end)
 Creates a mutable sub-array of the same type based on a start and end index 更多...
 
Array< const T > slice (size_t start, size_t end) const
 Creates an immutable sub-array of the same type based on a start and end index 更多...
 
bool operator== (const Array &other) const
 Identity based equality operator
 
bool operator!= (const Array &other) const
 Identity based inequality operator
 

详细描述

template<typename T>
class astra::Array< T >

Simple wrapper around primitive arrays

Provides a strongly-typed wrapper around primitive C-style arrays. Array does not copy or consider itself the owner of the data provided through the constructor. Users should make sure that the Array instance does not live longer than the data it points to.

示例
SimpleBodyViewer-SFML\main.cpp.

成员函数说明

◆ operator[]() [1/2]

template<typename T >
T& astra::Array< T >::operator[] ( size_t  index)
inline

Mutable index operator into array

参数
[in]indexIndex into array

◆ operator[]() [2/2]

template<typename T >
const T& astra::Array< T >::operator[] ( size_t  index) const
inline

Immutable index operator into array

参数
[in]indexIndex into array

◆ slice() [1/2]

template<typename T >
Array<T> astra::Array< T >::slice ( size_t  start,
size_t  end 
)
inline

Creates a mutable sub-array of the same type based on a start and end index

参数
[in]startStart index
[in]endEnd index (exclusive)

◆ slice() [2/2]

template<typename T >
Array<const T> astra::Array< T >::slice ( size_t  start,
size_t  end 
) const
inline

Creates an immutable sub-array of the same type based on a start and end index

参数
[in]startStart index
[in]endEnd index (exclusive)

该类的文档由以下文件生成: