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

File Contents

# Content
1 #ifndef _BASEVISITOR_H_
2 #define _BASEVISITOR_H_
3 #include <iostream>
4 #include <string>
5
6 namespace oopse {
7
8 class Atom;
9 class DirectionalAtom;
10 class RigidBody;
11 class SimInfo;
12
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 const std::string& getVisitorName() {return visitorName;}
23 virtual const std::string toString() {
24 std::string result;
25 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
41 BaseVisitor() {}
42
43 std::string visitorName;
44 };
45
46 }//end namespace oopse
47 #endif

Properties

Name Value
svn:executable *