From 1f2636aafcc8b674762863321e9ca20d13ccdee9 Mon Sep 17 00:00:00 2001 From: Miguel Company Date: Thu, 8 Jul 2021 12:07:25 +0200 Subject: [PATCH] Move TypeDescriptor::stateTable from header to implementation. (#2015) Signed-off-by: Miguel Company --- include/fastrtps/types/TypeDescriptor.h | 24 ---------------------- src/cpp/dynamic-types/TypeDescriptor.cpp | 26 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/include/fastrtps/types/TypeDescriptor.h b/include/fastrtps/types/TypeDescriptor.h index 89aef5acd09..2d2c7a24df6 100644 --- a/include/fastrtps/types/TypeDescriptor.h +++ b/include/fastrtps/types/TypeDescriptor.h @@ -25,23 +25,6 @@ namespace eprosima { namespace fastrtps { namespace types { -enum FSM_INPUTS -{ - LETTER = 1, - NUMBER, - UNDERSCORE, - COLON, - OTHER -}; - -enum FSM_STATES -{ - INVALID = 0, - SINGLECOLON, - DOUBLECOLON, - VALID -}; - class TypeDescriptor { protected: @@ -55,13 +38,6 @@ class TypeDescriptor DynamicType_ptr key_element_type_; // Key Type for maps. std::vector annotation_; // Annotations to apply - const int stateTable[4][6] = { - /* Input: letter, number, underscore, colon, other */ - {INVALID, VALID, INVALID, INVALID, INVALID, INVALID}, - {SINGLECOLON, INVALID, INVALID, INVALID, DOUBLECOLON, INVALID}, - {DOUBLECOLON, VALID, INVALID, INVALID, INVALID, INVALID}, - {VALID, VALID, VALID, VALID, SINGLECOLON, INVALID}}; - void clean(); bool is_type_name_consistent( diff --git a/src/cpp/dynamic-types/TypeDescriptor.cpp b/src/cpp/dynamic-types/TypeDescriptor.cpp index 4d4835fdc76..fab5cce54e0 100644 --- a/src/cpp/dynamic-types/TypeDescriptor.cpp +++ b/src/cpp/dynamic-types/TypeDescriptor.cpp @@ -25,6 +25,32 @@ namespace eprosima { namespace fastrtps { namespace types { +enum FSM_INPUTS +{ + LETTER = 1, + NUMBER, + UNDERSCORE, + COLON, + OTHER +}; + +enum FSM_STATES +{ + INVALID = 0, + SINGLECOLON, + DOUBLECOLON, + VALID +}; + +static const int stateTable[4][6] = +{ + /* Input: letter, number, underscore, colon, other */ + {INVALID, VALID, INVALID, INVALID, INVALID, INVALID}, + {SINGLECOLON, INVALID, INVALID, INVALID, DOUBLECOLON, INVALID}, + {DOUBLECOLON, VALID, INVALID, INVALID, INVALID, INVALID}, + {VALID, VALID, VALID, VALID, SINGLECOLON, INVALID} +}; + TypeDescriptor::TypeDescriptor() : kind_(0) , name_("")