ATLAS Offline Software
Loading...
Searching...
No Matches
CxxUtils::WritableArray< 0 > Class Reference

#include <Array.h>

Inheritance diagram for CxxUtils::WritableArray< 0 >:
Collaboration diagram for CxxUtils::WritableArray< 0 >:

Public Types

enum  { NDIM = N }
 The number of dimensions of the array. More...
typedef ArrayIteratorChooser< N >::const_iterator const_iterator
 The iterator for this container.
enum  { NDIM = 0 }
 The number of dimensions of the array. More...
enum  
 The number of dimensions of the array. More...
typedef ArrayIteratorChooser< N >::const_iterator const_iterator
 The iterator for this container.
enum  
 The number of dimensions of the array. More...
typedef ArrayIteratorChooser< N >::const_iterator const_iterator
 The iterator for this container.

Public Member Functions

 WritableArray (Arrayrep &rep)
 Constructor.
WritableArray< 0 > & operator= (Arrayelt elt)
 Assignment.
 WritableArray (Arrayrep &rep)
 Constructor.
WritableArray< N-1 > operator[] (unsigned int i)
 Array indexing.
Array< N-1 > operator[] (unsigned int i) const
 Array indexing.
Arrayeltptr ()
 Return a direct pointer to array elements.
bool valid () const
 Test for validity.
std::vector< unsigned int > shape () const
 Return the array shape.
unsigned int size (unsigned int dim=0) const
 Return the size of the array along one dimension.
const Arrayeltptr () const
 Return a direct pointer to array elements.
const_iterator begin () const
 Return an iterator pointing at the beginning of the container.
const_iterator end () const
 Return an iterator pointing past the end of the container.
void write_array (std::ostream &stream) const
 Creates a text representation of the array content.
bool valid () const
 Test for validity.
std::vector< unsigned int > shape () const
 Return the array shape.
unsigned int size (unsigned int dim=0) const
 Return the size of the array along one dimension.
 operator Arrayelt () const
 Convert to a number.
int asint () const
 Convert to an integer.
void write_array (std::ostream &stream) const
 Creates a text representation of the array content.
const Arrayeltptr () const
 Return a direct pointer to array elements.
const_iterator begin () const
 Return an iterator pointing at the beginning of the container.
const_iterator end () const
 Return an iterator pointing past the end of the container.
bool valid () const
 Test for validity.
std::vector< unsigned int > shape () const
 Return the array shape.
unsigned int size (unsigned int dim=0) const
 Return the size of the array along one dimension.
const Arrayeltptr () const
 Return a direct pointer to array elements.
const_iterator begin () const
 Return an iterator pointing at the beginning of the container.
const_iterator end () const
 Return an iterator pointing past the end of the container.
void write_array (std::ostream &stream) const
 Creates a text representation of the array content.

Protected Attributes

const Arrayrepm_rep
 Pointer to the representation.
unsigned int m_offs
 Offset in the Arrayrep's data of the first element of this array.
const Arrayeltm_elt
 Pointer to this array's single element.
const Arrayrepm_rep
 Pointer to the representation.
unsigned int m_offs
 Offset in the Arrayrep's data of the first element of this array.
const Arrayrepm_rep
 Pointer to the representation.
unsigned int m_offs
 Offset in the Arrayrep's data of the first element of this array.

Private Member Functions

 WritableArray (Arrayrep &rep, unsigned int offs)
 Private constructor for array indexing.
 WritableArray (Arrayrep &rep, unsigned int offs)
 Private constructor for array indexing.

Private Attributes

Arrayeltm_elt_nc
 Pointer to this array's single element, non-const copy.
Arrayrepm_rep_nc
 The underlying array representation, non-const copy.

Friends

class WritableArray< 1 >
class WritableArray< N+1 >

Detailed Description

Definition at line 716 of file Control/CxxUtils/CxxUtils/Array.h.

Member Typedef Documentation

◆ const_iterator [1/3]

template<unsigned int N>
typedef ArrayIteratorChooser<N>::const_iterator CxxUtils::Array< N >::const_iterator
inherited

The iterator for this container.

Definition at line 141 of file Control/CxxUtils/CxxUtils/Array.h.

◆ const_iterator [2/3]

The iterator for this container.

Definition at line 141 of file Control/CxxUtils/CxxUtils/Array.h.

◆ const_iterator [3/3]

The iterator for this container.

Definition at line 141 of file Control/CxxUtils/CxxUtils/Array.h.

Member Enumeration Documentation

◆ anonymous enum [1/3]

template<unsigned int N>
anonymous enum
inherited

The number of dimensions of the array.

Enumerator
NDIM 

Definition at line 138 of file Control/CxxUtils/CxxUtils/Array.h.

◆ anonymous enum [2/3]

anonymous enum
inherited

The number of dimensions of the array.

Definition at line 138 of file Control/CxxUtils/CxxUtils/Array.h.

◆ anonymous enum [3/3]

anonymous enum

The number of dimensions of the array.

Definition at line 138 of file Control/CxxUtils/CxxUtils/Array.h.

138{ NDIM = N };
Read-write multidimensional array.

◆ anonymous enum

anonymous enum
inherited

The number of dimensions of the array.

Enumerator
NDIM 

Definition at line 273 of file Control/CxxUtils/CxxUtils/Array.h.

273{ NDIM = 0 };

Constructor & Destructor Documentation

◆ WritableArray() [1/4]

Constructor.

Parameters
repArrayrep from which to initialize the array.

Initialize an array from an Arrayrep. The new array will represent the entire Arrayrep. The dimension N must match the length of the Arrayrep's shape.

◆ WritableArray() [2/4]

CxxUtils::WritableArray< 0 >::WritableArray ( Arrayrep & rep,
unsigned int offs )
private

Private constructor for array indexing.

Parameters
repArrayrep from which to initialize the array.
offsOffset of the first element of the new array within rep.

This is a private constructor used to make the Array instances returned from an indexing operation.

◆ WritableArray() [3/4]

Constructor.

Parameters
repArrayrep from which to initialize the array.

Initialize an array from an Arrayrep. The new array will represent the entire Arrayrep. The dimension N must match the length of the Arrayrep's shape.

◆ WritableArray() [4/4]

CxxUtils::WritableArray< N >::WritableArray ( Arrayrep & rep,
unsigned int offs )
private

Private constructor for array indexing.

Parameters
repArrayrep from which to initialize the array.
offsOffset of the first element of the new array within rep.

This is a private constructor used to make the Array instances returned from an indexing operation.

Member Function Documentation

◆ asint()

int CxxUtils::Array< 0 >::asint ( ) const
inherited

Convert to an integer.

Returns
The Array<0> contents as an integer.

◆ begin() [1/3]

template<unsigned int N>
const_iterator CxxUtils::Array< N >::begin ( ) const
inherited

Return an iterator pointing at the beginning of the container.

Returns
An iterator pointing at the beginning of the container.

◆ begin() [2/3]

const_iterator CxxUtils::Array< N >::begin ( ) const
inherited

Return an iterator pointing at the beginning of the container.

Returns
An iterator pointing at the beginning of the container.

◆ begin() [3/3]

const_iterator CxxUtils::Array< N >::begin ( ) const

Return an iterator pointing at the beginning of the container.

Returns
An iterator pointing at the beginning of the container.

◆ end() [1/3]

template<unsigned int N>
const_iterator CxxUtils::Array< N >::end ( ) const
inherited

Return an iterator pointing past the end of the container.

Returns
An iterator pointing past the end of the container.

◆ end() [2/3]

const_iterator CxxUtils::Array< N >::end ( ) const
inherited

Return an iterator pointing past the end of the container.

Returns
An iterator pointing past the end of the container.

◆ end() [3/3]

const_iterator CxxUtils::Array< N >::end ( ) const

Return an iterator pointing past the end of the container.

Returns
An iterator pointing past the end of the container.

◆ operator Arrayelt()

CxxUtils::Array< 0 >::operator Arrayelt ( ) const
inherited

Convert to a number.

Returns
The Array<0> contents as a number.

◆ operator=()

WritableArray< 0 > & CxxUtils::WritableArray< 0 >::operator= ( Arrayelt elt)

Assignment.

Parameters
eltThe RHS of the assignment.
Returns
This object.

Assign into the array.

◆ operator[]() [1/2]

WritableArray< N-1 > CxxUtils::WritableArray< N >::operator[] ( unsigned int i)

Array indexing.

Parameters
iThe desired index. Must be less than the array size along this dimension.
Returns
The i'th N-1 dimensional subarray in the array.

Note that this operation is not available if N is 0.

◆ operator[]() [2/2]

Array< N-1 > CxxUtils::WritableArray< N >::operator[] ( unsigned int i) const

Array indexing.

Parameters
iThe desired index. Must be less than the array size along this dimension.
Returns
The i'th N-1 dimensional subarray in the array.

Note that this operation is not available if N is 0.

◆ ptr() [1/4]

template<unsigned int N>
const Arrayelt * CxxUtils::Array< N >::ptr ( ) const
inherited

Return a direct pointer to array elements.

Returns
A pointer to the first array elements.

Subsequent elements follow in standard C indexing order.

◆ ptr() [2/4]

const Arrayelt * CxxUtils::Array< N >::ptr ( ) const
inherited

Return a direct pointer to array elements.

Returns
A pointer to the first array elements.

Subsequent elements follow in standard C indexing order.

◆ ptr() [3/4]

Return a direct pointer to array elements.

Returns
A pointer to the first array elements.

Subsequent elements follow in standard C indexing order.

◆ ptr() [4/4]

const Arrayelt * CxxUtils::Array< N >::ptr ( ) const

Return a direct pointer to array elements.

Returns
A pointer to the first array elements.

Subsequent elements follow in standard C indexing order.

◆ shape() [1/3]

template<unsigned int N>
std::vector< unsigned int > CxxUtils::Array< N >::shape ( ) const
inherited

Return the array shape.

Returns
The array shape.

The array shape is vector with one element for each array dimension, giving the size of the array along that dimension.

◆ shape() [2/3]

std::vector< unsigned int > CxxUtils::Array< 0 >::shape ( ) const
inherited

Return the array shape.

Returns
The array shape.

The array shape is vector with one element for each array dimension, giving the size of the array along that dimension. For Array<0>, this will always be an empty array.

◆ shape() [3/3]

std::vector< unsigned int > CxxUtils::Array< N >::shape ( ) const

Return the array shape.

Returns
The array shape.

The array shape is vector with one element for each array dimension, giving the size of the array along that dimension.

◆ size() [1/3]

template<unsigned int N>
unsigned int CxxUtils::Array< N >::size ( unsigned int dim = 0) const
inherited

Return the size of the array along one dimension.

Parameters
dimThe dimension of the size to retrieve. Must be less than the number of dimensions.
Returns
The array size along dimension dim.

◆ size() [2/3]

unsigned int CxxUtils::Array< 0 >::size ( unsigned int dim = 0) const
inherited

Return the size of the array along one dimension.

Parameters
dimThe dimension of the size to retrieve. Must be less than the number of dimensions.
Returns
The array size along dimension dim.

For Array<0>, dim must be 0, and the function will always return 0.

◆ size() [3/3]

unsigned int CxxUtils::Array< N >::size ( unsigned int dim = 0) const

Return the size of the array along one dimension.

Parameters
dimThe dimension of the size to retrieve. Must be less than the number of dimensions.
Returns
The array size along dimension dim.

◆ valid() [1/3]

template<unsigned int N>
bool CxxUtils::Array< N >::valid ( ) const
inherited

Test for validity.

Returns
True if the Array is associated with an Arrayrep, false if not.

◆ valid() [2/3]

bool CxxUtils::Array< 0 >::valid ( ) const
inherited

Test for validity.

Returns
True if the Array is associated with an Arrayrep, false if not.

◆ valid() [3/3]

bool CxxUtils::Array< N >::valid ( ) const

Test for validity.

Returns
True if the Array is associated with an Arrayrep, false if not.

◆ write_array() [1/3]

template<unsigned int N>
void CxxUtils::Array< N >::write_array ( std::ostream & stream) const
inherited

Creates a text representation of the array content.

Parameters
std::ostreamwhere the text should be written

Writes the content of the array to a ostream. The sub-arrays are enclosed by square-brackets and separated by commas.

◆ write_array() [2/3]

void CxxUtils::Array< 0 >::write_array ( std::ostream & stream) const
inherited

Creates a text representation of the array content.

Parameters
std::ostreamwhere the text should be written

Writes the content of the array to a ostream. The sub-arrays are enclosed by square brackets and separated by commas.

◆ write_array() [3/3]

void CxxUtils::Array< N >::write_array ( std::ostream & stream) const

Creates a text representation of the array content.

Parameters
std::ostreamwhere the text should be written

Writes the content of the array to a ostream. The sub-arrays are enclosed by square-brackets and separated by commas.

◆ WritableArray< 1 >

friend class WritableArray< 1 >
friend

Definition at line 750 of file Control/CxxUtils/CxxUtils/Array.h.

◆ WritableArray< N+1 >

friend class WritableArray< N+1 >
friend

Definition at line 698 of file Control/CxxUtils/CxxUtils/Array.h.

Member Data Documentation

◆ m_elt

const Arrayelt* CxxUtils::Array< 0 >::m_elt
protectedinherited

Pointer to this array's single element.

Null if this instance was created using the default constructor.

Definition at line 365 of file Control/CxxUtils/CxxUtils/Array.h.

◆ m_elt_nc

Arrayelt* CxxUtils::WritableArray< 0 >::m_elt_nc
private

Pointer to this array's single element, non-const copy.

Null if this instance was created using the default constructor.

Definition at line 757 of file Control/CxxUtils/CxxUtils/Array.h.

◆ m_offs [1/3]

template<unsigned int N>
unsigned int CxxUtils::Array< N >::m_offs
protectedinherited

Offset in the Arrayrep's data of the first element of this array.

Definition at line 255 of file Control/CxxUtils/CxxUtils/Array.h.

◆ m_offs [2/3]

unsigned int CxxUtils::Array< N >::m_offs
protectedinherited

Offset in the Arrayrep's data of the first element of this array.

Definition at line 255 of file Control/CxxUtils/CxxUtils/Array.h.

◆ m_offs [3/3]

unsigned int CxxUtils::Array< N >::m_offs
protected

Offset in the Arrayrep's data of the first element of this array.

Definition at line 255 of file Control/CxxUtils/CxxUtils/Array.h.

◆ m_rep [1/3]

template<unsigned int N>
const Arrayrep* CxxUtils::Array< N >::m_rep
protectedinherited

Pointer to the representation.

Null if this instance was created using the default constructor.

Definition at line 252 of file Control/CxxUtils/CxxUtils/Array.h.

◆ m_rep [2/3]

const Arrayrep* CxxUtils::Array< N >::m_rep
protectedinherited

Pointer to the representation.

Null if this instance was created using the default constructor.

Definition at line 252 of file Control/CxxUtils/CxxUtils/Array.h.

◆ m_rep [3/3]

const Arrayrep* CxxUtils::Array< N >::m_rep
protected

Pointer to the representation.

Null if this instance was created using the default constructor.

Definition at line 252 of file Control/CxxUtils/CxxUtils/Array.h.

◆ m_rep_nc

Arrayrep* CxxUtils::WritableArray< N >::m_rep_nc
private

The underlying array representation, non-const copy.

Definition at line 704 of file Control/CxxUtils/CxxUtils/Array.h.


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