ATLAS Offline Software
|
Read-only multidimensional array, specialized for N=0
.
More...
#include <Array.h>
Public Types | |
enum | { NDIM = 0 } |
The number of dimensions of the array. More... | |
Public Member Functions | |
Array () | |
Default constructor. More... | |
Array (const Arrayrep &rep) | |
Constructor. 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 Member Functions | |
Array (const Arrayrep &rep, unsigned int offs) | |
Private constructor for array indexing. More... | |
Protected Attributes | |
const Arrayelt * | m_elt |
Pointer to this array's single element. More... | |
Friends | |
class | Array< 1 > |
class | WritableArray< 1 > |
Read-only multidimensional array, specialized for N=0
.
This is a specialization of Array
for the case N=0
, i.e., a scalar. It does not support indexing, but it does support implicit conversions to Arrayelt
, as well as an explicit conversion to an integer.
Definition at line 272 of file Control/CxxUtils/CxxUtils/Array.h.
anonymous enum |
The number of dimensions of the array.
Enumerator | |
---|---|
NDIM |
Definition at line 276 of file Control/CxxUtils/CxxUtils/Array.h.
CxxUtils::Array< 0 >::Array | ( | ) |
CxxUtils::Array< 0 >::Array | ( | const Arrayrep & | rep | ) |
Constructor.
rep | Arrayrep 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.
|
protected |
Private constructor for array indexing.
rep | Arrayrep from which to initialize the array. |
offs | Offset 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.
int CxxUtils::Array< 0 >::asint | ( | ) | const |
Convert to an integer.
Array<0>
contents as an integer. CxxUtils::Array< 0 >::operator Arrayelt | ( | ) | const |
Convert to a number.
Array<0>
contents as a number. std::vector<unsigned int> CxxUtils::Array< 0 >::shape | ( | ) | const |
Return 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.
unsigned int CxxUtils::Array< 0 >::size | ( | unsigned int | dim = 0 | ) | const |
Return the size of the array along one dimension.
dim | The dimension of the size to retrieve. Must be less than the number of dimensions. |
dim
.For Array<0>
, dim must be 0, and the function will always return 0.
bool CxxUtils::Array< 0 >::valid | ( | ) | const |
void CxxUtils::Array< 0 >::write_array | ( | std::ostream & | stream | ) | const |
Creates a text representation of the array content.
std::ostream | where 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.
|
friend |
Definition at line 360 of file Control/CxxUtils/CxxUtils/Array.h.
|
friend |
Definition at line 360 of file Control/CxxUtils/CxxUtils/Array.h.
|
protected |
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.