ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-3.0/src/visitors/BaseVisitor.hpp
Revision: 1818
Committed: Wed Dec 1 20:05:49 2004 UTC (19 years, 9 months ago) by tim
File size: 1040 byte(s)
Log Message:
visitors get built

File Contents

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

Properties

Name Value
svn:executable *