fei_Record.hpp

00001 /*--------------------------------------------------------------------*/
00002 /*    Copyright 2005 Sandia Corporation.                              */
00003 /*    Under the terms of Contract DE-AC04-94AL85000, there is a       */
00004 /*    non-exclusive license for use of this work by or on behalf      */
00005 /*    of the U.S. Government.  Export of this program may require     */
00006 /*    a license from the United States Government.                    */
00007 /*--------------------------------------------------------------------*/
00008 
00009 #ifndef _fei_Record_hpp_
00010 #define _fei_Record_hpp_
00011 
00012 #include <fei_macros.hpp>
00013 
00014 namespace fei {
00015   class FieldMask;
00016 
00019   class Record {
00020   public:
00022     Record();
00023 
00024     Record(const Record& src)
00025      : isInLocalSubdomain_(src.isInLocalSubdomain_), ID_(src.ID_),
00026        fieldMask_(NULL), offsetIntoEqnNumbers_(src.offsetIntoEqnNumbers_),
00027        ownerProc_(src.ownerProc_), hasSlaveDof_(false)
00028     {}
00029 
00031     virtual ~Record();
00032 
00034     void setID(int ID)
00035       {
00036   ID_ = ID;
00037       }
00038 
00040     int getID() const
00041       {
00042   return(ID_);
00043       }
00044 
00046     void setNumber(int num)
00047       {
00048   number_ = num;
00049       }
00050 
00052     int getNumber() const
00053       {
00054   return(number_);
00055       }
00056 
00058     bool operator==(const Record& rcd) const
00059       {
00060   return( ID_ == rcd.ID_ );
00061       }
00062 
00064     bool operator!=(const Record& rcd) const
00065       {
00066   return( ID_ != rcd.ID_ );
00067       }
00068 
00070     bool operator<(const Record& rcd) const
00071       {
00072   return( ID_ < rcd.ID_ );
00073       }
00074 
00076     bool operator>(const Record& rcd) const
00077       {
00078   return( ID_ > rcd.ID_ );
00079       }
00080 
00082     void setOwnerProc(int owner)
00083       {
00084   ownerProc_ = owner;
00085       }
00086 
00088     int getOwnerProc() const
00089       {
00090   return(ownerProc_);
00091       }
00092 
00094     void setFieldMask(fei::FieldMask* fm)
00095       {
00096   fieldMask_ = fm;
00097       }
00098 
00100     fei::FieldMask* getFieldMask()
00101       {
00102   return( fieldMask_ );
00103       }
00104 
00106     const fei::FieldMask* getFieldMask() const
00107       {
00108   return( fieldMask_ );
00109       }
00110 
00113     void setOffsetIntoEqnNumbers(int offset)
00114       {
00115   offsetIntoEqnNumbers_ = offset;
00116       }
00117 
00120     int getOffsetIntoEqnNumbers() const
00121       {
00122   return(offsetIntoEqnNumbers_);
00123       }
00124 
00125     bool hasSlaveDof() const
00126       { return( hasSlaveDof_ ); }
00127 
00128     void hasSlaveDof(bool flag)
00129       { hasSlaveDof_ = flag; }
00130 
00132     int deepCopy(const Record& rcd);
00133 
00135     bool isInLocalSubdomain_;
00136 
00137   private:
00138     Record& operator=(const Record& src);
00139 
00140     int ID_;
00141     int number_;
00142 
00143     fei::FieldMask* fieldMask_;
00144 
00145     int offsetIntoEqnNumbers_;
00146 
00147     int ownerProc_;
00148 
00149     bool hasSlaveDof_;
00150   };
00151 
00153   struct record_lessthan {
00155     bool operator()(const Record* lhs,
00156         const Record* rhs) const
00157       {
00158   return( *lhs < *rhs );
00159       }
00160   };
00161 
00163   class Record_Operator {
00164   public:
00166     virtual ~Record_Operator(){}
00167 
00169     virtual void operator()(Record& record) = 0;
00170 
00171   };//class Record_Operator
00172 
00173 } //namespace fei
00174 
00175 #endif // _fei_Record_hpp_
00176 

Generated on Wed May 12 21:30:41 2010 for FEI by  doxygen 1.4.7