Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move TypeDescriptor::stateTable from header to implementation. [11841] #2015

Merged
merged 1 commit into from
Jul 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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