StateGroupDocGenerator.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 #pragma once
25 
26 #include "GroupXmlReader.h"
27 
31 
32 namespace armarx
33 {
34 
36  {
37  struct StateInfo
38  {
39  StateInfo(std::string package, std::string group, std::string state)
40  : package(package), group(group), state(state) {}
41  std::string package, group, state;
42  std::string toString() const
43  {
44  return package + "-" + group + "-" + state;
45  }
46  };
47 
48  public:
50  std::string generateDocString(const StatechartGroupXmlReaderPtr& reader) const;
51  void generateDoxygenFile(const std::string& groupDefinitionFilePath);
52  void generateDoxygenFiles(const std::vector<std::string>& groups);
53 
54  void setOutputpath(const std::string& outputPath);
55 
56  static std::vector<std::string> FindAllStatechartGroupDefinitions(const std::filesystem::path& path);
57 
59 
60  std::set<std::string> getUsedProfiles(const RapidXmlReaderNode& stateNode) const;
61  void buildReferenceIndex(const std::vector<std::string>& groups);
62  protected:
63  //std::map<std::string, StatechartGroupXmlReaderPtr> readers;
64  std::map<std::string, CMakePackageFinder> finders;
65  std::string outputPath;
66  std::map<std::string, StateInfo> uuidToStateInfoMap;
67  std::map<std::string, std::set<std::string>> usageMap;
68  private:
69  DoxTablePtr buildParameterTable(RapidXmlReaderNode parametersNode) const;
70  void addParameterTable(const DoxDocPtr& doc, const RapidXmlReaderNode& stateNode, std::string name, const char* nodeName) const;
71  std::string unescapeString(std::string str) const;
72  std::string nToBr(std::string str) const;
73  std::string fmt(const std::string& fmt, const std::string& arg1) const;
74  std::string fmt(const std::string& fmt, const std::string& arg1, const std::string& arg2) const;
75  std::string fmt(const std::string& fmt, const std::string& arg1, const std::string& arg2, const std::string& arg3) const;
76  std::string fmt(const std::string& fmt, const std::string& arg1, const std::string& arg2, const std::string& arg3, const std::string& arg4) const;
77  std::string getNodeAttrsFromStateType(const std::string& nodeType) const;
78  };
79 
80 } // namespace armarx
81 
armarx::StatechartGroupDocGenerator::FindAllStatechartGroupDefinitions
static std::vector< std::string > FindAllStatechartGroupDefinitions(const std::filesystem::path &path)
Definition: StateGroupDocGenerator.cpp:448
armarx::StatechartGroupDocGenerator::usageMap
std::map< std::string, std::set< std::string > > usageMap
Definition: StateGroupDocGenerator.h:67
str
std::string str(const T &t)
Definition: UserAssistedSegmenterGuiWidgetController.cpp:42
DoxTable.h
armarx::StatechartGroupDocGenerator::buildReferenceIndex
void buildReferenceIndex(const std::vector< std::string > &groups)
Definition: StateGroupDocGenerator.cpp:401
armarx::StatechartGroupDocGenerator::generateDocString
std::string generateDocString(const StatechartGroupXmlReaderPtr &reader) const
Definition: StateGroupDocGenerator.cpp:185
armarx::CMakePackageFinder
The CMakePackageFinder class provides an interface to the CMake Package finder capabilities.
Definition: CMakePackageFinder.h:53
armarx::StatechartGroupDocGenerator
Definition: StateGroupDocGenerator.h:35
armarx::StatechartGroupDocGenerator::StatechartGroupDocGenerator
StatechartGroupDocGenerator()
Definition: StateGroupDocGenerator.cpp:40
GroupXmlReader.h
armarx::StatechartGroupDocGenerator::getFinder
CMakePackageFinder getFinder(const StatechartGroupXmlReaderPtr &reader)
Definition: StateGroupDocGenerator.cpp:478
armarx::DoxDocPtr
std::shared_ptr< DoxDoc > DoxDocPtr
Definition: DoxDoc.h:38
armarx::StatechartGroupDocGenerator::generateDoxygenFiles
void generateDoxygenFiles(const std::vector< std::string > &groups)
Definition: StateGroupDocGenerator.cpp:435
armarx::DoxTablePtr
std::shared_ptr< DoxTable > DoxTablePtr
Definition: DoxTable.h:35
armarx::StatechartGroupDocGenerator::setOutputpath
void setOutputpath(const std::string &outputPath)
Definition: StateGroupDocGenerator.cpp:443
armarx::StatechartGroupDocGenerator::getUsedProfiles
std::set< std::string > getUsedProfiles(const RapidXmlReaderNode &stateNode) const
Definition: StateGroupDocGenerator.cpp:45
armarx::StatechartGroupXmlReaderPtr
std::shared_ptr< StatechartGroupXmlReader > StatechartGroupXmlReaderPtr
Definition: GroupXmlReader.h:89
armarx::RapidXmlReaderNode
Definition: RapidXmlReader.h:68
armarx::StatechartGroupDocGenerator::finders
std::map< std::string, CMakePackageFinder > finders
Definition: StateGroupDocGenerator.h:64
DoxDoc.h
armarx::StatechartGroupDocGenerator::uuidToStateInfoMap
std::map< std::string, StateInfo > uuidToStateInfoMap
Definition: StateGroupDocGenerator.h:66
CMakePackageFinder.h
armarx::viz::toString
const char * toString(InteractionFeedbackType type)
Definition: Interaction.h:27
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::StatechartGroupDocGenerator::outputPath
std::string outputPath
Definition: StateGroupDocGenerator.h:65
armarx::StatechartGroupDocGenerator::generateDoxygenFile
void generateDoxygenFile(const std::string &groupDefinitionFilePath)
Definition: StateGroupDocGenerator.cpp:362