CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions | Private Attributes | Friends
poly< T > Class Template Reference

#include <poly.h>

Inheritance diagram for poly< T >:

Classes

class  const_iterator
 

Public Types

typedef std::list< std::set< T >
>::iterator 
column_iterator
 
typedef std::list< std::set< T >
>::const_iterator 
const_column_iterator
 
typedef T value_type
 

Public Member Functions

const_iterator begin () const
 
const_iterator end () const
 
auto const & getColumns () const
 
auto & getColumns ()
 
poly operator*= (const T &r)
 
poly operator*= (const poly &R)
 
poly operator++ ()
 
poly operator+= (const poly &R)
 
poly operator+= (const T &r)
 
bool operator< (const poly &R) const
 
 poly ()
 
 poly (const T &t)
 
size_t size () const
 

Private Attributes

std::list< std::set< T > > columns
 

Friends

poly< Toperator+ (const poly< T > &, const char *)
 
poly< Toperator+ (const char *, const poly< T > &)
 

Detailed Description

template<class T>
class poly< T >

Definition at line 11 of file poly.h.

Member Typedef Documentation

template<class T>
typedef std::list<std::set<T> >::iterator poly< T >::column_iterator

Definition at line 29 of file poly.h.

template<class T>
typedef std::list<std::set<T> >::const_iterator poly< T >::const_column_iterator

Definition at line 30 of file poly.h.

template<class T>
typedef T poly< T >::value_type

Definition at line 27 of file poly.h.

Constructor & Destructor Documentation

template<class T>
poly< T >::poly ( )
inline

Definition at line 31 of file poly.h.

31 {}
template<class T>
poly< T >::poly ( const T t)
inline

Definition at line 32 of file poly.h.

References poly< T >::operator+=().

32 { operator+=(t); }
poly operator+=(const poly &R)
Definition: poly.h:46

Member Function Documentation

template<class T>
const_iterator poly< T >::begin ( ) const
inline

Definition at line 65 of file poly.h.

Referenced by poly< T >::operator*=().

65 { return const_iterator(*this); }
template<class T>
const_iterator poly< T >::end ( ) const
inline

Definition at line 66 of file poly.h.

References poly< T >::const_iterator::end_of().

Referenced by Types.LuminosityBlockRange::cppID(), Types.EventRange::cppID(), and poly< T >::operator*=().

66 { return const_iterator::end_of(*this); }
static const_iterator end_of(const poly &p)
Definition: poly.h:134
template<class T>
auto const& poly< T >::getColumns ( ) const
inline

Definition at line 68 of file poly.h.

References poly< T >::columns.

Referenced by poly< T >::const_iterator::end_of().

68 { return columns; }
std::list< std::set< T > > columns
Definition: poly.h:24
template<class T>
auto& poly< T >::getColumns ( )
inline

Definition at line 69 of file poly.h.

References poly< T >::columns.

69 { return columns; }
std::list< std::set< T > > columns
Definition: poly.h:24
template<class T>
poly poly< T >::operator*= ( const T r)
inline

Definition at line 54 of file poly.h.

References poly< T >::columns.

Referenced by poly< T >::operator+=().

54  {
55  columns.back().insert(r);
56  return *this;
57  }
std::list< std::set< T > > columns
Definition: poly.h:24
template<class T>
poly poly< T >::operator*= ( const poly< T > &  R)
inline

Definition at line 58 of file poly.h.

References poly< T >::begin(), poly< T >::columns, and poly< T >::end().

58  {
59  columns.back().insert(R.begin(), R.end());
60  return *this;
61  }
const_iterator end() const
Definition: poly.h:66
const_iterator begin() const
Definition: poly.h:65
std::list< std::set< T > > columns
Definition: poly.h:24
template<class T>
poly poly< T >::operator++ ( )
inline

Definition at line 42 of file poly.h.

References poly< T >::columns.

Referenced by poly< T >::operator+=().

42  {
43  columns.push_back(std::set<T>());
44  return *this;
45  }
std::list< std::set< T > > columns
Definition: poly.h:24
template<class T>
poly poly< T >::operator+= ( const poly< T > &  R)
inline

Definition at line 46 of file poly.h.

References poly< T >::columns.

Referenced by poly< T >::poly().

46  {
47  columns.insert(columns.end(), R.columns.begin(), R.columns.end());
48  return *this;
49  }
std::list< std::set< T > > columns
Definition: poly.h:24
template<class T>
poly poly< T >::operator+= ( const T r)
inline

Definition at line 50 of file poly.h.

References poly< T >::operator*=(), and poly< T >::operator++().

50  {
51  operator++();
52  return operator*=(r);
53  }
poly operator*=(const T &r)
Definition: poly.h:54
poly operator++()
Definition: poly.h:42
template<class T>
bool poly< T >::operator< ( const poly< T > &  R) const
inline

Definition at line 34 of file poly.h.

References poly< T >::columns.

34  {
35  const_column_iterator column(columns.begin()), Rcolumn(R.columns.begin());
36  while (column != columns.end() && Rcolumn != R.columns.end() && *column == *Rcolumn) {
37  ++column;
38  ++Rcolumn;
39  }
40  return column != columns.end() && Rcolumn != R.columns.end() && *column < *Rcolumn;
41  }
std::list< std::set< T > > columns
Definition: poly.h:24
std::list< std::set< T > >::const_iterator const_column_iterator
Definition: poly.h:30
template<class T>
size_t poly< T >::size ( void  ) const
inline

Definition at line 71 of file poly.h.

References poly< T >::columns.

Referenced by ntupleDataFormat._Collection::__iter__(), ntupleDataFormat._Collection::__len__(), and poly< T >::const_iterator::end_of().

71  {
72  if (columns.empty())
73  return 0;
74  size_t size = 1;
75  for (const_column_iterator column = columns.begin(); column != columns.end(); ++column)
76  size *= column->size();
77  return size;
78  }
std::list< std::set< T > > columns
Definition: poly.h:24
std::list< std::set< T > >::const_iterator const_column_iterator
Definition: poly.h:30
size_t size() const
Definition: poly.h:71

Friends And Related Function Documentation

template<class T>
poly<T> operator+ ( const poly< T > &  lhs,
const char *  rhs 
)
friend
template<class T>
poly<T> operator+ ( const char *  lhs,
const poly< T > &  rhs 
)
friend

Member Data Documentation

template<class T>
std::list<std::set<T> > poly< T >::columns
private