GroupXmlReader.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5  *
6  * ArmarX is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * ArmarX is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * @package
19  * @author
20  * @date
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 
25 #pragma once
26 
28 
30 #include "../StateBase.h"
32 
33 #include <filesystem>
34 
35 
36 namespace armarx
37 {
39  {
40  public:
42  {
45  };
46 
47  StatechartGroupXmlReader(const StatechartProfilePtr& selectedProfile);
48 
49  void readXml(const std::filesystem::path& groupDefinitionFile);
50  //void readXml(const std::string &groupDefinitionXMLString);
51  void readXml(RapidXmlReaderPtr reader);
52 
53  std::filesystem::path getGroupDefinitionFilePath() const;
54  std::string getGroupName() const
55  {
56  return groupName;
57  }
58  std::vector<std::string> getStateFilepaths() const
59  {
60  return allstateFilePaths;
61  }
62  std::string getDescription() const;
63  std::string getPackageName() const;
64  bool contextGenerationEnabled() const;
65  StateVisibility getStateVisibility(const std::string& filepath) const;
66  int getStateNestingLevel(std::string filepath) const;
67  std::vector<std::string> getProxies() const;
68 
70 
71  std::string getConfigurationFileContent() const;
72 
73  private:
74  void ReadChildren(RapidXmlReaderNode xmlNode, const std::filesystem::path& path, int nesting);
75  std::vector<std::string> allstateFilePaths;
76  std::filesystem::path basePath;
77  std::filesystem::path groupDefinitionFile;
78  std::string groupName;
79  std::string packageName;
80  std::string description;
81  bool generateContext;
82  std::vector<std::string> proxies;
83  std::map<std::string, StateVisibility> stateVisibilityMap;
84  std::map<std::string, int> stateNestingMap;
85  StatechartProfilePtr selectedProfile;
86  std::map<std::string, std::string> profileConfigurations;
87 
88  };
89  using StatechartGroupXmlReaderPtr = std::shared_ptr<StatechartGroupXmlReader>;
90 }
91 
armarx::RapidXmlReaderPtr
std::shared_ptr< RapidXmlReader > RapidXmlReaderPtr
Definition: RapidXmlReader.h:66
armarx::StatechartGroupXmlReader::getConfigurationFileContent
std::string getConfigurationFileContent() const
Definition: GroupXmlReader.cpp:174
armarx::StatechartGroupXmlReader::getStateNestingLevel
int getStateNestingLevel(std::string filepath) const
Definition: GroupXmlReader.cpp:144
armarx::StatechartGroupXmlReader::ePublic
@ ePublic
Definition: GroupXmlReader.h:44
armarx::StatechartGroupXmlReader::StateVisibility
StateVisibility
Definition: GroupXmlReader.h:41
armarx::StatechartProfilePtr
std::shared_ptr< class StatechartProfile > StatechartProfilePtr
Definition: StatechartContext.h:52
armarx::StatechartGroupXmlReader::ePrivate
@ ePrivate
Definition: GroupXmlReader.h:43
armarx::StatechartGroupXmlReader::StatechartGroupXmlReader
StatechartGroupXmlReader(const StatechartProfilePtr &selectedProfile)
Definition: GroupXmlReader.cpp:44
armarx::StatechartGroupXmlReader::readXml
void readXml(const std::filesystem::path &groupDefinitionFile)
Definition: GroupXmlReader.cpp:50
armarx::StatechartGroupXmlReader::contextGenerationEnabled
bool contextGenerationEnabled() const
Definition: GroupXmlReader.cpp:127
armarx::StatechartGroupXmlReaderPtr
std::shared_ptr< StatechartGroupXmlReader > StatechartGroupXmlReaderPtr
Definition: GroupXmlReader.h:89
armarx::StatechartGroupXmlReader::getStateFilepaths
std::vector< std::string > getStateFilepaths() const
Definition: GroupXmlReader.h:58
armarx::StatechartGroupXmlReader::getGroupName
std::string getGroupName() const
Definition: GroupXmlReader.h:54
armarx::StatechartGroupXmlReader::getDescription
std::string getDescription() const
Definition: GroupXmlReader.cpp:207
armarx::StatechartGroupXmlReader::getStateVisibility
StateVisibility getStateVisibility(const std::string &filepath) const
Definition: GroupXmlReader.cpp:132
StatechartProfiles.h
armarx::RapidXmlReaderNode
Definition: RapidXmlReader.h:68
armarx::StatechartGroupXmlReader
Definition: GroupXmlReader.h:38
armarx::StatechartGroupXmlReader::getSelectedProfile
StatechartProfilePtr getSelectedProfile() const
Definition: GroupXmlReader.cpp:169
armarx::StatechartGroupXmlReader::getProxies
std::vector< std::string > getProxies() const
Definition: GroupXmlReader.cpp:164
armarx::StatechartGroupXmlReader::getGroupDefinitionFilePath
std::filesystem::path getGroupDefinitionFilePath() const
Definition: GroupXmlReader.cpp:95
RapidXmlReader.h
rapidxml.hpp
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::StatechartGroupXmlReader::getPackageName
std::string getPackageName() const
Definition: GroupXmlReader.cpp:121