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;
32  class DynamicRemoteState;
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  protected:
50  virtual void visitLocalState(LocalStateCPtr localState) = 0;
51  virtual void visitRemoteState(RemoteStateCPtr remoteState) = 0;
52  virtual void visitEndState(EndStateCPtr endState) = 0;
53  virtual void visitDynamicRemoteState(DynamicRemoteStateCPtr dynamicRemoteState) = 0;
54  };
55 
56  using VisitorPtr = std::shared_ptr<Visitor>;
57  using VisitorCPtr = std::shared_ptr<const Visitor>;
58 }
armarx::statechartmodel::Visitor::visitRemoteState
virtual void visitRemoteState(RemoteStateCPtr remoteState)=0
armarx::statechartmodel::RemoteStateCPtr
std::shared_ptr< const RemoteState > RemoteStateCPtr
Definition: XmlWriter.h:51
armarx::statechartmodel::RemoteState
Definition: RemoteState.h:28
armarx::statechartmodel::Visitor::visitEndState
virtual void visitEndState(EndStateCPtr endState)=0
armarx::statechartmodel::DynamicRemoteStateCPtr
std::shared_ptr< const DynamicRemoteState > DynamicRemoteStateCPtr
Definition: DynamicRemoteState.h:41
armarx::statechartmodel::DynamicRemoteState
Definition: DynamicRemoteState.h:29
armarx::statechartmodel::VisitorPtr
std::shared_ptr< Visitor > VisitorPtr
Definition: Visitor.h:56
armarx::statechartmodel
Definition: XmlWriter.h:36
armarx::statechartmodel::VisitorCPtr
std::shared_ptr< const Visitor > VisitorCPtr
Definition: Visitor.h:57
armarx::statechartmodel::Visitor::visitLocalState
virtual void visitLocalState(LocalStateCPtr localState)=0
armarx::statechartmodel::Visitor
Definition: Visitor.h:39
armarx::statechartmodel::EndState
Definition: EndState.h:28
armarx::statechartmodel::LocalStateCPtr
std::shared_ptr< const LocalState > LocalStateCPtr
Definition: XmlWriter.h:50
armarx::statechartmodel::Visitor::visitDynamicRemoteState
virtual void visitDynamicRemoteState(DynamicRemoteStateCPtr dynamicRemoteState)=0
armarx::statechartmodel::LocalState
Definition: LocalState.h:31
armarx::statechartmodel::EndStateCPtr
std::shared_ptr< const EndState > EndStateCPtr
Definition: XmlWriter.h:52
armarx::statechartmodel::Visitor::~Visitor
virtual ~Visitor()
Definition: Visitor.h:47