Writer.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2012-2016, High Performance Humanoid Technologies (H2T),
5  * Karlsruhe Institute of Technology (KIT), all rights reserved.
6  *
7  * ArmarX is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License version 2 as
9  * published by the Free Software Foundation.
10  *
11  * ArmarX is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  *
19  * @author Fabian Peller-Konrad (fabian dot peller-konrad at kit dot edu)
20  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
21  * GNU General Public License
22  */
23 
24 #pragma once
25 
26 // STD/STL
27 #include <memory>
28 #include <set>
29 #include <map>
30 #include <vector>
31 
32 // Parent class
34 
35 // ArmarX
38 
42 
44 {
45  class Writer :
46  virtual public codegenerator::CodeWriter
47  {
48  public:
49  Writer() = delete;
50  Writer(const std::string&, const std::vector<std::string>&);
51 
52  virtual ~Writer() = default;
53 
54  virtual void generateTypeObjects(const std::vector<typereader::GenerateObjectInfo>&) override;
55  virtual void generateTypeIntEnums(const std::vector<typereader::GenerateIntEnumInfo>&) override;
56 
57  protected:
58  virtual void addSpecificWriterMethods() override;
59  virtual void addSpecificReaderMethods() override;
60 
63 
64  void setupMemberFields(CppClassPtr&, const std::map<std::string, std::string>& doc_members, const generator::ObjectClass&) const;
65  void setupMemberFields(CppClassPtr&, const std::map<std::string, std::string>& doc_members, const generator::IntEnumClass&) const;
66 
67  private:
68  static const constexpr char* OWN_TYPE_NAME = "OWN_TYPE_NAME";
69 
70  };
71 }
armarx::aron::codegenerator::cpp
Definition: AnyObject.cpp:29
CppMethod.h
armarx::aron::codegenerator::cpp::generator::ObjectClass
Definition: ObjectClass.h:31
armarx::aron::codegenerator::cpp::Writer::generateTypeObjects
virtual void generateTypeObjects(const std::vector< typereader::GenerateObjectInfo > &) override
Definition: Writer.cpp:263
armarx::aron::codegenerator::cpp::Writer::addSpecificReaderMethods
virtual void addSpecificReaderMethods() override
Definition: Writer.cpp:184
armarx::CppClassPtr
std::shared_ptr< CppClass > CppClassPtr
Definition: CppClass.h:36
All.h
IntEnumClass.h
ObjectClass.h
armarx::CppEnumPtr
std::shared_ptr< CppEnum > CppEnumPtr
Definition: CppEnum.h:55
armarx::aron::codegenerator::cpp::Writer::setupEnumPtr
CppEnumPtr setupEnumPtr(const typereader::GenerateInfo &info, const generator::IntEnumClass &gen) const
Definition: Writer.cpp:487
CppClass.h
armarx::aron::codegenerator::cpp::Writer
Definition: Writer.h:45
CodeWriter.h
armarx::aron::typereader::GenerateInfo
A top-level struct for type-generation information.
Definition: GenerateInfo.h:37
armarx::aron::codegenerator::cpp::Writer::Writer
Writer()=delete
armarx::aron::codegenerator::cpp::Writer::addSpecificWriterMethods
virtual void addSpecificWriterMethods() override
Definition: Writer.cpp:81
armarx::aron::codegenerator::cpp::Writer::~Writer
virtual ~Writer()=default
armarx::aron::codegenerator::cpp::Generator
Definition: Generator.h:65
armarx::aron::codegenerator::cpp::Writer::setupMemberFields
void setupMemberFields(CppClassPtr &, const std::map< std::string, std::string > &doc_members, const generator::ObjectClass &) const
Definition: Writer.cpp:603
armarx::aron::codegenerator::cpp::Writer::setupBasicCppClass
CppClassPtr setupBasicCppClass(const typereader::GenerateInfo &info, const Generator &gen) const
Definition: Writer.cpp:516
armarx::aron::codegenerator::CodeWriter
Definition: CodeWriter.h:46
armarx::aron::codegenerator::cpp::generator::IntEnumClass
Definition: IntEnumClass.h:34
armarx::aron::codegenerator::cpp::Writer::generateTypeIntEnums
virtual void generateTypeIntEnums(const std::vector< typereader::GenerateIntEnumInfo > &) override
Definition: Writer.cpp:375