fei_Pattern.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_Pattern_hpp_
00010 #define _fei_Pattern_hpp_
00011 
00012 #include "fei_macros.hpp"
00013 
00014 #include <vector>
00015 
00016 namespace fei {
00017 
00025   class Pattern {
00026   public:
00028     enum PatternType { NO_FIELD, SIMPLE, SINGLE_IDTYPE, GENERAL };
00029 
00031     Pattern(int numIDs, int idType);
00032 
00036     Pattern(int numIDs, int idType,
00037       int fieldID, int fieldSize);
00038 
00042     Pattern(int numIDs, int idType,
00043       const int* numFieldsPerID,
00044       const int* fieldIDs, const int* fieldSizes);
00045 
00049     Pattern(int numIDs, const int* idTypes,
00050       const int* numFieldsPerID,
00051       const int* fieldIDs, const int* fieldSizes);
00052 
00053     virtual ~Pattern();
00054 
00057     PatternType getPatternType() const { return( type_ ); }
00058 
00060     int getNumIDs() const { return( numIDs_ ); }
00061 
00063     const int* getIDTypes() const { return( idTypes_ ); }
00064 
00066     const int* getNumFieldsPerID() const { return( numFieldsPerID_ ); }
00067 
00069     const int* getFieldIDs() const { return( fieldIDs_ ); }
00070 
00072     const int* getNumIndicesPerID() const
00073       {
00074   return( numIndicesPerID_ );
00075       }
00076 
00078     int getTotalNumFields() const { return( totalNumFields_ ); }
00079 
00085     int getNumIndices() const { return( numIndices_ ); }
00086 
00089     bool operator==(const Pattern& rhs) const;
00090 
00093     bool operator!=(const Pattern& rhs) const;
00094 
00095   private:
00096     PatternType type_;
00097     int numIDs_;
00098     int totalNumFields_;
00099     int numIndices_;
00100     std::vector<int> data_;
00101 
00102     const int* idTypes_;
00103     const int* numFieldsPerID_;
00104     const int* fieldIDs_;
00105     const int* numIndicesPerID_;
00106   };
00107 
00108 } //namespace fei
00109 
00110 #endif // _fei_Pattern_hpp_
00111 

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