ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/brains/BlockSnapshotManager.hpp
(Generate patch)

Comparing trunk/src/brains/BlockSnapshotManager.hpp (file contents):
Revision 351 by tim, Tue Feb 15 19:36:07 2005 UTC vs.
Revision 1106 by gezelter, Fri Dec 29 21:57:10 2006 UTC

# Line 45 | Line 45 | namespace oopse {
45   #include "brains/SnapshotManager.hpp"
46   namespace oopse {
47  
48 < class SimInfo;
49 < class DumpReader;
48 >  class SimInfo;
49 >  class DumpReader;
50  
51 < typedef std::pair<int, int> SnapshotBlock;
51 >  typedef std::pair<int, int> SnapshotBlock;
52  
53 < /**
54 < * @class BlockSnapshotManager
55 < * @todo document
56 < */
57 < class BlockSnapshotManager : public SnapshotManager{
53 >  /**
54 >   * @class BlockSnapshotManager
55 >   * @todo document
56 >   */
57 >  class BlockSnapshotManager : public SnapshotManager{
58  
59 <    public:
60 <        BlockSnapshotManager(SimInfo* info, const std::string& filename, int storageLayout, int blockCapacity = 2);
61 <        ~BlockSnapshotManager();
59 >  public:
60 >    BlockSnapshotManager(SimInfo* info, const std::string& filename, int storageLayout, int blockCapacity = 2);
61 >    ~BlockSnapshotManager();
62          
63 <        virtual Snapshot* getSnapshot(int id) { return snapshots_[id]; }
63 >    virtual Snapshot* getSnapshot(int id) { return snapshots_[id]; }
64  
65 <        /** Returns number of snapshot blocks in this BlockSnapshotManager*/
66 <        int getNBlocks() {
67 <            return blocks_.size();
68 <        }
65 >    /** Returns number of snapshot blocks in this BlockSnapshotManager*/
66 >    int getNBlocks() {
67 >      return blocks_.size();
68 >    }
69  
70 <        SnapshotBlock getSnapshotBlock(int block) {
71 <            return blocks_.at(block);
72 <        }
70 >    SnapshotBlock getSnapshotBlock(int block) {
71 >      return blocks_.at(block);
72 >    }
73          
74 <        int getNActiveBlocks();
75 <        
74 >    int getNActiveBlocks();
75  
76 <        bool isBlockActive(int block) {
78 <            return  findActiveBlock(block) != activeBlocks_.end() ? true : false;
79 <        }        
76 >    void needCOMprops(bool ncp);
77  
78 <        bool loadBlock(int block);
78 >
79 >    bool isBlockActive(int block) {
80 >      return  findActiveBlock(block) != activeBlocks_.end() ? true : false;
81 >    }        
82 >
83 >    bool loadBlock(int block);
84          
85 <        bool unloadBlock(int block);
85 >    bool unloadBlock(int block);
86  
87 <        std::vector<int> getActiveBlocks();
87 >    std::vector<int> getActiveBlocks();
88  
89 <        int getBlockCapacity() {
90 <            return blockCapacity_;                
91 <        }
89 >    int getBlockCapacity() {
90 >      return blockCapacity_;                
91 >    }
92  
93 <        int getNFrames();
93 >    int getNFrames();
94          
95 <    private:
95 >  private:
96  
97 <        std::vector<int>::iterator findActiveBlock(int block) {
98 <            return std::find(activeBlocks_.begin(), activeBlocks_.end(), block);
99 <        }
97 >    std::vector<int>::iterator findActiveBlock(int block) {
98 >      return std::find(activeBlocks_.begin(), activeBlocks_.end(), block);
99 >    }
100  
101 <        bool hasZeroRefBlock();
101 >    bool hasZeroRefBlock();
102  
103 <        int getFirstZeroRefBlock();
103 >    int getFirstZeroRefBlock();
104  
105 <        void internalLoad(int block);
106 <        void internalUnload(int block);
107 <        Snapshot* loadFrame(int frame);
105 >    void internalLoad(int block);
106 >    void internalUnload(int block);
107 >    Snapshot* loadFrame(int frame);
108          
109 <        SimInfo* info_;
110 <        int blockCapacity_;
109 >    SimInfo* info_;
110 >    int blockCapacity_;
111  
112 <        std::vector<Snapshot*> snapshots_;
113 <        std::vector<SnapshotBlock> blocks_;        
114 <        std::vector<int> activeBlocks_;
115 <        std::vector<int> activeRefCount_;
112 >    std::vector<Snapshot*> snapshots_;
113 >    std::vector<SnapshotBlock> blocks_;        
114 >    std::vector<int> activeBlocks_;
115 >    std::vector<int> activeRefCount_;
116          
117 <        int nAtoms_;
118 <        int nRigidBodies_;
117 >    int nAtoms_;
118 >    int nRigidBodies_;
119      
120 <        DumpReader* reader_;
121 <        int nframes_;
122 <        int nSnapshotPerBlock_;
120 >    DumpReader* reader_;
121 >    int nframes_;
122 >    int nSnapshotPerBlock_;
123  
124 < };
124 >  };
125  
126   }
127  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines