ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-4/src/visitors/BaseVisitor.hpp
Revision: 1695
Committed: Mon Nov 1 22:52:57 2004 UTC (19 years, 9 months ago) by tim
File size: 1036 byte(s)
Log Message:
Molecule, Atom, DirectionalAtom, RigidBody and StuntDouble classes get compiled

File Contents

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

Properties

Name Value
svn:executable *