Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Examples  

LineFacetSet.h

Go to the documentation of this file.
00001 #ifndef LINEFACETSET_H
00002 #define LINEFACETSET_H
00003 
00004 #include "SundanceDefs.h"
00005 
00006 #include "FacetSetBase.h"
00007 #include "Pool.h"
00008 
00009 
00010 namespace Sundance
00011 {
00012 
00013   using namespace TSF;
00014 
00015   /** \ingroup LowLevelGeometry
00016    * Data structure containing the facet indices for a line cell
00017    */
00018 
00019   class LineFacetSet : public FacetSetBase
00020     {
00021     public:
00022       LineFacetSet(){;}
00023       virtual ~LineFacetSet(){;}
00024 
00025       virtual int numFacets(int /*facetDim*/) const {return 2;}
00026       virtual int facetIndex(int /*facetDim*/, int facetNum) const
00027         {return f_[facetNum];}
00028       virtual void setFacetIndex(int /*facetDim*/,
00029                                  int facetNum, int facetIndex)
00030         {f_[facetNum] = facetIndex;}
00031 
00032       virtual int byteCount() const {return sizeof(LineFacetSet);}
00033 #ifndef NO_POOLMEM
00034       static inline void* operator new(size_t s);
00035       static inline void operator delete(void* p, size_t s);
00036 #endif
00037     private:
00038       int f_[2];
00039 #ifndef NO_POOLMEM
00040       static Pool memPool_;
00041 #endif
00042     };
00043 
00044 #ifndef NO_POOLMEM
00045   inline void* LineFacetSet::operator new(size_t s)
00046     {
00047       if (s != sizeof(LineFacetSet))
00048         {
00049           return ::operator new(s);
00050         }
00051       return memPool_.alloc();
00052       //return ::operator new(s);
00053     }
00054 
00055   inline void LineFacetSet::operator delete(void* p, size_t s)
00056     {
00057       if (s != sizeof(LineFacetSet)) ::operator delete(p);
00058       else memPool_.free(p);
00059       //else ::operator delete(p);
00060     }
00061 #endif
00062 
00063 
00064 }
00065 #endif

Contact:
Kevin Long (krlong@ca.sandia.gov)


Documentation generated by