Rosetta
Public Types | Public Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
ObjexxFCL::CArray< T > Class Template Reference

CArray: Memory-Managed C Array Wrapper. More...

#include <CArray.hh>

Public Types

typedef T value_type
 
typedef Treference
 
typedef T const & const_reference
 
typedef Tpointer
 
typedef T const * const_pointer
 
typedef Titerator
 
typedef T const * const_iterator
 
typedef std::size_t size_type
 
typedef std::ptrdiff_t difference_type
 
typedef T Value
 
typedef TReference
 
typedef T const & ConstReference
 
typedef TPointer
 
typedef T const * ConstPointer
 
typedef TIterator
 
typedef T const * ConstIterator
 
typedef std::size_t Size
 
typedef std::ptrdiff_t Difference
 
typedef void iterator_category
 

Public Member Functions

 CArray ()
 Default constructor. More...
 
 CArray (CArray const &a)
 Copy constructor. More...
 
template<typename U >
 CArray (CArray< U > const &a)
 Copy constructor template. More...
 
 CArray (T const *const p, size_type const size_a)
 Pointer + size constructor. More...
 
template<typename U >
 CArray (U const *const p, size_type const size_a)
 Pointer + size constructor template. More...
 
template<typename InputIterator >
 CArray (InputIterator const beg, InputIterator const end)
 Iterator range constructor template. More...
 
 CArray (size_type const size_a)
 Size constructor. More...
 
 CArray (size_type const size_a, T const &t)
 Size + uniform value constructor. More...
 
 ~CArray ()
 Destructor. More...
 
 operator bool () const
 Active? More...
 
CArrayoperator= (CArray const &a)
 Copy assignment. More...
 
template<typename U >
CArrayoperator= (CArray< U > const &a)
 Copy assignment template. More...
 
CArrayoperator= (T const &t)
 Uniform value assignment. More...
 
CArrayassign (T const *const p, size_type const size_a)
 Pointer + size assignment. More...
 
template<typename U >
CArrayassign (U const *const p, size_type const size_a)
 Pointer + size assignment template. More...
 
template<typename InputIterator >
CArrayassign (InputIterator const beg, InputIterator const end)
 Iterator range assignment template. More...
 
CArrayassign (size_type const size_a, T const &value)
 Size + value assignment. More...
 
template<typename U >
CArrayoperator+= (CArray< U > const &a)
 += CArray More...
 
template<typename U >
CArrayoperator-= (CArray< U > const &a)
 -= CArray More...
 
CArrayoperator+= (T const &t)
 += value More...
 
CArrayoperator-= (T const &t)
 -= value More...
 
CArrayoperator*= (T const &t)
 *= value More...
 
CArrayoperator/= (T const &t)
 /= value More...
 
bool active () const
 Active? More...
 
bool empty () const
 Empty? More...
 
size_type size () const
 Size. More...
 
T const & front () const
 First element. More...
 
T const & back () const
 Last element. More...
 
T length () const
 Length. More...
 
T length_squared () const
 Length squared. More...
 
Tfront ()
 First element. More...
 
Tback ()
 Last element. More...
 
CArraysize (size_type const size_a)
 Resize: Values not preserved. More...
 
CArrayresize (size_type const size_a, T const &fill=T())
 Resize to size with fill value: Values preserved. More...
 
void swap (CArray &a)
 Swap. More...
 
CArrayclear ()
 Clear. More...
 
CArraynormalize ()
 Normalize to unit length. More...
 
T const & operator[] (size_type const i) const
 CArray[ i ] const: 0-based indexing. More...
 
Toperator[] (size_type const i)
 CArray[ i ]: 0-based indexing. More...
 
const_iterator begin () const
 const_iterator to beginning of array More...
 
iterator begin ()
 iterator to beginning of array More...
 
const_iterator end () const
 const_iterator to element past end of array More...
 
iterator end ()
 iterator to element past end of array More...
 
T const & operator() () const
 C array const accessor. More...
 
Toperator() ()
 C array non-const accessor. More...
 

Static Private Member Functions

static T square (T const &x)
 square( x ) == x^2 More...
 

Private Attributes

size_type size_
 Number of array elements. More...
 
Tarray_
 C array. More...
 

Friends

template<typename >
class CArray
 
bool comparable (CArray const &a, CArray const &b)
 Are two CArrays comparable? More...
 
bool operator== (CArray const &a, CArray const &b)
 CArray == CArray. More...
 
bool operator!= (CArray const &a, CArray const &b)
 CArray != CArray. More...
 
bool operator< (CArray const &a, CArray const &b)
 CArray < CArray. More...
 
bool operator<= (CArray const &a, CArray const &b)
 CArray <= CArray. More...
 
bool operator>= (CArray const &a, CArray const &b)
 CArray >= CArray. More...
 
bool operator> (CArray const &a, CArray const &b)
 CArray > CArray. More...
 
bool operator== (CArray const &a, T const &t)
 CArray == T. More...
 
bool operator!= (CArray const &a, T const &t)
 CArray != T. More...
 
bool operator< (CArray const &a, T const &t)
 CArray < T. More...
 
bool operator<= (CArray const &a, T const &t)
 CArray <= T. More...
 
bool operator>= (CArray const &a, T const &t)
 CArray >= T. More...
 
bool operator> (CArray const &a, T const &t)
 CArray > T. More...
 
bool operator== (T const &t, CArray const &a)
 T == CArray. More...
 
bool operator!= (T const &t, CArray const &a)
 T != CArray. More...
 
bool operator< (T const &t, CArray const &a)
 T < CArray. More...
 
bool operator<= (T const &t, CArray const &a)
 T <= CArray. More...
 
bool operator>= (T const &t, CArray const &a)
 T >= CArray. More...
 
bool operator> (T const &t, CArray const &a)
 T > CArray. More...
 
CArray operator- (CArray const &a)
 -CArray More...
 
CArray operator+ (CArray const &a, CArray const &b)
 CArray + CArray. More...
 
CArray operator- (CArray const &a, CArray const &b)
 CArray - CArray. More...
 
CArray operator+ (CArray const &a, T const &t)
 CArray + Value. More...
 
CArray operator+ (T const &t, CArray const &a)
 Value + CArray. More...
 
CArray operator- (CArray const &a, T const &t)
 CArray - Value. More...
 
CArray operator- (T const &t, CArray const &a)
 Value - CArray. More...
 
CArray operator* (CArray const &a, T const &t)
 CArray * Value. More...
 
CArray operator* (T const &t, CArray const &a)
 Value * CArray. More...
 
CArray operator/ (CArray const &a, T const &t)
 CArray / Value. More...
 
T dot_product (CArray const &a, CArray const &b)
 Dot product. More...
 
T dot (CArray const &a, CArray const &b)
 Dot product. More...
 
T distance (CArray const &a, CArray const &b)
 Distance. More...
 
T distance_squared (CArray const &a, CArray const &b)
 Distance squared. More...
 
void swap (CArray &a, CArray &b)
 Swap. More...
 

Detailed Description

template<typename T>
class ObjexxFCL::CArray< T >

CArray: Memory-Managed C Array Wrapper.

Member Typedef Documentation

◆ const_iterator

template<typename T >
typedef T const* ObjexxFCL::CArray< T >::const_iterator

◆ const_pointer

template<typename T >
typedef T const* ObjexxFCL::CArray< T >::const_pointer

◆ const_reference

template<typename T >
typedef T const& ObjexxFCL::CArray< T >::const_reference

◆ ConstIterator

template<typename T >
typedef T const* ObjexxFCL::CArray< T >::ConstIterator

◆ ConstPointer

template<typename T >
typedef T const* ObjexxFCL::CArray< T >::ConstPointer

◆ ConstReference

template<typename T >
typedef T const& ObjexxFCL::CArray< T >::ConstReference

◆ Difference

template<typename T >
typedef std::ptrdiff_t ObjexxFCL::CArray< T >::Difference

◆ difference_type

template<typename T >
typedef std::ptrdiff_t ObjexxFCL::CArray< T >::difference_type

◆ iterator

template<typename T >
typedef T* ObjexxFCL::CArray< T >::iterator

◆ Iterator

template<typename T >
typedef T* ObjexxFCL::CArray< T >::Iterator

◆ iterator_category

template<typename T >
typedef void ObjexxFCL::CArray< T >::iterator_category

◆ pointer

template<typename T >
typedef T* ObjexxFCL::CArray< T >::pointer

◆ Pointer

template<typename T >
typedef T* ObjexxFCL::CArray< T >::Pointer

◆ reference

template<typename T >
typedef T& ObjexxFCL::CArray< T >::reference

◆ Reference

template<typename T >
typedef T& ObjexxFCL::CArray< T >::Reference

◆ Size

template<typename T >
typedef std::size_t ObjexxFCL::CArray< T >::Size

◆ size_type

template<typename T >
typedef std::size_t ObjexxFCL::CArray< T >::size_type

◆ Value

template<typename T >
typedef T ObjexxFCL::CArray< T >::Value

◆ value_type

template<typename T >
typedef T ObjexxFCL::CArray< T >::value_type

Constructor & Destructor Documentation

◆ CArray() [1/8]

template<typename T >
ObjexxFCL::CArray< T >::CArray ( )
inline

Default constructor.

◆ CArray() [2/8]

template<typename T >
ObjexxFCL::CArray< T >::CArray ( CArray< T > const &  a)
inline

◆ CArray() [3/8]

template<typename T >
template<typename U >
ObjexxFCL::CArray< T >::CArray ( CArray< U > const &  a)
inline

◆ CArray() [4/8]

template<typename T >
ObjexxFCL::CArray< T >::CArray ( T const *const  p,
size_type const  size_a 
)
inline

◆ CArray() [5/8]

template<typename T >
template<typename U >
ObjexxFCL::CArray< T >::CArray ( U const *const  p,
size_type const  size_a 
)
inline

◆ CArray() [6/8]

template<typename T >
template<typename InputIterator >
ObjexxFCL::CArray< T >::CArray ( InputIterator const  beg,
InputIterator const  end 
)
inline

◆ CArray() [7/8]

template<typename T >
ObjexxFCL::CArray< T >::CArray ( size_type const  size_a)
inlineexplicit

Size constructor.

Note
Built-in value types are not initialized

◆ CArray() [8/8]

template<typename T >
ObjexxFCL::CArray< T >::CArray ( size_type const  size_a,
T const &  t 
)
inline

Size + uniform value constructor.

References ObjexxFCL::CArray< T >::array_, create_a3b_hbs::i, ObjexxFCL::CArray< T >::size_, and predPRE::t.

◆ ~CArray()

template<typename T >
ObjexxFCL::CArray< T >::~CArray ( )
inline

Destructor.

References ObjexxFCL::CArray< T >::array_.

Member Function Documentation

◆ active()

template<typename T >
bool ObjexxFCL::CArray< T >::active ( ) const
inline

Active?

References ObjexxFCL::CArray< T >::array_.

◆ assign() [1/4]

template<typename T >
template<typename InputIterator >
CArray& ObjexxFCL::CArray< T >::assign ( InputIterator const  beg,
InputIterator const  end 
)
inline

◆ assign() [2/4]

template<typename T >
CArray& ObjexxFCL::CArray< T >::assign ( size_type const  size_a,
T const &  value 
)
inline

Size + value assignment.

References ObjexxFCL::CArray< T >::CArray, ObjexxFCL::CArray< T >::size_, and value.

◆ assign() [3/4]

template<typename T >
CArray& ObjexxFCL::CArray< T >::assign ( T const *const  p,
size_type const  size_a 
)
inline

◆ assign() [4/4]

template<typename T >
template<typename U >
CArray& ObjexxFCL::CArray< T >::assign ( U const *const  p,
size_type const  size_a 
)
inline

◆ back() [1/2]

template<typename T >
T& ObjexxFCL::CArray< T >::back ( )
inline

◆ back() [2/2]

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

◆ begin() [1/2]

template<typename T >
iterator ObjexxFCL::CArray< T >::begin ( )
inline

iterator to beginning of array

References ObjexxFCL::CArray< T >::array_.

◆ begin() [2/2]

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

const_iterator to beginning of array

References ObjexxFCL::CArray< T >::array_.

◆ clear()

template<typename T >
CArray& ObjexxFCL::CArray< T >::clear ( )
inline

◆ empty()

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

Empty?

References ObjexxFCL::CArray< T >::size_.

◆ end() [1/2]

template<typename T >
iterator ObjexxFCL::CArray< T >::end ( )
inline

iterator to element past end of array

References ObjexxFCL::CArray< T >::array_, and ObjexxFCL::CArray< T >::size_.

◆ end() [2/2]

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

const_iterator to element past end of array

References ObjexxFCL::CArray< T >::array_, and ObjexxFCL::CArray< T >::size_.

Referenced by ObjexxFCL::CArray< T >::assign().

◆ front() [1/2]

template<typename T >
T& ObjexxFCL::CArray< T >::front ( )
inline

◆ front() [2/2]

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

◆ length()

template<typename T >
T ObjexxFCL::CArray< T >::length ( ) const
inline

◆ length_squared()

template<typename T >
T ObjexxFCL::CArray< T >::length_squared ( ) const
inline

◆ normalize()

template<typename T >
CArray& ObjexxFCL::CArray< T >::normalize ( )
inline

◆ operator bool()

template<typename T >
ObjexxFCL::CArray< T >::operator bool ( ) const
inline

Active?

References ObjexxFCL::CArray< T >::array_.

◆ operator()() [1/2]

template<typename T >
T& ObjexxFCL::CArray< T >::operator() ( )
inline

C array non-const accessor.

References ObjexxFCL::CArray< T >::array_.

◆ operator()() [2/2]

template<typename T >
T const& ObjexxFCL::CArray< T >::operator() ( ) const
inline

C array const accessor.

References ObjexxFCL::CArray< T >::array_.

◆ operator*=()

template<typename T >
CArray& ObjexxFCL::CArray< T >::operator*= ( T const &  t)
inline

◆ operator+=() [1/2]

template<typename T >
template<typename U >
CArray& ObjexxFCL::CArray< T >::operator+= ( CArray< U > const &  a)
inline

◆ operator+=() [2/2]

template<typename T >
CArray& ObjexxFCL::CArray< T >::operator+= ( T const &  t)
inline

◆ operator-=() [1/2]

template<typename T >
template<typename U >
CArray& ObjexxFCL::CArray< T >::operator-= ( CArray< U > const &  a)
inline

◆ operator-=() [2/2]

template<typename T >
CArray& ObjexxFCL::CArray< T >::operator-= ( T const &  t)
inline

◆ operator/=()

template<typename T >
CArray& ObjexxFCL::CArray< T >::operator/= ( T const &  t)
inline

◆ operator=() [1/3]

template<typename T >
CArray& ObjexxFCL::CArray< T >::operator= ( CArray< T > const &  a)
inline

◆ operator=() [2/3]

template<typename T >
template<typename U >
CArray& ObjexxFCL::CArray< T >::operator= ( CArray< U > const &  a)
inline

◆ operator=() [3/3]

template<typename T >
CArray& ObjexxFCL::CArray< T >::operator= ( T const &  t)
inline

◆ operator[]() [1/2]

template<typename T >
T& ObjexxFCL::CArray< T >::operator[] ( size_type const  i)
inline

◆ operator[]() [2/2]

template<typename T >
T const& ObjexxFCL::CArray< T >::operator[] ( size_type const  i) const
inline

◆ resize()

template<typename T >
CArray& ObjexxFCL::CArray< T >::resize ( size_type const  size_a,
T const &  fill = T() 
)
inline

◆ size() [1/2]

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

Size.

References ObjexxFCL::CArray< T >::size_.

◆ size() [2/2]

template<typename T >
CArray& ObjexxFCL::CArray< T >::size ( size_type const  size_a)
inline

Resize: Values not preserved.

Note
Built-in values are uninitialized if size changes

References ObjexxFCL::CArray< T >::CArray, and ObjexxFCL::CArray< T >::size_.

◆ square()

template<typename T >
static T ObjexxFCL::CArray< T >::square ( T const &  x)
inlinestaticprivate

square( x ) == x^2

References x.

Referenced by ObjexxFCL::CArray< T >::length(), and ObjexxFCL::CArray< T >::length_squared().

◆ swap()

template<typename T >
void ObjexxFCL::CArray< T >::swap ( CArray< T > &  a)
inline

Friends And Related Function Documentation

◆ CArray

template<typename T >
template<typename >
friend class CArray
friend

◆ comparable

template<typename T >
bool comparable ( CArray< T > const &  a,
CArray< T > const &  b 
)
friend

Are two CArrays comparable?

◆ distance

template<typename T >
T distance ( CArray< T > const &  a,
CArray< T > const &  b 
)
friend

Distance.

◆ distance_squared

template<typename T >
T distance_squared ( CArray< T > const &  a,
CArray< T > const &  b 
)
friend

Distance squared.

◆ dot

template<typename T >
T dot ( CArray< T > const &  a,
CArray< T > const &  b 
)
friend

Dot product.

◆ dot_product

template<typename T >
T dot_product ( CArray< T > const &  a,
CArray< T > const &  b 
)
friend

Dot product.

◆ operator!= [1/3]

template<typename T >
bool operator!= ( CArray< T > const &  a,
CArray< T > const &  b 
)
friend

◆ operator!= [2/3]

template<typename T >
bool operator!= ( CArray< T > const &  a,
T const &  t 
)
friend

CArray != T.

◆ operator!= [3/3]

template<typename T >
bool operator!= ( T const &  t,
CArray< T > const &  a 
)
friend

T != CArray.

◆ operator* [1/2]

template<typename T >
CArray operator* ( CArray< T > const &  a,
T const &  t 
)
friend

CArray * Value.

◆ operator* [2/2]

template<typename T >
CArray operator* ( T const &  t,
CArray< T > const &  a 
)
friend

Value * CArray.

◆ operator+ [1/3]

template<typename T >
CArray operator+ ( CArray< T > const &  a,
CArray< T > const &  b 
)
friend

◆ operator+ [2/3]

template<typename T >
CArray operator+ ( CArray< T > const &  a,
T const &  t 
)
friend

CArray + Value.

◆ operator+ [3/3]

template<typename T >
CArray operator+ ( T const &  t,
CArray< T > const &  a 
)
friend

Value + CArray.

◆ operator- [1/4]

template<typename T >
CArray operator- ( CArray< T > const &  a)
friend

◆ operator- [2/4]

template<typename T >
CArray operator- ( CArray< T > const &  a,
CArray< T > const &  b 
)
friend

◆ operator- [3/4]

template<typename T >
CArray operator- ( CArray< T > const &  a,
T const &  t 
)
friend

CArray - Value.

◆ operator- [4/4]

template<typename T >
CArray operator- ( T const &  t,
CArray< T > const &  a 
)
friend

Value - CArray.

◆ operator/

template<typename T >
CArray operator/ ( CArray< T > const &  a,
T const &  t 
)
friend

CArray / Value.

◆ operator< [1/3]

template<typename T >
bool operator< ( CArray< T > const &  a,
CArray< T > const &  b 
)
friend

◆ operator< [2/3]

template<typename T >
bool operator< ( CArray< T > const &  a,
T const &  t 
)
friend

CArray < T.

◆ operator< [3/3]

template<typename T >
bool operator< ( T const &  t,
CArray< T > const &  a 
)
friend

T < CArray.

◆ operator<= [1/3]

template<typename T >
bool operator<= ( CArray< T > const &  a,
CArray< T > const &  b 
)
friend

◆ operator<= [2/3]

template<typename T >
bool operator<= ( CArray< T > const &  a,
T const &  t 
)
friend

CArray <= T.

◆ operator<= [3/3]

template<typename T >
bool operator<= ( T const &  t,
CArray< T > const &  a 
)
friend

T <= CArray.

◆ operator== [1/3]

template<typename T >
bool operator== ( CArray< T > const &  a,
CArray< T > const &  b 
)
friend

◆ operator== [2/3]

template<typename T >
bool operator== ( CArray< T > const &  a,
T const &  t 
)
friend

CArray == T.

◆ operator== [3/3]

template<typename T >
bool operator== ( T const &  t,
CArray< T > const &  a 
)
friend

T == CArray.

◆ operator> [1/3]

template<typename T >
bool operator> ( CArray< T > const &  a,
CArray< T > const &  b 
)
friend

◆ operator> [2/3]

template<typename T >
bool operator> ( CArray< T > const &  a,
T const &  t 
)
friend

CArray > T.

◆ operator> [3/3]

template<typename T >
bool operator> ( T const &  t,
CArray< T > const &  a 
)
friend

T > CArray.

◆ operator>= [1/3]

template<typename T >
bool operator>= ( CArray< T > const &  a,
CArray< T > const &  b 
)
friend

◆ operator>= [2/3]

template<typename T >
bool operator>= ( CArray< T > const &  a,
T const &  t 
)
friend

CArray >= T.

◆ operator>= [3/3]

template<typename T >
bool operator>= ( T const &  t,
CArray< T > const &  a 
)
friend

T >= CArray.

◆ swap

template<typename T >
void swap ( CArray< T > &  a,
CArray< T > &  b 
)
friend

Swap.

Member Data Documentation

◆ array_

template<typename T >
T* ObjexxFCL::CArray< T >::array_
private

◆ size_

template<typename T >
size_type ObjexxFCL::CArray< T >::size_
private

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