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
27#include <filesystem>
28
31
32#include "../StateBase.h"
34
35namespace armarx
36{
38 {
39 public:
45
46 StatechartGroupXmlReader(const StatechartProfilePtr& selectedProfile);
47
48 void readXml(const std::filesystem::path& groupDefinitionFile);
49 //void readXml(const std::string &groupDefinitionXMLString);
50 void readXml(RapidXmlReaderPtr reader);
51
52 std::filesystem::path getGroupDefinitionFilePath() const;
53
54 std::string
56 {
57 return groupName;
58 }
59
60 std::vector<std::string>
62 {
63 return allstateFilePaths;
64 }
65
66 std::string getDescription() const;
67 std::string getPackageName() const;
68 bool contextGenerationEnabled() const;
69 StateVisibility getStateVisibility(const std::string& filepath) const;
70 int getStateNestingLevel(std::string filepath) const;
71 std::vector<std::string> getProxies() const;
72
74
75 std::string getConfigurationFileContent() const;
76
77 private:
78 void
79 ReadChildren(RapidXmlReaderNode xmlNode, const std::filesystem::path& path, int nesting);
80 std::vector<std::string> allstateFilePaths;
81 std::filesystem::path basePath;
82 std::filesystem::path groupDefinitionFile;
83 std::string groupName;
84 std::string packageName;
85 std::string description;
86 bool generateContext;
87 std::vector<std::string> proxies;
88 std::map<std::string, StateVisibility> stateVisibilityMap;
89 std::map<std::string, int> stateNestingMap;
90 StatechartProfilePtr selectedProfile;
91 std::map<std::string, std::string> profileConfigurations;
92 };
93
94 using StatechartGroupXmlReaderPtr = std::shared_ptr<StatechartGroupXmlReader>;
95} // namespace armarx
std::vector< std::string > getStateFilepaths() const
std::vector< std::string > getProxies() const
void readXml(const std::filesystem::path &groupDefinitionFile)
StateVisibility getStateVisibility(const std::string &filepath) const
std::string getConfigurationFileContent() const
StatechartGroupXmlReader(const StatechartProfilePtr &selectedProfile)
std::filesystem::path getGroupDefinitionFilePath() const
int getStateNestingLevel(std::string filepath) const
StatechartProfilePtr getSelectedProfile() const
This file offers overloads of toIce() and fromIce() functions for STL container types.
std::shared_ptr< StatechartGroupXmlReader > StatechartGroupXmlReaderPtr
std::shared_ptr< RapidXmlReader > RapidXmlReaderPtr
std::shared_ptr< class StatechartProfile > StatechartProfilePtr
This file contains rapidxml parser and DOM implementation.