BOSS 7.0.6
BESIII Offline Software System
Loading...
Searching...
No Matches
CArray< T, N > Class Template Reference

#include <pointer.h>

Public Types

typedef std::auto_ptr< CArrayPtr
 
typedef T * iterator
 

Public Member Functions

 CArray (T dval=T())
 
iterator begin ()
 
iterator end ()
 
const T & operator[] (const int idx) const
 
T & operator[] (const int idx)
 

Static Public Attributes

static const int size = N
 

Detailed Description

template<typename T, int N>
class CArray< T, N >

Definition at line 134 of file pointer.h.

Member Typedef Documentation

◆ iterator

template<typename T , int N>
typedef T* CArray< T, N >::iterator

Definition at line 145 of file pointer.h.

◆ Ptr

template<typename T , int N>
typedef std::auto_ptr<CArray> CArray< T, N >::Ptr

Definition at line 137 of file pointer.h.

Constructor & Destructor Documentation

◆ CArray()

template<typename T , int N>
CArray< T, N >::CArray ( dval = T())
inline

Definition at line 139 of file pointer.h.

139 {
140 for (iterator i=begin(); i!=end(); ++i) {
141 *i=dval;
142 }
143 }
iterator end()
Definition: pointer.h:147
iterator begin()
Definition: pointer.h:146
T * iterator
Definition: pointer.h:145

Member Function Documentation

◆ begin()

template<typename T , int N>
iterator CArray< T, N >::begin ( )
inline

Definition at line 146 of file pointer.h.

146{ return &elems[0]; }

Referenced by CArray< T, N >::CArray().

◆ end()

template<typename T , int N>
iterator CArray< T, N >::end ( )
inline

Definition at line 147 of file pointer.h.

147{ return &elems[N]; }

Referenced by CArray< T, N >::CArray().

◆ operator[]() [1/2]

template<typename T , int N>
T & CArray< T, N >::operator[] ( const int  idx)
inline

Definition at line 153 of file pointer.h.

153{ return elems[idx]; }

◆ operator[]() [2/2]

template<typename T , int N>
const T & CArray< T, N >::operator[] ( const int  idx) const
inline

Definition at line 152 of file pointer.h.

152{ return elems[idx]; }

Member Data Documentation

◆ size

template<typename T , int N>
const int CArray< T, N >::size = N
static

Definition at line 150 of file pointer.h.


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