FEI Version of the Day
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 snl_fei {
00017   class RecordCollection;
00018 }
00019 
00020 namespace fei {
00021 
00029   class Pattern {
00030   public:
00032     enum PatternType { NO_FIELD, SIMPLE, SINGLE_IDTYPE, GENERAL };
00033 
00035     Pattern(int numIDs, int idType, snl_fei::RecordCollection* records);
00036 
00040     Pattern(int numIDs, int idType, snl_fei::RecordCollection* records,
00041       int fieldID, int fieldSize);
00042 
00046     Pattern(int numIDs, int idType, snl_fei::RecordCollection* records,
00047       const int* numFieldsPerID,
00048       const int* fieldIDs, const int* fieldSizes);
00049 
00053     Pattern(int numIDs, const int* idTypes, snl_fei::RecordCollection*const* records,
00054       const int* numFieldsPerID,
00055       const int* fieldIDs, const int* fieldSizes);
00056 
00057     virtual ~Pattern();
00058 
00061     PatternType getPatternType() const { return( type_ ); }
00062 
00064     int getNumIDs() const { return( numIDs_ ); }
00065 
00067     const int* getIDTypes() const { return( idTypes_ ); }
00068 
00070     snl_fei::RecordCollection*const* getRecordCollections() const { return &recordCollections_[0]; }
00071 
00073     const int* getNumFieldsPerID() const { return( numFieldsPerID_ ); }
00074 
00076     const int* getFieldIDs() const { return( fieldIDs_ ); }
00077 
00079     const int* getNumIndicesPerID() const
00080     {
00081       return( numIndicesPerID_ );
00082     }
00083 
00085     int getTotalNumFields() const { return( totalNumFields_ ); }
00086 
00092     int getNumIndices() const { return( numIndices_ ); }
00093 
00096     bool operator==(const Pattern& rhs) const;
00097 
00100     bool operator!=(const Pattern& rhs) const;
00101 
00102   private:
00103     PatternType type_;
00104     int numIDs_;
00105     int totalNumFields_;
00106     int numIndices_;
00107     std::vector<int> data_;
00108     std::vector<snl_fei::RecordCollection*> recordCollections_;
00109 
00110     const int* idTypes_;
00111     const int* numFieldsPerID_;
00112     const int* fieldIDs_;
00113     const int* numIndicesPerID_;
00114   };
00115 
00116 } //namespace fei
00117 
00118 #endif // _fei_Pattern_hpp_
00119 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends