XmlStateBaseClassGenerator.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 <set>
27 #include <string>
28 
29 #include <Ice/Communicator.h>
30 
34 
35 #include "DoxDoc.h"
36 #include "DoxLine.h"
37 #include "DoxTable.h"
38 #include "DoxTransitiongraph.h"
39 
40 namespace armarx
41 {
43  {
44  public:
46 
47  static std::string GenerateCpp(std::vector<std::string> namespaces,
48  RapidXmlReaderPtr reader,
49  const std::vector<std::string>& proxies,
50  bool contextGenerationEnabled,
51  std::string groupName,
52  VariantInfoPtr variantInfo);
53 
54  static std::set<std::string> GetUsedInnerNonBasicVariantTypes(RapidXmlReaderNode stateNode,
55  VariantInfoPtr variantInfo);
56  static std::set<std::string>
58  VariantInfoPtr variantInfo);
59 
60  private:
61  static std::vector<CppClassPtr> BuildClass(std::vector<std::string> namespaces,
62  RapidXmlReaderNode stateNode,
63  std::vector<std::string> proxies,
64  bool contextGenerationEnabled,
65  std::string groupName,
66  VariantInfoPtr variantInfo);
67  static std::set<std::string> GetUsedVariantTypes(RapidXmlReaderNode stateNode);
68  static void AddGet(RapidXmlReaderNode node,
69  CppClassPtr targetClass,
70  VariantInfoPtr variantInfo,
71  const std::string& parentGetMethodName);
72  static void AddIsSet(RapidXmlReaderNode node,
73  CppClassPtr targetClass,
74  VariantInfoPtr variantInfo,
75  const std::string& parentTestParamMethodName);
76  static void AddSet(RapidXmlReaderNode node,
77  CppClassPtr targetClass,
78  VariantInfoPtr variantInfo,
79  const std::string& parentGetMethodName);
80  static void AddTransitionCodeFunctions(RapidXmlReaderNode stateNode,
81  CppClassPtr targetClass);
82  static std::string fmt(const std::string& fmt, const std::string& arg1);
83  static std::string
84  fmt(const std::string& fmt, const std::string& arg1, const std::string& arg2);
85  static std::string fmt(const std::string& fmt,
86  const std::string& arg1,
87  const std::string& arg2,
88  const std::string& arg3);
89  static std::string generateDocString(RapidXmlReaderNode stateNode,
90  const std::string& packageName,
91  const std::vector<std::string>& namespaces,
92  bool isPublicState);
93  static std::string generateParameterTableString(RapidXmlReaderNode stateNode);
94  static std::string generateDotGraphString(RapidXmlReaderNode stateNode);
95  static DoxDocPtr generateDoxDoc(RapidXmlReaderNode stateNode,
96  const std::string& packageName,
97  std::vector<std::string>& namespaces,
98  bool isPublicState,
99  VariantInfoPtr variantInfo,
100  Ice::CommunicatorPtr communicator);
101  };
102 } // namespace armarx
armarx::RapidXmlReaderPtr
std::shared_ptr< RapidXmlReader > RapidXmlReaderPtr
Definition: RapidXmlReader.h:67
DoxTable.h
armarx::CppClassPtr
std::shared_ptr< CppClass > CppClassPtr
Definition: CppClass.h:35
DoxTransitiongraph.h
armarx::DoxDocPtr
std::shared_ptr< DoxDoc > DoxDocPtr
Definition: DoxDoc.h:40
armarx::XmlStateBaseClassGenerator::GetUsedInnerNonBasicVariantTypes
static std::set< std::string > GetUsedInnerNonBasicVariantTypes(RapidXmlReaderNode stateNode, VariantInfoPtr variantInfo)
Definition: XmlStateBaseClassGenerator.cpp:66
IceInternal::Handle<::Ice::Communicator >
DoxLine.h
armarx::XmlStateBaseClassGenerator
Definition: XmlStateBaseClassGenerator.h:42
CppClass.h
armarx::XmlStateBaseClassGenerator::XmlStateBaseClassGenerator
XmlStateBaseClassGenerator()
Definition: XmlStateBaseClassGenerator.cpp:40
armarx::RapidXmlReaderNode
Definition: RapidXmlReader.h:69
DoxDoc.h
armarx::XmlStateBaseClassGenerator::GetIncludesForInnerNonBasicVariantTypes
static std::set< std::string > GetIncludesForInnerNonBasicVariantTypes(RapidXmlReaderNode stateNode, VariantInfoPtr variantInfo)
Definition: XmlStateBaseClassGenerator.cpp:91
armarx::VariantInfoPtr
std::shared_ptr< VariantInfo > VariantInfoPtr
Definition: VariantInfo.h:39
RapidXmlReader.h
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
VariantInfo.h
armarx::XmlStateBaseClassGenerator::GenerateCpp
static std::string GenerateCpp(std::vector< std::string > namespaces, RapidXmlReaderPtr reader, const std::vector< std::string > &proxies, bool contextGenerationEnabled, std::string groupName, VariantInfoPtr variantInfo)
Definition: XmlStateBaseClassGenerator.cpp:45