StateInstanceFactory.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 "../../StatechartViewerPlugin/model/stateinstance/StateInstance.h"
26 
29 
30 
32 {
33  using XmlParentPair = std::pair<rapidxml::xml_node<>*, armarx::statechartmodel::StatePtr>;
34 
35  class StateInstanceFactoryBase : public AbstractFactoryMethod<StateInstanceFactoryBase, XmlParentPair>
36  {
37  public:
40 
42 
43  protected:
46  };
47 
48  using StateInstanceFactoryBasePtr = std::shared_ptr<StateInstanceFactoryBase>;
49 
51  {
52  public:
54 
56 
58  static std::string getName()
59  {
60  return "EndState";
61  }
62 
63  private:
64  static SubClassRegistry registry;
65  };
66 
68  {
69  public:
71 
73 
75  static std::string getName()
76  {
77  return "LocalState";
78  }
79 
80  private:
81  static SubClassRegistry registry;
82  };
83 
85  {
86  public:
88 
90 
92  static std::string getName()
93  {
94  return "RemoteState";
95  }
96 
97  private:
98  static SubClassRegistry registry;
99  };
100 
102  {
103  public:
105 
107 
109  static std::string getName()
110  {
111  return "DynamicRemoteState";
112  }
113 
114  private:
115  static SubClassRegistry registry;
116  };
117 }
armarx::statechartio::RemoteStateInstanceFactory
Definition: StateInstanceFactory.h:84
armarx::AbstractFactoryMethod
A template that can be used as a superclass of a class hierarchy that wants to provide a factory meth...
Definition: AbstractFactoryMethod.h:46
armarx::statechartio
Definition: StateInstanceFactory.h:31
armarx::statechartio::StateInstanceFactoryBase::xmlNode
rapidxml::xml_node * xmlNode
Definition: StateInstanceFactory.h:44
armarx::statechartio::EndStateInstanceFactory
Definition: StateInstanceFactory.h:50
armarx::statechartio::DynamicRemoteStateInstanceFactory::getStateInstance
armarx::statechartmodel::StateInstancePtr getStateInstance() override
Definition: StateInstanceFactory.cpp:133
armarx::statechartio::LocalStateInstanceFactory
Definition: StateInstanceFactory.h:67
armarx::statechartio::DynamicRemoteStateInstanceFactory::DynamicRemoteStateInstanceFactory
DynamicRemoteStateInstanceFactory(rapidxml::xml_node<> *xmlNode, armarx::statechartmodel::StatePtr parentState)
Definition: StateInstanceFactory.cpp:130
armarx::statechartio::LocalStateInstanceFactory::getName
static std::string getName()
Definition: StateInstanceFactory.h:75
armarx::statechartmodel::StateInstancePtr
std::shared_ptr< StateInstance > StateInstancePtr
Definition: StateInstance.h:138
armarx::statechartio::RemoteStateInstanceFactory::createInstance
static StateInstanceFactoryBasePtr createInstance(XmlParentPair)
Definition: StateInstanceFactory.cpp:123
armarx::statechartio::EndStateInstanceFactory::createInstance
static StateInstanceFactoryBasePtr createInstance(XmlParentPair)
Definition: StateInstanceFactory.cpp:80
armarx::statechartio::LocalStateInstanceFactory::createInstance
static StateInstanceFactoryBasePtr createInstance(XmlParentPair)
Definition: StateInstanceFactory.cpp:101
armarx::statechartio::DynamicRemoteStateInstanceFactory
Definition: StateInstanceFactory.h:101
armarx::statechartio::DynamicRemoteStateInstanceFactory::createInstance
static StateInstanceFactoryBasePtr createInstance(XmlParentPair)
Definition: StateInstanceFactory.cpp:144
armarx::statechartio::StateInstanceFactoryBase::~StateInstanceFactoryBase
virtual ~StateInstanceFactoryBase()
Definition: StateInstanceFactory.h:39
armarx::statechartio::LocalStateInstanceFactory::getStateInstance
armarx::statechartmodel::StateInstancePtr getStateInstance() override
Definition: StateInstanceFactory.cpp:89
armarx::statechartio::LocalStateInstanceFactory::LocalStateInstanceFactory
LocalStateInstanceFactory(rapidxml::xml_node<> *xmlNode, armarx::statechartmodel::StatePtr parentState)
Definition: StateInstanceFactory.cpp:86
armarx::statechartio::DynamicRemoteStateInstanceFactory::getName
static std::string getName()
Definition: StateInstanceFactory.h:109
armarx::statechartio::RemoteStateInstanceFactory::getStateInstance
armarx::statechartmodel::StateInstancePtr getStateInstance() override
Definition: StateInstanceFactory.cpp:110
armarx::statechartio::StateInstanceFactoryBasePtr
std::shared_ptr< StateInstanceFactoryBase > StateInstanceFactoryBasePtr
Definition: StateInstanceFactory.h:48
rapidxml::xml_node
Class representing a node of XML document.
Definition: rapidxml.hpp:138
armarx::statechartio::StateInstanceFactoryBase::StateInstanceFactoryBase
StateInstanceFactoryBase(rapidxml::xml_node<> *xmlNode, armarx::statechartmodel::StatePtr parentState)
Definition: StateInstanceFactory.cpp:61
armarx::statechartmodel::StatePtr
std::shared_ptr< State > StatePtr
Definition: State.h:46
armarx::statechartio::StateInstanceFactoryBase
Definition: StateInstanceFactory.h:35
armarx::statechartio::EndStateInstanceFactory::getStateInstance
armarx::statechartmodel::StateInstancePtr getStateInstance() override
Definition: StateInstanceFactory.cpp:68
armarx::statechartio::EndStateInstanceFactory::getName
static std::string getName()
Definition: StateInstanceFactory.h:58
AbstractFactoryMethod.h
armarx::statechartio::XmlParentPair
std::pair< rapidxml::xml_node<> *, armarx::statechartmodel::StatePtr > XmlParentPair
Definition: StateInstanceFactory.h:33
rapidxml.hpp
armarx::statechartio::RemoteStateInstanceFactory::getName
static std::string getName()
Definition: StateInstanceFactory.h:92
armarx::statechartio::StateInstanceFactoryBase::getStateInstance
virtual armarx::statechartmodel::StateInstancePtr getStateInstance()=0
armarx::statechartio::StateInstanceFactoryBase::parentState
armarx::statechartmodel::StatePtr parentState
Definition: StateInstanceFactory.h:45
armarx::statechartio::RemoteStateInstanceFactory::RemoteStateInstanceFactory
RemoteStateInstanceFactory(rapidxml::xml_node<> *xmlNode, armarx::statechartmodel::StatePtr parentState)
Definition: StateInstanceFactory.cpp:107
armarx::statechartio::EndStateInstanceFactory::EndStateInstanceFactory
EndStateInstanceFactory(rapidxml::xml_node<> *xmlNode, armarx::statechartmodel::StatePtr parentState)
Definition: StateInstanceFactory.cpp:65