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

#include <pointer.h>

Public Types

typedef NIter< T, N > iterator
 

Public Member Functions

 DArray ()
 
iterator begin ()
 
iterator end ()
 
T & insert (const T &el)
 
void reset ()
 
const T & operator[] (const int idx) const
 
T & operator[] (const int idx)
 
 DArray ()
 
iterator begin ()
 
iterator end ()
 
T & insert (const T &el)
 
void reset ()
 
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 DArray< T, N >

Definition at line 79 of file eemmg-lib/src/pointer.h.

Member Typedef Documentation

◆ iterator

template<typename T , int N>
typedef NIter< T, N > DArray< T, N >::iterator

Definition at line 84 of file eemmg-lib-new/src/pointer.h.

Constructor & Destructor Documentation

◆ DArray() [1/2]

template<typename T , int N>
DArray< T, N >::DArray ( )
inline

Definition at line 82 of file eemmg-lib-new/src/pointer.h.

82: last(N), len(0) {}

◆ DArray() [2/2]

template<typename T , int N>
DArray< T, N >::DArray ( )
inline

Definition at line 82 of file eemmg-lib/src/pointer.h.

82: last(N), len(0) {}

Member Function Documentation

◆ begin() [1/2]

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

Definition at line 85 of file eemmg-lib-new/src/pointer.h.

85{ return iterator(elems, last); }
NIter< T, N > iterator

Referenced by getMinorN(), and MCache::smartinsertMinor3().

◆ begin() [2/2]

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

Definition at line 85 of file eemmg-lib/src/pointer.h.

85{ return iterator(elems, last); }

◆ end() [1/2]

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

Definition at line 86 of file eemmg-lib-new/src/pointer.h.

86{ return iterator(elems, last+len); }

Referenced by getMinorN(), and MCache::smartinsertMinor3().

◆ end() [2/2]

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

Definition at line 86 of file eemmg-lib/src/pointer.h.

86{ return iterator(elems, last+len); }

◆ insert() [1/2]

template<typename T , int N>
T & DArray< T, N >::insert ( const T & el)
inline

Definition at line 88 of file eemmg-lib-new/src/pointer.h.

88 {
89 len = (len == N ? len : len+1);
90 last=((last-1)+N)%N;
91 elems[last]=el;
92 return elems[last];
93 }

Referenced by getMinorN().

◆ insert() [2/2]

template<typename T , int N>
T & DArray< T, N >::insert ( const T & el)
inline

Definition at line 88 of file eemmg-lib/src/pointer.h.

88 {
89 len = (len == N ? len : len+1);
90 last=((last-1)+N)%N;
91 elems[last]=el;
92 return elems[last];
93 }

◆ operator[]() [1/4]

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

Definition at line 124 of file eemmg-lib-new/src/pointer.h.

124{ return elems[idx]; }

◆ operator[]() [2/4]

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

Definition at line 124 of file eemmg-lib/src/pointer.h.

124{ return elems[idx]; }

◆ operator[]() [3/4]

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

Definition at line 123 of file eemmg-lib-new/src/pointer.h.

123{ return elems[idx]; }

◆ operator[]() [4/4]

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

Definition at line 123 of file eemmg-lib/src/pointer.h.

123{ return elems[idx]; }

◆ reset() [1/2]

template<typename T , int N>
void DArray< T, N >::reset ( )
inline

Definition at line 112 of file eemmg-lib-new/src/pointer.h.

112 {
113#ifndef USE_DIRTY_RESET
114 for (int i=0; i<len; i++) {
115 elems[i]=T();
116 }
117#endif
118 last=N;
119 len=0;
120 }

Referenced by MCache::Clear(), ICache::ClearCC(), and ICache::ClearIC().

◆ reset() [2/2]

template<typename T , int N>
void DArray< T, N >::reset ( )
inline

Definition at line 112 of file eemmg-lib/src/pointer.h.

112 {
113#ifndef USE_DIRTY_RESET
114 for (int i=0; i<len; i++) {
115 elems[i]=T();
116 }
117#endif
118 last=N;
119 len=0;
120 }

Member Data Documentation

◆ size

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

Definition at line 122 of file eemmg-lib-new/src/pointer.h.


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