MC_int_vector_vector.hpp

Go to the documentation of this file.
00001 /*
00002 **    Mesh Converter
00003 **    Copyright (C) 2008 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_VECTOR_VECTOR_H_
00021 #define MC_INT_VECTOR_VECTOR_H_
00022 
00023 #include <MC_int_vector.hpp>
00024 
00025 #include <stdlib.h>
00026 
00027 namespace mesh_conv
00028 {
00029 
00030     class MC_int_list_vector;
00031 
00035     class MC_int_vector_vector
00036     {
00037     public:
00038 
00039     //************************************************//
00040     //************************************************//
00041     //CONSTRUCTORS
00042     //************************************************//
00043     //************************************************//
00044 
00046     MC_int_vector_vector();
00048     MC_int_vector_vector(const MC_int_vector& v0);
00050     MC_int_vector_vector(const MC_int_vector& v0,const MC_int_vector& v1);
00052     MC_int_vector_vector(const MC_int_vector& v0,const MC_int_vector& v1,const MC_int_vector& v2);
00054     MC_int_vector_vector(const MC_int_vector& v0,const MC_int_vector& v1,const MC_int_vector& v2,const MC_int_vector& v3);
00055 
00057     MC_int_vector_vector(const MC_int_list_vector& v);
00058 
00060     MC_int_vector_vector(const std::list <MC_int_vector>& vec);
00061 
00062     //************************************************//
00063     //************************************************//
00064     //Asserts
00065     //************************************************//
00066     //************************************************//
00067 
00071     void assert_bounds(const int& u) const;
00072 
00073 
00074     //************************************************//
00075     //************************************************//
00076     //Informations
00077     //************************************************//
00078     //************************************************//
00079 
00081     int size() const;
00082 
00083 
00084 
00085 
00086 
00087     //************************************************//
00088     //************************************************//
00089     //Manipulation
00090     //************************************************//
00091     //************************************************//
00092 
00094     void clear();
00095 
00099     MC_int_vector_vector& resize(const int& new_size);
00101     static MC_int_vector_vector empty(const int& N);
00102 
00106     MC_int_vector_vector& add(const MC_int_vector& val);
00110     friend MC_int_vector_vector operator<<(const MC_int_vector_vector& vec,const MC_int_vector& value);
00111 
00112 
00116     MC_int_vector_vector& add(const MC_int_vector_vector& val);
00120     friend MC_int_vector_vector operator<<(const MC_int_vector_vector& vec,const MC_int_vector_vector& to_add);
00121 
00125     MC_int_vector_vector& set(const int& k_index,const MC_int_vector& new_value);
00129     MC_int_vector_vector& set(const MC_int_vector& k_index,const MC_int_vector_vector& new_value);
00130 
00136     std::pair <MC_int_vector_vector,MC_int_vector> delete_index(const int& index_to_delete) const;
00142     std::pair <MC_int_vector_vector,MC_int_vector_vector> delete_index(const MC_int_vector& index_to_delete) const;
00143 
00144 
00145     //************************************************//
00146     //************************************************//
00147     //Math operator
00148     //************************************************//
00149     //************************************************//
00150 
00152     friend MC_int_vector_vector operator+(const MC_int_vector_vector& vec,const int& to_add);
00154     friend MC_int_vector_vector operator-(const MC_int_vector_vector& vec,const int& to_add);
00155 
00156 
00157     //************************************************//
00158     //************************************************//
00159     //Static initialization
00160     //************************************************//
00161     //************************************************//
00162 
00167     static MC_int_vector_vector repeat(const MC_int_vector& input,const int& N_repeat);
00168 
00169     //************************************************//
00170     //************************************************//
00171     //Get value
00172     //************************************************//
00173     //************************************************//
00174 
00176     const MC_int_vector& operator()(const int& index) const ;
00178     MC_int_vector& operator()(const int& index) ;
00180     const MC_int_vector& operator[](const int& index) const ;
00182     MC_int_vector& operator[](const int& index) ;
00183 
00185     MC_int_vector_vector operator()(const MC_int_vector& index) const;
00186 
00187 
00189     const MC_int_vector& first() const;
00191     MC_int_vector& first();
00193     const MC_int_vector& last() const;
00195     MC_int_vector& last();
00196 
00198     const MC_int_vector* pointer() const;
00202     MC_int_vector* pointer_unprotected();
00203 
00204 
00205     //************************************************//
00206     //************************************************//
00207     //Input/Output
00208     //************************************************//
00209     //************************************************//
00210 
00211     friend std::ostream& operator<<(std::ostream& stream,const MC_int_vector_vector& input);
00212 
00213     private:
00214 
00216     std::vector <MC_int_vector> int_vec_list;
00217 };
00218 
00219 }
00220 
00221 
00222 #endif

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