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 
28 #include "DoxDoc.h"
29 #include "DoxLine.h"
30 #include "DoxTable.h"
31 #include "DoxTransitiongraph.h"
32 
33 #include <set>
34 #include <string>
35 
37 #include <Ice/Communicator.h>
38 
39 namespace armarx
40 {
42  {
43  public:
45 
46  static std::string GenerateCpp(std::vector<std::string> namespaces, RapidXmlReaderPtr reader, const std::vector<std::string>& proxies, bool contextGenerationEnabled, std::string groupName, VariantInfoPtr variantInfo);
47 
48  static std::set<std::string> GetUsedInnerNonBasicVariantTypes(RapidXmlReaderNode stateNode, VariantInfoPtr variantInfo);
49  static std::set<std::string> GetIncludesForInnerNonBasicVariantTypes(RapidXmlReaderNode stateNode, VariantInfoPtr variantInfo);
50 
51  private:
52  static std::vector<CppClassPtr> BuildClass(std::vector<std::string> namespaces, RapidXmlReaderNode stateNode, std::vector<std::string> proxies, bool contextGenerationEnabled, std::string groupName, VariantInfoPtr variantInfo);
53  static std::set<std::string> GetUsedVariantTypes(RapidXmlReaderNode stateNode);
54  static void AddGet(RapidXmlReaderNode node, CppClassPtr targetClass, VariantInfoPtr variantInfo, const std::string& parentGetMethodName);
55  static void AddIsSet(RapidXmlReaderNode node, CppClassPtr targetClass, VariantInfoPtr variantInfo, const std::string& parentTestParamMethodName);
56  static void AddSet(RapidXmlReaderNode node, CppClassPtr targetClass, VariantInfoPtr variantInfo, const std::string& parentGetMethodName);
57  static void AddTransitionCodeFunctions(RapidXmlReaderNode stateNode, CppClassPtr targetClass);
58  static std::string fmt(const std::string& fmt, const std::string& arg1);
59  static std::string fmt(const std::string& fmt, const std::string& arg1, const std::string& arg2);
60  static std::string fmt(const std::string& fmt, const std::string& arg1, const std::string& arg2, const std::string& arg3);
61  static std::string generateDocString(RapidXmlReaderNode stateNode, const std::string& packageName, const std::vector<std::string>& namespaces, bool isPublicState);
62  static std::string generateParameterTableString(RapidXmlReaderNode stateNode);
63  static std::string generateDotGraphString(RapidXmlReaderNode stateNode);
64  static DoxDocPtr generateDoxDoc(RapidXmlReaderNode stateNode, const std::string& packageName, std::vector<std::string>& namespaces, bool isPublicState, VariantInfoPtr variantInfo, Ice::CommunicatorPtr communicator);
65  };
66 }
67 
armarx::RapidXmlReaderPtr
std::shared_ptr< RapidXmlReader > RapidXmlReaderPtr
Definition: RapidXmlReader.h:66
DoxTable.h
armarx::CppClassPtr
std::shared_ptr< CppClass > CppClassPtr
Definition: CppClass.h:36
DoxTransitiongraph.h
armarx::DoxDocPtr
std::shared_ptr< DoxDoc > DoxDocPtr
Definition: DoxDoc.h:38
armarx::XmlStateBaseClassGenerator::GetUsedInnerNonBasicVariantTypes
static std::set< std::string > GetUsedInnerNonBasicVariantTypes(RapidXmlReaderNode stateNode, VariantInfoPtr variantInfo)
Definition: XmlStateBaseClassGenerator.cpp:55
IceInternal::Handle< ::Ice::Communicator >
DoxLine.h
armarx::XmlStateBaseClassGenerator
Definition: XmlStateBaseClassGenerator.h:41
CppClass.h
armarx::XmlStateBaseClassGenerator::XmlStateBaseClassGenerator
XmlStateBaseClassGenerator()
Definition: XmlStateBaseClassGenerator.cpp:39
armarx::RapidXmlReaderNode
Definition: RapidXmlReader.h:68
DoxDoc.h
armarx::XmlStateBaseClassGenerator::GetIncludesForInnerNonBasicVariantTypes
static std::set< std::string > GetIncludesForInnerNonBasicVariantTypes(RapidXmlReaderNode stateNode, VariantInfoPtr variantInfo)
Definition: XmlStateBaseClassGenerator.cpp:78
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:28
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