00001 #ifndef MOLECULELISTS_HH_ 00002 #define MOLECULELISTS_HH_ 00003 00004 00005 #include "../NFcore.hh" 00006 00007 namespace NFcore 00008 { 00009 class MoleculeType; 00010 class Molecule; 00011 00013 00022 class MoleculeList 00023 { 00024 public: 00025 00031 MoleculeList(MoleculeType *mt, int init_capacity, int finalCapacity); 00032 00038 ~MoleculeList(); 00039 00043 int size() const; 00044 00048 NFcore::Molecule *at(int index) const; 00049 00056 int create(Molecule *&m); 00057 00061 void remove(int listId, Molecule *m); 00062 00067 void removeLast(); 00068 00072 void printDetails(); 00073 00074 static const int NO_LIMIT = -1; 00075 00076 protected: 00077 00079 int n_molecules; 00080 00082 int lastAllocated; 00083 00085 int capacity; 00086 00088 int finalCapacity; 00089 00091 MoleculeType *mt; 00092 00094 Molecule **mArray; 00095 00097 int *molPos; 00098 }; 00099 00100 00101 } 00102 00103 00104 00105 00106 00107 #endif /*MOLECULELISTS_HH_*/