ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/BaseVisitor.hpp
Revision: 1118
Committed: Mon Apr 19 03:52:27 2004 UTC (20 years, 2 months ago) by tim
File size: 847 byte(s)
Log Message:
new implement of quickLate using visitor and composite pattern

File Contents

# Content
1 #ifndef _BASEVISITOR_H_
2 #define _BASEVISITOR_H_
3
4 #include <string>
5 using namespace std;
6
7 class SimInfo;
8 class Atom;
9 class DirectionalAtom;
10 class RigidBody;
11
12 class BaseVisitor{
13 public:
14 virtual ~BaseVisitor() {}
15 virtual void visit(Atom* atom) {}
16 virtual void visit(DirectionalAtom* datom) {}
17 virtual void visit(RigidBody* rb) {}
18
19 virtual void update() {}
20
21 const string& getVisitorName() {return visitorName;}
22 virtual const string toString() {
23 char buffer[65535];
24
25 sprintf(buffer,"------------------------------------------------------------------\n");
26 sprintf(buffer,"Visitor name: %s", visitorName.c_str());
27 sprintf(buffer,"------------------------------------------------------------------\n");
28
29 return buffer;
30 }
31
32 protected:
33 BaseVisitor() {}
34 string visitorName;
35 };
36
37 #endif

Properties

Name Value
svn:executable *