datacontainer.h

Go to the documentation of this file.
00001 #ifndef  __GlobalData_h
00002 #define  __GlobalData_h
00003 
00004 
00005 #include "gascoigne.h"
00006 
00007 namespace Gascoigne
00008 {
00009   
00014 
00018 
00019   class DataContainer
00020   {
00021     private:
00022 
00023     protected:
00024 
00025     public:
00026       GlobalData          _node;
00027       GlobalData          _cell;
00028       GlobalParameterData _parameter;
00029 
00030       //
00032       //
00033       DataContainer() {}
00034       ~DataContainer() {}
00035 
00036       void AddNodeVector(const std::string& name, const GlobalVector* d) {
00037         assert(d!=NULL);
00038         if(!_node.insert(std::make_pair(name,d)).second)
00039         {
00040           std::cerr << "NodeVector \"" << name << "\" already added" << std::endl;
00041           abort();
00042         }
00043       }
00044       void AddCellVector(const std::string& name, const GlobalVector* d) {
00045         assert(d!=NULL);
00046         if(!_cell.insert(std::make_pair(name,d)).second)
00047         {
00048           std::cerr << "CellVector \"" << name << "\" already added" << std::endl;
00049           abort();
00050         }
00051       }
00052       void AddParameterVector(const std::string& name, const GlobalParameterVector* d) {
00053         assert(d!=NULL);
00054         if(!_parameter.insert(std::make_pair(name,d)).second)
00055         {
00056           std::cerr << "ParameterVector \"" << name << "\" already added" << std::endl;
00057           abort();
00058         }
00059       }
00060       
00061       void DeleteNodeVector(const std::string& name) {
00062         _node.erase(name);
00063       }
00064       void DeleteCellVector(const std::string& name) {
00065         _cell.erase(name);
00066       }
00067       void DeleteParameterVector(const std::string& name) {
00068         _parameter.erase(name);
00069       }
00070 
00071       const GlobalData& GetNodeData() const {
00072         return _node;
00073       }
00074       const GlobalData& GetCellData() const {
00075         return _cell;
00076       }
00077       const GlobalParameterData& GetParameterData() const {
00078         return _parameter;
00079       }
00080   };
00081 }
00082 
00083 #endif

Generated on Thu Sep 14 10:34:36 2006 for Gascoigne by  doxygen 1.4.7