CxxUtils::Array< 0 > Class Template Reference

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

List of all members.

Public Types

enum  { NDIM = 0 }
 

The number of dimensions of the array.


Public Member Functions

 Array ()
 Default constructor.
 Array (const Arrayrep &rep)
 Constructor.
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.

Protected Member Functions

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

Protected Attributes

const Arrayelt * m_elt

Friends

class Array< 1 >

template<>
class CxxUtils::Array< 0 >


Constructor & Destructor Documentation

CxxUtils::Array< 0 >::Array (  )  [inline]

Default constructor.

This produces an invalid Array that is not associated with an Arrayrep. valid() will return false for such an array. The only other thing that it is legal to do with an invalid array is to assign to it (which may make it valid).

CxxUtils::Array< 0 >::Array ( const Arrayrep rep  )  [inline]

Constructor.

Parameters:
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.

CxxUtils::Array< 0 >::Array ( const Arrayrep rep,
unsigned int  offs 
) [inline, protected]

Private constructor for array indexing.

Parameters:
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.


Member Function Documentation

int CxxUtils::Array< 0 >::asint (  )  const [inline]

Convert to an integer.

Returns:
The Array<0> contents as an integer.
CxxUtils::Array< 0 >::operator Arrayelt (  )  const [inline]

Convert to a number.

Returns:
The Array<0> contents as a number.
std::vector< unsigned int > CxxUtils::Array< 0 >::shape (  )  const [inline]

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.

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

Return the size of the array along one dimension.

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

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

bool CxxUtils::Array< 0 >::valid (  )  const [inline]

Test for validity.

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

Member Data Documentation

const Arrayelt* CxxUtils::Array< 0 >::m_elt [protected]

Pointer to this array's single element. Null if this instance was created using the default constructor.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 15 Apr 2017 for RootCore Packages by  doxygen 1.6.1