GenerateInfo.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 <string>
29
#include <vector>
30
31
#include <SimoxUtility/algorithm/string.h>
32
33
#include <
ArmarXCore/core/exceptions/local/ExpressionException.h
>
34
35
namespace
armarx::aron::typereader
36
{
37
/// A top-level struct for type-generation information
38
struct
GenerateInfo
39
{
40
std::string
typeName
;
41
std::string
definedIn
;
42
std::string
doc_brief
;
43
std::string
doc_author
;
44
45
std::string
46
getNameWithoutNamespace
()
const
47
{
48
std::vector<std::string>
split
=
simox::alg::split
(
typeName
,
"::"
);
49
return
split
[
split
.size() - 1];
50
}
51
52
std::vector<std::string>
53
getTemplates
()
const
54
{
55
auto
first =
typeName
.find(
"<"
);
56
if
(first == std::string::npos)
57
{
58
return
{};
59
}
60
61
auto
last =
typeName
.find(
">"
);
62
ARMARX_CHECK_NOT_EQUAL
(last, std::string::npos);
63
64
return
simox::alg::split
(
typeName
.substr(first, last - first),
","
);
65
}
66
67
std::vector<std::string>
68
getNamespaces
()
const
69
{
70
std::vector<std::string>
split
=
simox::alg::split
(
typeName
,
"::"
);
71
std::vector<std::string> namespaces(
split
);
72
namespaces.pop_back();
73
return
namespaces;
74
}
75
};
76
}
// namespace armarx::aron::typereader
ARMARX_CHECK_NOT_EQUAL
#define ARMARX_CHECK_NOT_EQUAL(lhs, rhs)
This macro evaluates whether lhs is inequal (!=) rhs and if it turns out to be false it will throw an...
Definition:
ExpressionException.h:137
armarx::aron::typereader::GenerateInfo::definedIn
std::string definedIn
Definition:
GenerateInfo.h:41
armarx::aron::typereader
Definition:
GenerateInfo.h:35
armarx::aron::typereader::GenerateInfo::getTemplates
std::vector< std::string > getTemplates() const
Definition:
GenerateInfo.h:53
armarx::aron::typereader::GenerateInfo::getNameWithoutNamespace
std::string getNameWithoutNamespace() const
Definition:
GenerateInfo.h:46
armarx::aron::typereader::GenerateInfo::typeName
std::string typeName
Definition:
GenerateInfo.h:40
armarx::aron::typereader::GenerateInfo
A top-level struct for type-generation information.
Definition:
GenerateInfo.h:38
ExpressionException.h
armarx::aron::typereader::GenerateInfo::doc_brief
std::string doc_brief
Definition:
GenerateInfo.h:42
armarx::aron::typereader::GenerateInfo::doc_author
std::string doc_author
Definition:
GenerateInfo.h:43
armarx::aron::typereader::GenerateInfo::getNamespaces
std::vector< std::string > getNamespaces() const
Definition:
GenerateInfo.h:68
armarx::split
std::vector< std::string > split(const std::string &source, const std::string &splitBy, bool trimElements=false, bool removeEmptyElements=false)
Definition:
StringHelpers.cpp:38
RobotAPI
libraries
aron
codegeneration
typereader
helper
GenerateInfo.h
Generated on Sat Mar 29 2025 09:17:29 for armarx_documentation by
1.8.17