Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RobotAPI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software
ArmarX
RobotAPI
Commits
6bfa2766
Commit
6bfa2766
authored
3 years ago
by
Fabian Tërnava
Browse files
Options
Downloads
Patches
Plain Diff
fixed error in assignment operator for int enums
parent
a25a0a58
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!171
Periodic merge of armem/dev into master
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/RobotAPI/libraries/aron/core/codegenerator/codeWriter/cpp/serializer/toplevel/IntEnumClass.cpp
+6
-3
6 additions, 3 deletions
...rator/codeWriter/cpp/serializer/toplevel/IntEnumClass.cpp
with
6 additions
and
3 deletions
source/RobotAPI/libraries/aron/core/codegenerator/codeWriter/cpp/serializer/toplevel/IntEnumClass.cpp
+
6
−
3
View file @
6bfa2766
...
@@ -49,7 +49,7 @@ namespace armarx::aron::cppserializer::serializer
...
@@ -49,7 +49,7 @@ namespace armarx::aron::cppserializer::serializer
name_to_enum
<<
"{"
<<
std
::
endl
;
name_to_enum
<<
"{"
<<
std
::
endl
;
enum_to_value
<<
"{"
<<
std
::
endl
;
enum_to_value
<<
"{"
<<
std
::
endl
;
value_to_enum
<<
"{"
<<
std
::
endl
;
value_to_enum
<<
"{"
<<
std
::
endl
;
for
(
const
auto
&
[
key
,
value
]
:
typenavigator
->
getAcceptedValue
s
())
for
(
const
auto
&
[
key
,
value
]
:
typenavigator
->
getAcceptedValue
Map
())
{
{
std
::
string
enumKeyWithNamespace
=
std
::
string
(
IMPL_ENUM
)
+
"::"
+
key
;
std
::
string
enumKeyWithNamespace
=
std
::
string
(
IMPL_ENUM
)
+
"::"
+
key
;
fields
.
push_back
(
std
::
make_shared
<
CppField
>
(
"const static "
+
std
::
string
(
IMPL_ENUM
),
key
+
" = "
+
enumKeyWithNamespace
));
fields
.
push_back
(
std
::
make_shared
<
CppField
>
(
"const static "
+
std
::
string
(
IMPL_ENUM
),
key
+
" = "
+
enumKeyWithNamespace
));
...
@@ -141,7 +141,7 @@ namespace armarx::aron::cppserializer::serializer
...
@@ -141,7 +141,7 @@ namespace armarx::aron::cppserializer::serializer
CppEnumPtr
IntEnumClassSerializer
::
toInnerEnumDefinition
()
const
CppEnumPtr
IntEnumClassSerializer
::
toInnerEnumDefinition
()
const
{
{
CppEnumPtr
e
=
std
::
make_shared
<
CppEnum
>
(
std
::
string
(
IMPL_ENUM
),
"The internal enum definition of the enum of this autogenerated class."
);
CppEnumPtr
e
=
std
::
make_shared
<
CppEnum
>
(
std
::
string
(
IMPL_ENUM
),
"The internal enum definition of the enum of this autogenerated class."
);
for
(
const
auto
&
[
key
,
value
]
:
typenavigator
->
getAcceptedValue
s
())
for
(
const
auto
&
[
key
,
value
]
:
typenavigator
->
getAcceptedValue
Map
())
{
{
e
->
addField
(
std
::
make_shared
<
CppEnumField
>
(
key
));
e
->
addField
(
std
::
make_shared
<
CppEnumField
>
(
key
));
}
}
...
@@ -170,6 +170,7 @@ namespace armarx::aron::cppserializer::serializer
...
@@ -170,6 +170,7 @@ namespace armarx::aron::cppserializer::serializer
CppMethodPtr
m
=
CppMethodPtr
(
new
CppMethod
(
getFullCppTypename
()
+
"& operator=(const "
+
getFullCppTypename
()
+
"& c)"
,
doc
.
str
()));
CppMethodPtr
m
=
CppMethodPtr
(
new
CppMethod
(
getFullCppTypename
()
+
"& operator=(const "
+
getFullCppTypename
()
+
"& c)"
,
doc
.
str
()));
CppBlockPtr
b
=
std
::
make_shared
<
CppBlock
>
();
CppBlockPtr
b
=
std
::
make_shared
<
CppBlock
>
();
b
->
addLine
(
"value = c.value;"
);
b
->
addLine
(
"value = c.value;"
);
b
->
addLine
(
"return *this"
);
m
->
setBlock
(
b
);
m
->
setBlock
(
b
);
return
m
;
return
m
;
}
}
...
@@ -183,6 +184,7 @@ namespace armarx::aron::cppserializer::serializer
...
@@ -183,6 +184,7 @@ namespace armarx::aron::cppserializer::serializer
CppMethodPtr
m
=
CppMethodPtr
(
new
CppMethod
(
getFullCppTypename
()
+
"& operator=("
+
std
::
string
(
IMPL_ENUM
)
+
" v)"
,
doc
.
str
()));
CppMethodPtr
m
=
CppMethodPtr
(
new
CppMethod
(
getFullCppTypename
()
+
"& operator=("
+
std
::
string
(
IMPL_ENUM
)
+
" v)"
,
doc
.
str
()));
CppBlockPtr
b
=
std
::
make_shared
<
CppBlock
>
();
CppBlockPtr
b
=
std
::
make_shared
<
CppBlock
>
();
b
->
addLine
(
"value = v;"
);
b
->
addLine
(
"value = v;"
);
b
->
addLine
(
"return *this"
);
m
->
setBlock
(
b
);
m
->
setBlock
(
b
);
return
m
;
return
m
;
}
}
...
@@ -193,7 +195,7 @@ namespace armarx::aron::cppserializer::serializer
...
@@ -193,7 +195,7 @@ namespace armarx::aron::cppserializer::serializer
doc
<<
"@brief operator=() - Assignment operator for the internally defined enum
\n
"
;
doc
<<
"@brief operator=() - Assignment operator for the internally defined enum
\n
"
;
doc
<<
"@return - nothing"
;
doc
<<
"@return - nothing"
;
CppMethodPtr
m
=
CppMethodPtr
(
new
CppMethod
(
"void
operator=(int v)"
,
doc
.
str
()));
CppMethodPtr
m
=
CppMethodPtr
(
new
CppMethod
(
getFullCppTypename
()
+
"&
operator=(int v)"
,
doc
.
str
()));
CppBlockPtr
b
=
std
::
make_shared
<
CppBlock
>
();
CppBlockPtr
b
=
std
::
make_shared
<
CppBlock
>
();
b
->
addLine
(
"if (auto it = ValueToEnumMap.find(v); it == ValueToEnumMap.end())"
);
b
->
addLine
(
"if (auto it = ValueToEnumMap.find(v); it == ValueToEnumMap.end())"
);
CppBlockPtr
b2
=
std
::
make_shared
<
CppBlock
>
();
CppBlockPtr
b2
=
std
::
make_shared
<
CppBlock
>
();
...
@@ -203,6 +205,7 @@ namespace armarx::aron::cppserializer::serializer
...
@@ -203,6 +205,7 @@ namespace armarx::aron::cppserializer::serializer
CppBlockPtr
b3
=
std
::
make_shared
<
CppBlock
>
();
CppBlockPtr
b3
=
std
::
make_shared
<
CppBlock
>
();
b3
->
addLine
(
"value = it->second;"
);
b3
->
addLine
(
"value = it->second;"
);
b
->
addBlock
(
b3
);
b
->
addBlock
(
b3
);
b
->
addLine
(
"return *this"
);
m
->
setBlock
(
b
);
m
->
setBlock
(
b
);
return
m
;
return
m
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment