Visitor.h
Go to the documentation of this file.
1/*
2* This file is part of ArmarX.
3*
4* ArmarX is free software; you can redistribute it and/or modify
5* it under the terms of the GNU General Public License version 2 as
6* published by the Free Software Foundation.
7*
8* ArmarX is distributed in the hope that it will be useful, but
9* WITHOUT ANY WARRANTY; without even the implied warranty of
10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11* GNU General Public License for more details.
12*
13* You should have received a copy of the GNU General Public License
14* along with this program. If not, see <http://www.gnu.org/licenses/>.
15*
16* @package ArmarX::
17* @author Christian Mandery (christian.mandery at kit dot edu)
18* @date 2014
19* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20* GNU General Public License
21*/
22
23#pragma once
24
25#include <memory>
26
28{
29 class LocalState;
30 class RemoteState;
31 class EndState;
33
34 using LocalStateCPtr = std::shared_ptr<const LocalState>;
35 using RemoteStateCPtr = std::shared_ptr<const RemoteState>;
36 using EndStateCPtr = std::shared_ptr<const EndState>;
37 using DynamicRemoteStateCPtr = std::shared_ptr<const DynamicRemoteState>;
38
39 class Visitor
40 {
41 friend class LocalState;
42 friend class RemoteState;
43 friend class EndState;
44 friend class DynamicRemoteState;
45
46 public:
47 virtual ~Visitor()
48 {
49 }
50
51 protected:
52 virtual void visitLocalState(LocalStateCPtr localState) = 0;
53 virtual void visitRemoteState(RemoteStateCPtr remoteState) = 0;
54 virtual void visitEndState(EndStateCPtr endState) = 0;
55 virtual void visitDynamicRemoteState(DynamicRemoteStateCPtr dynamicRemoteState) = 0;
56 };
57
58 using VisitorPtr = std::shared_ptr<Visitor>;
59 using VisitorCPtr = std::shared_ptr<const Visitor>;
60} // namespace armarx::statechartmodel
virtual void visitEndState(EndStateCPtr endState)=0
virtual void visitRemoteState(RemoteStateCPtr remoteState)=0
virtual void visitLocalState(LocalStateCPtr localState)=0
virtual void visitDynamicRemoteState(DynamicRemoteStateCPtr dynamicRemoteState)=0
std::shared_ptr< const Visitor > VisitorCPtr
Definition Visitor.h:59
std::shared_ptr< const LocalState > LocalStateCPtr
Definition XmlWriter.h:50
std::shared_ptr< const EndState > EndStateCPtr
Definition XmlWriter.h:52
std::shared_ptr< Visitor > VisitorPtr
Definition Visitor.h:58
std::shared_ptr< const DynamicRemoteState > DynamicRemoteStateCPtr
std::shared_ptr< const RemoteState > RemoteStateCPtr
Definition XmlWriter.h:51