FEI  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
fei_Pattern.hpp
1 /*--------------------------------------------------------------------*/
2 /* Copyright 2005 Sandia Corporation. */
3 /* Under the terms of Contract DE-AC04-94AL85000, there is a */
4 /* non-exclusive license for use of this work by or on behalf */
5 /* of the U.S. Government. Export of this program may require */
6 /* a license from the United States Government. */
7 /*--------------------------------------------------------------------*/
8 
9 #ifndef _fei_Pattern_hpp_
10 #define _fei_Pattern_hpp_
11 
12 #include "fei_macros.hpp"
13 
14 #include <vector>
15 
16 namespace snl_fei {
17  class RecordCollection;
18 }
19 
20 namespace fei {
21 
29  class Pattern {
30  public:
32  enum PatternType { NO_FIELD, SIMPLE, SINGLE_IDTYPE, GENERAL };
33 
35  Pattern(int numIDs, int idType, snl_fei::RecordCollection* records);
36 
40  Pattern(int numIDs, int idType, snl_fei::RecordCollection* records,
41  int fieldID, int fieldSize);
42 
46  Pattern(int numIDs, int idType, snl_fei::RecordCollection* records,
47  const int* numFieldsPerID,
48  const int* fieldIDs, const int* fieldSizes);
49 
53  Pattern(int numIDs, const int* idTypes, snl_fei::RecordCollection*const* records,
54  const int* numFieldsPerID,
55  const int* fieldIDs, const int* fieldSizes);
56 
57  virtual ~Pattern();
58 
61  PatternType getPatternType() const { return( type_ ); }
62 
64  int getNumIDs() const { return( numIDs_ ); }
65 
67  const int* getIDTypes() const { return( idTypes_ ); }
68 
70  snl_fei::RecordCollection*const* getRecordCollections() const { return &recordCollections_[0]; }
71 
73  const int* getNumFieldsPerID() const { return( numFieldsPerID_ ); }
74 
76  const int* getFieldIDs() const { return( fieldIDs_ ); }
77 
79  const int* getNumIndicesPerID() const
80  {
81  return( numIndicesPerID_ );
82  }
83 
85  int getTotalNumFields() const { return( totalNumFields_ ); }
86 
92  int getNumIndices() const { return( numIndices_ ); }
93 
96  bool operator==(const Pattern& rhs) const;
97 
100  bool operator!=(const Pattern& rhs) const;
101 
102  private:
103  PatternType type_;
104  int numIDs_;
105  int totalNumFields_;
106  int numIndices_;
107  std::vector<int> data_;
108  std::vector<snl_fei::RecordCollection*> recordCollections_;
109 
110  const int* idTypes_;
111  const int* numFieldsPerID_;
112  const int* fieldIDs_;
113  const int* numIndicesPerID_;
114  };
115 
116 } //namespace fei
117 
118 #endif // _fei_Pattern_hpp_
119 
bool operator==(const Pattern &rhs) const
snl_fei::RecordCollection *const * getRecordCollections() const
const int * getIDTypes() const
int getNumIndices() const
const int * getNumFieldsPerID() const
const int * getFieldIDs() const
int getTotalNumFields() const
PatternType getPatternType() const
const int * getNumIndicesPerID() const
int getNumIDs() const
Pattern(int numIDs, int idType, snl_fei::RecordCollection *records)
Definition: fei_Pattern.cpp:12
bool operator!=(const Pattern &rhs) const