fei_SharedIDs.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_SharedIDs_hpp_
00010 #define _fei_SharedIDs_hpp_
00011 
00012 #include <fei_macros.hpp>
00013 #include <snl_fei_RaggedTable.hpp>
00014 
00015 #include <vector>
00016 #include <map>
00017 
00018 namespace fei {
00020   class SharedIDs {
00021   public:
00023     SharedIDs()
00024       : sharedIDs_(-1,-1), owningProcs_() { owningProcs_.reserve(128); }
00025 
00027     SharedIDs(const SharedIDs& src)
00028       : sharedIDs_(src.sharedIDs_), owningProcs_(src.owningProcs_) {}
00029 
00031     virtual ~SharedIDs() {}
00032 
00034     typedef snl_fei::RaggedTable<std::map<int,fei::ctg_set<int>*>,fei::ctg_set<int> >
00035       table_type;
00036 
00038     int addSharedID(int ID, int numSharingProcs, const int* sharingProcs)
00039       {
00040   sharedIDs_.addIndices(ID, numSharingProcs, sharingProcs);
00041   return(0);
00042       }
00043 
00045     table_type& getSharedIDs() { return( sharedIDs_ ); }
00046 
00049     std::vector<int>& getOwningProcs() { return( owningProcs_ ); }
00050 
00051   private:
00052     table_type sharedIDs_;
00053     std::vector<int> owningProcs_;
00054   };
00055 
00056 } //namespace fei
00057 
00058 #endif // _fei_SharedIDs_hpp_
00059 

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