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
00016
00017
00018
00019 class LineFacetSet : public FacetSetBase
00020 {
00021 public:
00022 LineFacetSet(){;}
00023 virtual ~LineFacetSet(){;}
00024
00025 virtual int numFacets(int ) const {return 2;}
00026 virtual int facetIndex(int , int facetNum) const
00027 {return f_[facetNum];}
00028 virtual void setFacetIndex(int ,
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
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
00060 }
00061 #endif
00062
00063
00064 }
00065 #endif