Public Types | Public Member Functions | Private Attributes | List of all members
WireCell::ObjectArray2d< Thing > Class Template Reference

#include <ObjectArray2d.h>

Public Types

typedef std::vector< Thingstore_t
 
typedef store_t::iterator iterator
 
typedef store_t::const_iterator const_iterator
 

Public Member Functions

 ObjectArray2d (size_t nrows=0, size_t ncols=0)
 
void resize (size_t nrows, size_t ncols)
 
void reset ()
 
const Thingoperator() (size_t irow, size_t icol) const
 
Thingoperator() (size_t irow, size_t icol)
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 

Private Attributes

store_t m_things
 
size_t m_nrows
 
size_t m_ncols
 

Detailed Description

template<typename Thing>
class WireCell::ObjectArray2d< Thing >

Definition at line 14 of file ObjectArray2d.h.

Member Typedef Documentation

template<typename Thing>
typedef store_t::const_iterator WireCell::ObjectArray2d< Thing >::const_iterator

Definition at line 18 of file ObjectArray2d.h.

template<typename Thing>
typedef store_t::iterator WireCell::ObjectArray2d< Thing >::iterator

Definition at line 17 of file ObjectArray2d.h.

template<typename Thing>
typedef std::vector<Thing> WireCell::ObjectArray2d< Thing >::store_t

Definition at line 16 of file ObjectArray2d.h.

Constructor & Destructor Documentation

template<typename Thing>
WireCell::ObjectArray2d< Thing >::ObjectArray2d ( size_t  nrows = 0,
size_t  ncols = 0 
)
inline

Definition at line 20 of file ObjectArray2d.h.

21  : m_nrows(nrows), m_ncols(ncols) {
22  if (nrows and ncols) {
23  m_things.resize(nrows*ncols);
24  }
25  }
unsigned nrows(sqlite3 *db, std::string const &tablename)
Definition: helpers.cc:84

Member Function Documentation

template<typename Thing>
iterator WireCell::ObjectArray2d< Thing >::begin ( )
inline

Definition at line 46 of file ObjectArray2d.h.

46 { return m_things.begin(); }
template<typename Thing>
const_iterator WireCell::ObjectArray2d< Thing >::begin ( ) const
inline

Definition at line 48 of file ObjectArray2d.h.

48 { return m_things.begin(); }
template<typename Thing>
iterator WireCell::ObjectArray2d< Thing >::end ( void  )
inline

Definition at line 47 of file ObjectArray2d.h.

47 { return m_things.end(); }
template<typename Thing>
const_iterator WireCell::ObjectArray2d< Thing >::end ( void  ) const
inline

Definition at line 49 of file ObjectArray2d.h.

49 { return m_things.end(); }
template<typename Thing>
const Thing& WireCell::ObjectArray2d< Thing >::operator() ( size_t  irow,
size_t  icol 
) const
inline

Definition at line 38 of file ObjectArray2d.h.

38  {
39  return m_things.at(icol + m_ncols*irow);
40  }
template<typename Thing>
Thing& WireCell::ObjectArray2d< Thing >::operator() ( size_t  irow,
size_t  icol 
)
inline

Definition at line 41 of file ObjectArray2d.h.

41  {
42  return m_things.at(icol + m_ncols*irow);
43  }
template<typename Thing>
void WireCell::ObjectArray2d< Thing >::reset ( void  )
inline

Definition at line 33 of file ObjectArray2d.h.

33  {
34  m_things.clear();
35  m_things.resize(m_nrows*m_ncols);
36  }
template<typename Thing>
void WireCell::ObjectArray2d< Thing >::resize ( size_t  nrows,
size_t  ncols 
)
inline

Definition at line 27 of file ObjectArray2d.h.

27  {
28  m_nrows = nrows;
29  m_ncols = ncols;
30  m_things.resize(nrows*ncols);
31  }
unsigned nrows(sqlite3 *db, std::string const &tablename)
Definition: helpers.cc:84

Member Data Documentation

template<typename Thing>
size_t WireCell::ObjectArray2d< Thing >::m_ncols
private

Definition at line 53 of file ObjectArray2d.h.

template<typename Thing>
size_t WireCell::ObjectArray2d< Thing >::m_nrows
private

Definition at line 53 of file ObjectArray2d.h.

template<typename Thing>
store_t WireCell::ObjectArray2d< Thing >::m_things
private

Definition at line 52 of file ObjectArray2d.h.


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