CMS 3D CMS Logo

EZArrayFL.h
Go to the documentation of this file.
1 #ifndef GEOMETRY_CALOGEOMETRY_EZArrayFL_H
2 #define GEOMETRY_CALOGEOMETRY_EZArrayFL_H 1
3 
5 
19 template <class T>
20 class EZArrayFL {
21 public:
23  typedef typename MgrType::iterator iterator;
25  typedef typename MgrType::reference reference;
27  typedef typename MgrType::size_type size_type;
28  typedef typename MgrType::value_type value_type;
29 
31 
32  EZArrayFL<T>(MgrType* mgr) : m_begin(), m_mgr(mgr) {}
33 
35  : m_begin(0 == finis - start ? iterator() : mgr->assign()), m_mgr(mgr) {
36  assert((finis - start) == m_mgr->subSize());
37  iterator i(begin());
38  for (const_iterator ic(start); ic != finis; ++ic) {
39  (*i) = (*ic);
40  }
41  }
42 
43  virtual ~EZArrayFL<T>() {}
44 
45  void resize() { assign(); }
46 
47  void assign(const T& t = T()) {
48  assert(iterator() == m_begin);
49  m_begin = m_mgr->assign(t);
50  }
51 
52  const_iterator begin() const { return m_begin; }
53  const_iterator end() const { return m_begin + m_mgr->subSize(); }
54 
55  reference operator[](const unsigned int i) {
56  if (iterator() == m_begin)
57  assign();
58  return *(m_begin + i);
59  }
60 
61  const_reference operator[](const unsigned int i) const { return *(m_begin + i); }
62 
63  bool uninitialized() const { return (iterator() == m_begin); }
64 
65  bool empty() const { return (0 == size()); }
66 
67  size_type size() const { return m_mgr->subSize(); }
68 
69  size_type capacity() const { return size(); }
70 
71 protected:
72 private:
73  //EZArrayFL( const EZArrayFL& ) ; //stop
74  //EZArrayFL& operator=( const EZArrayFL& ) ; //stop
77 };
78 
79 #endif
EZMgrFL::subSize
size_type subSize() const
Definition: EZMgrFL.h:42
mps_fire.i
i
Definition: mps_fire.py:355
start
Definition: start.py:1
EZArrayFL::value_type
MgrType::value_type value_type
Definition: EZArrayFL.h:28
EZArrayFL::m_mgr
MgrType * m_mgr
Definition: EZArrayFL.h:76
EZMgrFL::reference
VecType::reference reference
Definition: EZMgrFL.h:13
cms::cuda::assert
assert(be >=bs)
EZArrayFL
Definition: EZArrayFL.h:20
EZArrayFL::end
const_iterator end() const
Definition: EZArrayFL.h:53
EZArrayFL::assign
void assign(const T &t=T())
Definition: EZArrayFL.h:47
EZArrayFL::size_type
MgrType::size_type size_type
Definition: EZArrayFL.h:27
EZArrayFL::capacity
size_type capacity() const
Definition: EZArrayFL.h:69
EZArrayFL::const_reference
MgrType::const_reference const_reference
Definition: EZArrayFL.h:26
EZArrayFL::reference
MgrType::reference reference
Definition: EZArrayFL.h:25
EZArrayFL::const_iterator
MgrType::const_iterator const_iterator
Definition: EZArrayFL.h:24
OrderedSet.t
t
Definition: OrderedSet.py:90
EZMgrFL::const_iterator
VecType::const_iterator const_iterator
Definition: EZMgrFL.h:12
EZArrayFL::begin
const_iterator begin() const
Definition: EZArrayFL.h:52
EZArrayFL::iterator
MgrType::iterator iterator
Definition: EZArrayFL.h:23
EZArrayFL::m_begin
iterator m_begin
Definition: EZArrayFL.h:75
EZMgrFL::iterator
VecType::iterator iterator
Definition: EZMgrFL.h:11
EZArrayFL::resize
void resize()
Definition: EZArrayFL.h:45
T
long double T
Definition: Basic3DVectorLD.h:48
EZArrayFL::size
size_type size() const
Definition: EZArrayFL.h:67
EZMgrFL.h
EZArrayFL< T >
EZMgrFL::value_type
VecType::value_type value_type
Definition: EZMgrFL.h:15
EZArrayFL::operator[]
const_reference operator[](const unsigned int i) const
Definition: EZArrayFL.h:61
EZArrayFL::operator[]
reference operator[](const unsigned int i)
Definition: EZArrayFL.h:55
EZMgrFL
Definition: EZMgrFL.h:8
EZMgrFL::const_reference
VecType::const_reference const_reference
Definition: EZMgrFL.h:14
EZMgrFL::assign
iterator assign(const T &t=T())
Definition: EZMgrFL.h:30
EZArrayFL::empty
bool empty() const
Definition: EZArrayFL.h:65
EZArrayFL::uninitialized
bool uninitialized() const
Definition: EZArrayFL.h:63
EZArrayFL::MgrType
EZMgrFL< T > MgrType
Definition: EZArrayFL.h:22
EZMgrFL::size_type
VecType::size_type size_type
Definition: EZMgrFL.h:16