CMS 3D CMS Logo

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 10 of file poly.h.

Member Typedef Documentation

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

Definition at line 28 of file poly.h.

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

Definition at line 29 of file poly.h.

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

Definition at line 26 of file poly.h.

Constructor & Destructor Documentation

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

Definition at line 30 of file poly.h.

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

Definition at line 31 of file poly.h.

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

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

Member Function Documentation

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

Definition at line 46 of file poly.h.

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

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

Definition at line 47 of file poly.h.

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

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

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

Definition at line 49 of file poly.h.

References poly< T >::columns.

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

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

Definition at line 50 of file poly.h.

References poly< T >::columns.

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

Definition at line 41 of file poly.h.

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

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

Definition at line 42 of file poly.h.

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

42 { columns.back().insert(R.begin(),R.end()); return *this;}
const_iterator end() const
Definition: poly.h:47
const_iterator begin() const
Definition: poly.h:46
std::list< std::set< T > > columns
Definition: poly.h:22
template<class T>
poly poly< T >::operator++ ( )
inline

Definition at line 38 of file poly.h.

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

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

Definition at line 39 of file poly.h.

References poly< T >::columns.

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

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

Definition at line 40 of file poly.h.

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

40 { operator++(); return operator*=(r);}
poly operator*=(const T &r)
Definition: poly.h:41
poly operator++()
Definition: poly.h:38
template<class T>
bool poly< T >::operator< ( const poly< T > &  R) const
inline

Definition at line 33 of file poly.h.

References poly< T >::columns.

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

Definition at line 52 of file poly.h.

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

52  {
53  if(columns.empty()) return 0;
54  size_t size=1;
55  for( const_column_iterator column = columns.begin(); column != columns.end(); ++column)
56  size *= column->size();
57  return size;
58  }
std::list< std::set< T > > columns
Definition: poly.h:22
std::list< std::set< T > >::const_iterator const_column_iterator
Definition: poly.h:29
size_t size() const
Definition: poly.h:52

Friends And Related Function Documentation

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

Definition at line 104 of file poly.h.

104 { return lhs + poly<T>(rhs);}
Definition: poly.h:10
template<class T>
poly<T> operator+ ( const char *  lhs,
const poly< T > &  rhs 
)
friend

Definition at line 105 of file poly.h.

105 { return poly<T>(lhs) + rhs;}
Definition: poly.h:10

Member Data Documentation

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

Definition at line 22 of file poly.h.

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