ATLAS Offline Software
Public Types | Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members
CxxUtils::WritableArray< 0 > Class Reference

#include <Array.h>

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

Public Types

enum  { NDIM = 0 }
 The number of dimensions of the array. More...
 

Public Member Functions

 WritableArray (Arrayrep &rep)
 Constructor. More...
 
WritableArray< 0 > & operator= (Arrayelt elt)
 Assignment. More...
 
bool valid () const
 Test for validity. More...
 
std::vector< unsigned int > shape () const
 Return the array shape. More...
 
unsigned int size (unsigned int dim=0) const
 Return the size of the array along one dimension. More...
 
 operator Arrayelt () const
 Convert to a number. More...
 
int asint () const
 Convert to an integer. More...
 
void write_array (std::ostream &stream) const
 Creates a text representation of the array content. More...
 

Protected Attributes

const Arrayelt * m_elt
 Pointer to this array's single element. More...
 

Private Member Functions

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

Private Attributes

Arrayelt * m_elt_nc
 Pointer to this array's single element, non-const copy. More...
 

Friends

class WritableArray< 1 >
 

Detailed Description

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

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited

The number of dimensions of the array.

Enumerator
NDIM 

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

276 { NDIM = 0 };

Constructor & Destructor Documentation

◆ WritableArray() [1/2]

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/2]

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.

Member Function Documentation

◆ asint()

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

Convert to an integer.

Returns
The Array<0> contents as an integer.

◆ 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.

◆ shape()

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.

◆ size()

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.

◆ valid()

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

Test for validity.

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

◆ write_array()

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.

Friends And Related Function Documentation

◆ WritableArray< 1 >

friend class WritableArray< 1 >
friend

Definition at line 753 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 368 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 760 of file Control/CxxUtils/CxxUtils/Array.h.


The documentation for this class was generated from the following file:
CxxUtils::Array< 0 >::NDIM
@ NDIM
Definition: Control/CxxUtils/CxxUtils/Array.h:276