SyFi  0.3
SyFi::OrderedPtvSet Class Reference

#include <OrderedPtvSet.h>

List of all members.

Public Member Functions

 OrderedPtvSet ()
 OrderedPtvSet (const Ptv &p0, const Ptv &p1)
 OrderedPtvSet (const Ptv &p0, const Ptv &p1, const Ptv &p2)
 OrderedPtvSet (const Ptv &p0, const Ptv &p1, const Ptv &p2, const Ptv &p3)
virtual ~OrderedPtvSet ()
void append (const Ptv &p)
unsigned int size () const
const Ptvoperator[] (unsigned int i) const
Ptvoperator[] (unsigned int i)
OrderedPtvSetoperator= (const OrderedPtvSet &p)
bool less (const OrderedPtvSet &s) const

Private Attributes

vector< PtvPtvs

Detailed Description

Definition at line 38 of file OrderedPtvSet.h.


Constructor & Destructor Documentation

Definition at line 29 of file OrderedPtvSet.cpp.

        {
        }
SyFi::OrderedPtvSet::OrderedPtvSet ( const Ptv p0,
const Ptv p1 
)

Definition at line 38 of file OrderedPtvSet.cpp.

References Ptvs.

        {
                Ptvs.push_back(p0);
                Ptvs.push_back(p1);
                std::sort(Ptvs.begin(), Ptvs.end(), Ptv_is_less());
        }
SyFi::OrderedPtvSet::OrderedPtvSet ( const Ptv p0,
const Ptv p1,
const Ptv p2 
)

Definition at line 45 of file OrderedPtvSet.cpp.

References Ptvs.

        {
                Ptvs.push_back(p0);
                Ptvs.push_back(p1);
                Ptvs.push_back(p2);
                std::sort(Ptvs.begin(), Ptvs.end(), Ptv_is_less());
        }
SyFi::OrderedPtvSet::OrderedPtvSet ( const Ptv p0,
const Ptv p1,
const Ptv p2,
const Ptv p3 
)

Definition at line 53 of file OrderedPtvSet.cpp.

References Ptvs.

        {
                Ptvs.push_back(p0);
                Ptvs.push_back(p1);
                Ptvs.push_back(p2);
                Ptvs.push_back(p3);
                std::sort(Ptvs.begin(), Ptvs.end(), Ptv_is_less());
        }

Definition at line 33 of file OrderedPtvSet.cpp.

References Ptvs.

        {
                Ptvs.clear();
        }

Member Function Documentation

void SyFi::OrderedPtvSet::append ( const Ptv p)

Definition at line 62 of file OrderedPtvSet.cpp.

References Ptvs.

        {
                Ptvs.push_back(p);
                std::sort(Ptvs.begin(), Ptvs.end(), Ptv_is_less());
        }
bool SyFi::OrderedPtvSet::less ( const OrderedPtvSet s) const

Definition at line 96 of file OrderedPtvSet.cpp.

References less(), Ptvs, and size().

Referenced by less(), and SyFi::OrderedPtvSet_is_less::operator()().

        {
                if ( Ptvs.size() <  p.size() ) return true ;
                if ( Ptvs.size() > p.size() ) return false;

                for (unsigned int i=Ptvs.size()-1; i>= 0; i--)
                {
                        if ( Ptvs[i].less(p[i]) && p[i].less(Ptvs[i]))
                        {
                        }
                        else if ( Ptvs[i].less(p[i]) )
                        {
                                return true;
                        }
                        else if ( p[i].less(Ptvs[i]) )
                        {
                                return false;
                        }
                }
                return false;
        }
OrderedPtvSet & SyFi::OrderedPtvSet::operator= ( const OrderedPtvSet p)

Definition at line 83 of file OrderedPtvSet.cpp.

References Ptvs, and size().

        {
                if ( this != &p)
                {
                        Ptvs.clear();
                        for (unsigned int i=0; i<p.size(); i++)
                        {
                                Ptvs.push_back(p[i]);
                        }
                }
                return *this;
        }
const Ptv & SyFi::OrderedPtvSet::operator[] ( unsigned int  i) const

Definition at line 73 of file OrderedPtvSet.cpp.

References Ptvs.

        {
                return Ptvs[i];
        }
Ptv & SyFi::OrderedPtvSet::operator[] ( unsigned int  i)

Definition at line 78 of file OrderedPtvSet.cpp.

References Ptvs.

        {
                return Ptvs[i];
        }
unsigned int SyFi::OrderedPtvSet::size ( ) const

Definition at line 68 of file OrderedPtvSet.cpp.

References Ptvs.

Referenced by less(), SyFi::operator<<(), and operator=().

        {
                return Ptvs.size();
        }

Member Data Documentation

vector<Ptv> SyFi::OrderedPtvSet::Ptvs [private]

Definition at line 40 of file OrderedPtvSet.h.

Referenced by append(), less(), operator=(), operator[](), OrderedPtvSet(), size(), and ~OrderedPtvSet().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator