Skip to content

Commit

Permalink
Move TypeDescriptor::stateTable from header to implementation. (#2015)
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
(cherry picked from commit 1f2636a)
  • Loading branch information
MiguelCompany authored and mergify-bot committed Oct 19, 2021
1 parent 0f52b7e commit 984ac73
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 24 deletions.
24 changes: 0 additions & 24 deletions include/fastrtps/types/TypeDescriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -55,13 +38,6 @@ class TypeDescriptor
DynamicType_ptr key_element_type_; // Key Type for maps.
std::vector<AnnotationDescriptor*> 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(
Expand Down
26 changes: 26 additions & 0 deletions src/cpp/dynamic-types/TypeDescriptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_("")
Expand Down

0 comments on commit 984ac73

Please sign in to comment.