MC_int_pair_unique.hpp

Go to the documentation of this file.
00001 /*
00002 **    Mesh Converter
00003 **    Copyright (C) 2009  Damien Rohmer
00004 **
00005 **    This program is free software: you can redistribute it and/or modify
00006 **    it under the terms of the GNU General Public License as published by
00007 **    the Free Software Foundation, either version 3 of the License, or
00008 **    (at your option) any later version.
00009 **
00010 **   This program is distributed in the hope that it will be useful,
00011 **    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 **    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 **    GNU General Public License for more details.
00014 **
00015 **    You should have received a copy of the GNU General Public License
00016 **    along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017 */
00018 
00019 
00020 #ifndef _MC_INT_PAIR_UNIQUE_HPP_
00021 #define _MC_INT_PAIR_UNIQUE_HPP_
00022 
00023 #include <iostream>
00024 
00025 
00026 namespace mesh_conv
00027 {
00028     class MC_int_vector;
00029     class MC_int_pair;
00030 
00031     class MC_int_pair_unique
00032     {
00033     public:
00034 
00035 
00036         //************************************************//
00037         //************************************************//
00038         //CONSTRUCTORS
00039         //************************************************//
00040         //************************************************//
00041 
00043         MC_int_pair_unique();
00045         MC_int_pair_unique(const MC_int_pair_unique& I);
00047         MC_int_pair_unique(const MC_int_pair& p);
00049         MC_int_pair_unique(const int& _u0,const int& _u1);
00051         MC_int_pair_unique(const MC_int_vector& u);
00053         ~MC_int_pair_unique();
00054 
00055         //************************************************//
00056         //************************************************//
00057         //Information
00058         //************************************************//
00059         //************************************************//
00060 
00061 
00065         void assert_bounds(const int& u) const;
00066 
00067 
00068         //************************************************//
00069         //************************************************//
00070         //Get
00071         //************************************************//
00072         //************************************************//
00073 
00075         friend bool operator==(const MC_int_pair_unique& p1,const MC_int_pair_unique& p2);
00077         friend bool operator!=(const MC_int_pair_unique& p1,const MC_int_pair_unique& p2);
00078 
00080         const int& operator[](const int& k) const;
00082         int& operator[](const int& k);
00084         const int& operator()(const int& k) const;
00086         int& operator()(const int& k);
00087 
00088         //************************************************//
00089         //************************************************//
00090         //INPUT/OUTPUT
00091         //************************************************//
00092         //************************************************//
00093 
00095         friend std::ostream& operator << (std::ostream& stream,const MC_int_pair_unique& _v);
00096 
00097 
00098  private:
00099 
00101         int u0,u1;
00102 
00103     };
00104 
00105 
00107     class MC_int_pair_unique_less
00108     {
00109     public:
00110         bool operator ()(const MC_int_pair_unique& p0,const MC_int_pair_unique& p1) const
00111         {
00112 
00113             if( p0(0)<p1(0) || (p0(0)==p1(0) && p0(1)<p1(1)) )
00114                 return true;
00115 
00116             return false;
00117         }
00118     };
00119 
00120 
00121 }
00122 
00123 #endif

Generated on Sun Apr 18 20:24:47 2010 by  doxygen 1.6.1