--- trunk/OOPSE-3.0/src/brains/BlockSnapshotManager.hpp 2005/02/15 19:36:07 2035 +++ trunk/OOPSE-3.0/src/brains/BlockSnapshotManager.hpp 2005/04/15 22:04:00 2204 @@ -45,81 +45,81 @@ class SimInfo; #include "brains/SnapshotManager.hpp" namespace oopse { -class SimInfo; -class DumpReader; + class SimInfo; + class DumpReader; -typedef std::pair SnapshotBlock; + typedef std::pair SnapshotBlock; -/** - * @class BlockSnapshotManager - * @todo document - */ -class BlockSnapshotManager : public SnapshotManager{ + /** + * @class BlockSnapshotManager + * @todo document + */ + class BlockSnapshotManager : public SnapshotManager{ - public: - BlockSnapshotManager(SimInfo* info, const std::string& filename, int storageLayout, int blockCapacity = 2); - ~BlockSnapshotManager(); + public: + BlockSnapshotManager(SimInfo* info, const std::string& filename, int storageLayout, int blockCapacity = 2); + ~BlockSnapshotManager(); - virtual Snapshot* getSnapshot(int id) { return snapshots_[id]; } + virtual Snapshot* getSnapshot(int id) { return snapshots_[id]; } - /** Returns number of snapshot blocks in this BlockSnapshotManager*/ - int getNBlocks() { - return blocks_.size(); - } + /** Returns number of snapshot blocks in this BlockSnapshotManager*/ + int getNBlocks() { + return blocks_.size(); + } - SnapshotBlock getSnapshotBlock(int block) { - return blocks_.at(block); - } + SnapshotBlock getSnapshotBlock(int block) { + return blocks_.at(block); + } - int getNActiveBlocks(); + int getNActiveBlocks(); - bool isBlockActive(int block) { - return findActiveBlock(block) != activeBlocks_.end() ? true : false; - } + bool isBlockActive(int block) { + return findActiveBlock(block) != activeBlocks_.end() ? true : false; + } - bool loadBlock(int block); + bool loadBlock(int block); - bool unloadBlock(int block); + bool unloadBlock(int block); - std::vector getActiveBlocks(); + std::vector getActiveBlocks(); - int getBlockCapacity() { - return blockCapacity_; - } + int getBlockCapacity() { + return blockCapacity_; + } - int getNFrames(); + int getNFrames(); - private: + private: - std::vector::iterator findActiveBlock(int block) { - return std::find(activeBlocks_.begin(), activeBlocks_.end(), block); - } + std::vector::iterator findActiveBlock(int block) { + return std::find(activeBlocks_.begin(), activeBlocks_.end(), block); + } - bool hasZeroRefBlock(); + bool hasZeroRefBlock(); - int getFirstZeroRefBlock(); + int getFirstZeroRefBlock(); - void internalLoad(int block); - void internalUnload(int block); - Snapshot* loadFrame(int frame); + void internalLoad(int block); + void internalUnload(int block); + Snapshot* loadFrame(int frame); - SimInfo* info_; - int blockCapacity_; + SimInfo* info_; + int blockCapacity_; - std::vector snapshots_; - std::vector blocks_; - std::vector activeBlocks_; - std::vector activeRefCount_; + std::vector snapshots_; + std::vector blocks_; + std::vector activeBlocks_; + std::vector activeRefCount_; - int nAtoms_; - int nRigidBodies_; + int nAtoms_; + int nRigidBodies_; - DumpReader* reader_; - int nframes_; - int nSnapshotPerBlock_; + DumpReader* reader_; + int nframes_; + int nSnapshotPerBlock_; -}; + }; }