Ignore:
Timestamp:
Oct 9, 2009, 10:54:52 AM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
3efb4a
Parents:
70b7aa
Message:

forward declarations used to untangle interdependet classes.

  • basically, everywhere in header files we removed '#include' lines were only pointer to the respective classes were used and the include line was moved to the implementation file.
  • as a sidenote, lots of funny errors happened because headers were included via a nesting over three other includes. Now, all should be declared directly as needed, as only very little include lines remain in header files.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/parser.hpp

    r70b7aa r17b3a5c  
    1 /** \file parsing.hpp
     1/** \file parser.hpp
    22 *
    33 * Definitions of various class functions for the parsing of value files.
     
    66
    77
    8 #ifndef PARSING_HPP_
    9 #define PARSING_HPP_
     8#ifndef PARSER_HPP_
     9#define PARSER_HPP_
    1010
    1111using namespace std;
     12
     13/*********************************************** includes ***********************************/
    1214
    1315// include config.h
     
    1618#endif
    1719
    18 // ======================================= DEFINES ==========================================
     20/****************************************** forward declarations *****************************/
     21
     22class EnergyMatrix;
     23class ForceMatrix;
     24class HessianMatrix;
     25class KeySetsContainer;
     26class MatrixContainer;
     27
     28/********************************************** definitions *********************************/
    1929
    2030#define EnergySuffix ".energy.all"
     
    4252bool TestParams(int argc, char **argv);
    4353
     54// ======================================= CLASS KeySetsContainer =============================
     55
     56class KeySetsContainer {
     57  public:
     58    int **KeySets;
     59    int *AtomCounter;
     60    int FragmentCounter;
     61    int Order;
     62    int *FragmentsPerOrder;
     63    int **OrderSet;
     64
     65  KeySetsContainer();
     66  ~KeySetsContainer();
     67
     68  bool ParseKeySets(const char *name, const int *ACounter, const int FCounter);
     69  bool ParseManyBodyTerms();
     70  bool Contains(const int GreaterSet, const int SmallerSet);
     71};
    4472
    4573// ======================================= CLASS MatrixContainer =============================
     
    6896  //bool ParseIndices();
    6997  //bool SumSubValues();
    70   bool SumSubManyBodyTerms(class MatrixContainer &Matrix, class KeySetsContainer &KeySet, int Order);
     98  bool SumSubManyBodyTerms(class MatrixContainer &Matrix, class KeySetsContainer &KeySets, int Order);
    7199  bool WriteTotalFragments(const char *name, const char *prefix);
    72100  bool WriteLastMatrix(const char *name, const char *prefix, const char *suffix);
     
    78106  public:
    79107    bool ParseIndices();
    80     bool SumSubEnergy(class EnergyMatrix &Fragments, class EnergyMatrix *CorrectionFragments, class KeySetsContainer &KeySet, int Order, double sign);
     108    bool SumSubEnergy(class EnergyMatrix &Fragments, class EnergyMatrix *CorrectionFragments, class KeySetsContainer &KeySets, int Order, double sign);
    81109    bool ParseFragmentMatrix(const char *name, const char *prefix, string suffix, int skiplines, int skipcolumns);
    82110};
     
    87115  public:
    88116    bool ParseIndices(const char *name);
    89     bool SumSubForces(class ForceMatrix &Fragments, class KeySetsContainer &KeySet, int Order, double sign);
     117    bool SumSubForces(class ForceMatrix &Fragments, class KeySetsContainer &KeySets, int Order, double sign);
    90118    bool ParseFragmentMatrix(const char *name, const char *prefix, string suffix, int skiplines, int skipcolumns);
    91119};
     
    98126    //~HessianMatrix();
    99127    bool ParseIndices(char *name);
    100     bool SumSubManyBodyTerms(class MatrixContainer &MatrixValues, class KeySetsContainer &KeySet, int Order);
    101     bool SumSubHessians(class HessianMatrix &Fragments, class KeySetsContainer &KeySet, int Order, double sign);
     128    bool SumSubManyBodyTerms(class MatrixContainer &MatrixValues, class KeySetsContainer &KeySets, int Order);
     129    bool SumSubHessians(class HessianMatrix &Fragments, class KeySetsContainer &KeySets, int Order, double sign);
    102130    bool ParseFragmentMatrix(const char *name, const char *prefix, string suffix, int skiplines, int skipcolumns);
    103131  private:
     
    105133};
    106134
    107 // ======================================= CLASS KeySetsContainer =============================
    108 
    109 class KeySetsContainer {
    110   public:
    111     int **KeySets;
    112     int *AtomCounter;
    113     int FragmentCounter;
    114     int Order;
    115     int *FragmentsPerOrder;
    116     int **OrderSet;
    117 
    118   KeySetsContainer();
    119   ~KeySetsContainer();
    120 
    121   bool ParseKeySets(const char *name, const int *ACounter, const int FCounter);
    122   bool ParseManyBodyTerms();
    123   bool Contains(const int GreaterSet, const int SmallerSet);
    124 };
    125135
    126136// ======================================= END =============================================
    127137
    128 #endif /*PARSING_HPP_*/
     138#endif /*PARSER_HPP_*/
Note: See TracChangeset for help on using the changeset viewer.