-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMPI_ElementVisitor.h
39 lines (28 loc) · 1019 Bytes
/
MPI_ElementVisitor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//
// MPI_ElementVisitor.h
//
// Description:
// Visitor for MPI_OneSpaceElement objects
//
#ifndef __MPI_ELEMENTVISITOR_H__
#define __MPI_ELEMENTVISITOR_H__
class MPI_OneSpaceElement;
class MPI_IntersectionElement;
class MPI_PoweredElement;
class MPI_TrainElement;
class MPI_ElementVisitor
{
public:
virtual ~MPI_ElementVisitor() {};
// one entry here for each thing you can visit
virtual void visitOneSpaceElement( MPI_OneSpaceElement& element ) {};
virtual void visitIntersectionElement( MPI_IntersectionElement& element ) {};
virtual void visitPoweredElement( MPI_PoweredElement& element ) {};
virtual void visitTrainElement( MPI_TrainElement& element ) {};
// NB: we don't provide const versions of these methods since if we allowed
// const visitor objects, each element would have to implement four accept
// methods: const/non-const visitor, const/non-const element.
// Easier to just make all element visitors non-const.
};
#endif
// vim:sw=4:et:cindent: