ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-1.0/libmdtools/BaseVisitor.hpp
Revision: 1334
Committed: Fri Jul 16 18:58:03 2004 UTC (19 years, 11 months ago) by gezelter
File size: 989 byte(s)
Log Message:
Initial import of OOPSE-1.0 source tree

File Contents

# User Rev Content
1 gezelter 1334 #ifndef _BASEVISITOR_H_
2     #define _BASEVISITOR_H_
3     #include <iostream>
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     string result;
24     char buffer[65535];
25    
26     sprintf(buffer,"------------------------------------------------------------------\n");
27     result += buffer;
28    
29     sprintf(buffer, "Visitor name: %s\n", visitorName.c_str());
30     result += buffer;
31    
32     sprintf(buffer, "------------------------------------------------------------------\n");
33     result += buffer;
34    
35     return result;
36     }
37    
38     protected:
39     BaseVisitor() {}
40     string visitorName;
41     };
42    
43     #endif

Properties

Name Value
svn:executable *