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/molecule.hpp

    r70b7aa r17b3a5c  
    88
    99using namespace std;
     10
     11/*********************************************** includes ***********************************/
    1012
    1113// GSL headers
     
    2527#include <vector>
    2628
    27 #include "atom.hpp"
    28 #include "bond.hpp"
    29 #include "element.hpp"
    30 #include "leastsquaremin.hpp"
    31 #include "linkedcell.hpp"
    32 #include "parser.hpp"
    33 #include "periodentafel.hpp"
     29#include "graph.hpp"
    3430#include "stackclass.hpp"
    3531#include "tesselation.hpp"
    36 #include "vector.hpp"
    37 
     32
     33/****************************************** forward declarations *****************************/
     34
     35class atom;
     36class bond;
     37class element;
     38class ForceMatrix;
     39class LinkedCell;
    3840class molecule;
    3941class MoleculeLeafClass;
    4042class MoleculeListClass;
     43class periodentafel;
     44class Vector;
    4145
    4246/******************************** Some definitions for easier reading **********************************/
    43 
    44 #define KeyStack deque<int>
    45 #define KeySet set<int>
    46 #define NumberValuePair pair<int, double>
    47 #define Graph map <KeySet, NumberValuePair, KeyCompare >
    48 #define GraphPair pair <KeySet, NumberValuePair >
    49 #define KeySetTestPair pair<KeySet::iterator, bool>
    50 #define GraphTestPair pair<Graph::iterator, bool>
    5147
    5248#define MoleculeList list <molecule *>
     
    5652#define DistanceMap multimap < double, atom* >
    5753#define DistanceTestPair pair < DistanceMap::iterator, bool>
    58 
    59 
    60 //#define LinkedAtoms list <atom *>
    61 
    62 /******************************** Some small functions and/or structures **********************************/
    63 
    64 struct KeyCompare
    65 {
    66   bool operator() (const KeySet SubgraphA, const KeySet SubgraphB) const;
    67 };
    68 
    69 //bool operator < (KeySet SubgraphA, KeySet SubgraphB);   //note: this declaration is important, otherwise normal < is used (producing wrong order)
    70 inline void InsertFragmentIntoGraph(ofstream *out, struct UniqueFragments *Fragment); // Insert a KeySet into a Graph
    71 inline void InsertGraphIntoGraph(ofstream *out, Graph &graph1, Graph &graph2, int *counter);  // Insert all KeySet's in a Graph into another Graph
    72 int CompareDoubles (const void * a, const void * b);
    7354
    7455
     
    214195  void SetNameFromFilename(const char *filename);
    215196  void SetBoxDimension(Vector *dim);
    216   double * ReturnFullMatrixforSymmetric(double *cell_size);
    217197  void ScanForPeriodicCorrection(ofstream *out);
    218198  bool VerletForceIntegration(ofstream *out, char *file, config &configuration);
Note: See TracChangeset for help on using the changeset viewer.