Rosetta  2020.37
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
ObjexxFCL::CArrayP< typename > Class Template Reference

CArrayP: Memory-Managed C Array Wrapper Supporting Proxies. More...

#include <CArrayP.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

 CArrayP ()
 Default constructor. More...
 
 CArrayP (CArrayP const &a)
 Copy constructor. More...
 
 CArrayP (CArrayP &a)
 Non-Const Copy constructor. More...
 
template<typename U >
 CArrayP (CArrayP< U > const &a)
 Copy constructor template. More...
 
 CArrayP (T const *const p, size_type const size_a)
 Pointer + size constructor. More...
 
template<typename U >
 CArrayP (U const *const p, size_type const size_a)
 Pointer + size constructor template. More...
 
template<typename InputIterator >
 CArrayP (InputIterator const beg, InputIterator const end)
 Iterator range constructor template. More...
 
 CArrayP (size_type const size_a)
 Size constructor. More...
 
 CArrayP (size_type const size_a, T const &t)
 Size + uniform value constructor. More...
 
 ~CArrayP ()
 Destructor. More...
 
 operator bool () const
 Active? More...
 
CArrayPoperator= (CArrayP const &a)
 Copy assignment. More...
 
template<typename U >
CArrayPoperator= (CArrayP< U > const &a)
 Copy assignment template. More...
 
CArrayPoperator= (T const &t)
 Uniform value assignment. More...
 
CArrayPassign (T const *const p, size_type const size_a)
 Pointer + size assignment. More...
 
template<typename U >
CArrayPassign (U const *const p, size_type const size_a)
 Pointer + size assignment template. More...
 
template<typename InputIterator >
CArrayPassign (InputIterator const beg, InputIterator const end)
 Iterator range assignment template. More...
 
CArrayPassign (size_type const size_a, T const &value)
 Size + value assignment. More...
 
template<typename U >
CArrayPoperator+= (CArrayP< U > const &a)
 += CArrayP More...
 
template<typename U >
CArrayPoperator-= (CArrayP< U > const &a)
 -= CArrayP More...
 
CArrayPoperator+= (T const &t)
 += value More...
 
CArrayPoperator-= (T const &t)
 -= value More...
 
CArrayPoperator*= (T const &t)
 *= value More...
 
CArrayPoperator/= (T const &t)
 /= value More...
 
bool active () const
 Active? More...
 
bool empty () const
 Empty? More...
 
bool owner () const
 Owner? More...
 
bool proxy () const
 Proxy? More...
 
size_type size () const
 Size. More...
 
size_type l () const
 Lower index. More...
 
size_type u () const
 Upper index. 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...
 
CArrayPsize (size_type const size_a)
 Resize: Values not preserved. More...
 
CArrayPresize (size_type const size_a, T const &fill=T())
 Resize to size with fill value: Values preserved. More...
 
void swap (CArrayP &a)
 Swap. More...
 
CArrayPclear ()
 Clear. More...
 
CArrayPnormalize ()
 Normalize to unit length. More...
 
CArrayPattach (CArrayP const &a)
 Attach as proxy to a const CArrayP. More...
 
CArrayPattach (CArrayP &a)
 Attach as proxy to a CArrayP. More...
 
CArrayPdetach ()
 Detach as proxy to a CArrayP. More...
 
T const & operator[] (size_type const i) const
 CArrayP[ i ] const: 0-based indexing. More...
 
Toperator[] (size_type const i)
 CArrayP[ 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 Public Member Functions

static CArrayP Proxy (CArrayP const &a)
 Proxy const copy named constructor. More...
 
static CArrayP Proxy (CArrayP &a)
 Proxy copy named constructor. More...
 
static CArrayP Proxy (CArrayP const &a, size_type const size_a)
 Proxy const copy + size named constructor. More...
 
static CArrayP Proxy (CArrayP &a, size_type const size_a)
 Proxy copy + size named constructor. 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...
 
bool owner_
 Owner of the data array or proxy? More...
 

Friends

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

Detailed Description

template<typename>
class ObjexxFCL::CArrayP< typename >

CArrayP: Memory-Managed C Array Wrapper Supporting Proxies.

Note
Proxy CArrayPs are invalidated if the underlying (owning) array data is deleted
Proxy CPArras can be created at construction with the Proxy named constructors
CArrayPs can become proxies with the attach() member function
CArrayPs can stop being proxies with the detach() member function

Member Typedef Documentation

template<typename >
typedef T const* ObjexxFCL::CArrayP< typename >::const_iterator
template<typename >
typedef T const* ObjexxFCL::CArrayP< typename >::const_pointer
template<typename >
typedef T const& ObjexxFCL::CArrayP< typename >::const_reference
template<typename >
typedef T const* ObjexxFCL::CArrayP< typename >::ConstIterator
template<typename >
typedef T const* ObjexxFCL::CArrayP< typename >::ConstPointer
template<typename >
typedef T const& ObjexxFCL::CArrayP< typename >::ConstReference
template<typename >
typedef std::ptrdiff_t ObjexxFCL::CArrayP< typename >::Difference
template<typename >
typedef std::ptrdiff_t ObjexxFCL::CArrayP< typename >::difference_type
template<typename >
typedef T* ObjexxFCL::CArrayP< typename >::iterator
template<typename >
typedef T* ObjexxFCL::CArrayP< typename >::Iterator
template<typename >
typedef void ObjexxFCL::CArrayP< typename >::iterator_category
template<typename >
typedef T* ObjexxFCL::CArrayP< typename >::pointer
template<typename >
typedef T* ObjexxFCL::CArrayP< typename >::Pointer
template<typename >
typedef T& ObjexxFCL::CArrayP< typename >::reference
template<typename >
typedef T& ObjexxFCL::CArrayP< typename >::Reference
template<typename >
typedef std::size_t ObjexxFCL::CArrayP< typename >::Size
template<typename >
typedef std::size_t ObjexxFCL::CArrayP< typename >::size_type
template<typename >
typedef T ObjexxFCL::CArrayP< typename >::Value
template<typename >
typedef T ObjexxFCL::CArrayP< typename >::value_type

Constructor & Destructor Documentation

template<typename >
ObjexxFCL::CArrayP< typename >::CArrayP ( )
inline
template<typename >
ObjexxFCL::CArrayP< typename >::CArrayP ( CArrayP< typename > const &  a)
inline
template<typename >
ObjexxFCL::CArrayP< typename >::CArrayP ( CArrayP< typename > &  a)
inline
template<typename >
template<typename U >
ObjexxFCL::CArrayP< typename >::CArrayP ( CArrayP< U > const &  a)
inline
template<typename >
ObjexxFCL::CArrayP< typename >::CArrayP ( T const *const  p,
size_type const  size_a 
)
inline
template<typename >
template<typename U >
ObjexxFCL::CArrayP< typename >::CArrayP ( U const *const  p,
size_type const  size_a 
)
inline
template<typename >
template<typename InputIterator >
ObjexxFCL::CArrayP< typename >::CArrayP ( InputIterator const  beg,
InputIterator const  end 
)
inline
template<typename >
ObjexxFCL::CArrayP< typename >::CArrayP ( size_type const  size_a)
inlineexplicit

Size constructor.

Note
Built-in value types are not initialized
template<typename >
ObjexxFCL::CArrayP< typename >::CArrayP ( size_type const  size_a,
T const &  t 
)
inline
template<typename >
ObjexxFCL::CArrayP< typename >::~CArrayP ( )
inline

Member Function Documentation

template<typename >
bool ObjexxFCL::CArrayP< typename >::active ( ) const
inline
template<typename >
CArrayP& ObjexxFCL::CArrayP< typename >::assign ( T const *const  p,
size_type const  size_a 
)
inline
template<typename >
template<typename U >
CArrayP& ObjexxFCL::CArrayP< typename >::assign ( U const *const  p,
size_type const  size_a 
)
inline
template<typename >
template<typename InputIterator >
CArrayP& ObjexxFCL::CArrayP< typename >::assign ( InputIterator const  beg,
InputIterator const  end 
)
inline
template<typename >
CArrayP& ObjexxFCL::CArrayP< typename >::assign ( size_type const  size_a,
T const &  value 
)
inline
template<typename >
CArrayP& ObjexxFCL::CArrayP< typename >::attach ( CArrayP< typename > const &  a)
inline
template<typename >
CArrayP& ObjexxFCL::CArrayP< typename >::attach ( CArrayP< typename > &  a)
inline
template<typename >
T const& ObjexxFCL::CArrayP< typename >::back ( ) const
inline
template<typename >
T& ObjexxFCL::CArrayP< typename >::back ( )
inline
template<typename >
const_iterator ObjexxFCL::CArrayP< typename >::begin ( ) const
inline

const_iterator to beginning of array

References ObjexxFCL::CArrayP< typename >::array_.

template<typename >
iterator ObjexxFCL::CArrayP< typename >::begin ( )
inline

iterator to beginning of array

References ObjexxFCL::CArrayP< typename >::array_, and proxy_const_assert.

template<typename >
CArrayP& ObjexxFCL::CArrayP< typename >::clear ( )
inline
template<typename >
CArrayP& ObjexxFCL::CArrayP< typename >::detach ( )
inline
template<typename >
bool ObjexxFCL::CArrayP< typename >::empty ( ) const
inline
template<typename >
const_iterator ObjexxFCL::CArrayP< typename >::end ( ) const
inline

const_iterator to element past end of array

References ObjexxFCL::CArrayP< typename >::array_, and ObjexxFCL::CArrayP< typename >::size_.

template<typename >
iterator ObjexxFCL::CArrayP< typename >::end ( )
inline
template<typename >
T const& ObjexxFCL::CArrayP< typename >::front ( ) const
inline
template<typename >
T& ObjexxFCL::CArrayP< typename >::front ( )
inline
template<typename >
size_type ObjexxFCL::CArrayP< typename >::l ( ) const
inline

Lower index.

References ObjexxFCL::CArrayP< typename >::u().

template<typename >
T ObjexxFCL::CArrayP< typename >::length ( ) const
inline
template<typename >
T ObjexxFCL::CArrayP< typename >::length_squared ( ) const
inline
template<typename >
CArrayP& ObjexxFCL::CArrayP< typename >::normalize ( )
inline
template<typename >
ObjexxFCL::CArrayP< typename >::operator bool ( ) const
inline
template<typename >
T const& ObjexxFCL::CArrayP< typename >::operator() ( ) const
inline

C array const accessor.

References ObjexxFCL::CArrayP< typename >::array_.

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

C array non-const accessor.

References ObjexxFCL::CArrayP< typename >::array_, and proxy_const_assert.

template<typename >
CArrayP& ObjexxFCL::CArrayP< typename >::operator*= ( T const &  t)
inline
template<typename >
template<typename U >
CArrayP& ObjexxFCL::CArrayP< typename >::operator+= ( CArrayP< U > const &  a)
inline
template<typename >
CArrayP& ObjexxFCL::CArrayP< typename >::operator+= ( T const &  t)
inline
template<typename >
template<typename U >
CArrayP& ObjexxFCL::CArrayP< typename >::operator-= ( CArrayP< U > const &  a)
inline
template<typename >
CArrayP& ObjexxFCL::CArrayP< typename >::operator-= ( T const &  t)
inline
template<typename >
CArrayP& ObjexxFCL::CArrayP< typename >::operator/= ( T const &  t)
inline
template<typename >
CArrayP& ObjexxFCL::CArrayP< typename >::operator= ( CArrayP< typename > const &  a)
inline
template<typename >
template<typename U >
CArrayP& ObjexxFCL::CArrayP< typename >::operator= ( CArrayP< U > const &  a)
inline
template<typename >
CArrayP& ObjexxFCL::CArrayP< typename >::operator= ( T const &  t)
inline
template<typename >
T const& ObjexxFCL::CArrayP< typename >::operator[] ( size_type const  i) const
inline
template<typename >
T& ObjexxFCL::CArrayP< typename >::operator[] ( size_type const  i)
inline
template<typename >
bool ObjexxFCL::CArrayP< typename >::owner ( ) const
inline
template<typename >
static CArrayP ObjexxFCL::CArrayP< typename >::Proxy ( CArrayP< typename > const &  a)
inlinestatic

Proxy const copy named constructor.

References basic::options::OptionKeys::score::fiber_diffraction::p.

template<typename >
static CArrayP ObjexxFCL::CArrayP< typename >::Proxy ( CArrayP< typename > &  a)
inlinestatic

Proxy copy named constructor.

References basic::options::OptionKeys::score::fiber_diffraction::p.

template<typename >
static CArrayP ObjexxFCL::CArrayP< typename >::Proxy ( CArrayP< typename > const &  a,
size_type const  size_a 
)
inlinestatic

Proxy const copy + size named constructor.

References basic::options::OptionKeys::score::fiber_diffraction::p.

template<typename >
static CArrayP ObjexxFCL::CArrayP< typename >::Proxy ( CArrayP< typename > &  a,
size_type const  size_a 
)
inlinestatic

Proxy copy + size named constructor.

References basic::options::OptionKeys::score::fiber_diffraction::p.

template<typename >
bool ObjexxFCL::CArrayP< typename >::proxy ( ) const
inline
template<typename >
CArrayP& ObjexxFCL::CArrayP< typename >::resize ( size_type const  size_a,
T const &  fill = T() 
)
inline
template<typename >
size_type ObjexxFCL::CArrayP< typename >::size ( ) const
inline
template<typename >
CArrayP& ObjexxFCL::CArrayP< typename >::size ( size_type const  size_a)
inline

Resize: Values not preserved.

Note
Built-in values are uninitialized if size changes

References ObjexxFCL::CArrayP< typename >::CArrayP(), ObjexxFCL::CArrayP< typename >::owner_, and ObjexxFCL::CArrayP< typename >::size_.

template<typename >
static T ObjexxFCL::CArrayP< typename >::square ( T const &  x)
inlinestaticprivate
template<typename >
void ObjexxFCL::CArrayP< typename >::swap ( CArrayP< typename > &  a)
inline
template<typename >
size_type ObjexxFCL::CArrayP< typename >::u ( ) const
inline

Friends And Related Function Documentation

template<typename >
template<typename >
friend class CArrayP
friend
template<typename >
bool comparable ( CArrayP< typename > const &  a,
CArrayP< typename > const &  b 
)
friend

Are two CArrayPs comparable?

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

Distance.

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

Distance squared.

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

Dot product.

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

Dot product.

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

CArrayP != T.

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

T != CArrayP.

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

CArrayP * Value.

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

Value * CArrayP.

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

CArrayP + Value.

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

Value + CArrayP.

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

-CArrayP

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

CArrayP - Value.

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

Value - CArrayP.

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

CArrayP / Value.

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

CArrayP < T.

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

T < CArrayP.

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

CArrayP <= T.

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

T <= CArrayP.

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

CArrayP == T.

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

T == CArrayP.

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

CArrayP > T.

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

T > CArrayP.

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

CArrayP >= T.

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

T >= CArrayP.

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

Swap.

Member Data Documentation

template<typename >
T* ObjexxFCL::CArrayP< typename >::array_
private
template<typename >
bool ObjexxFCL::CArrayP< typename >::owner_
private
template<typename >
size_type ObjexxFCL::CArrayP< typename >::size_
private

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