Skip to content

Commit

Permalink
Refs #17138. Temporally solution
Browse files Browse the repository at this point in the history
Signed-off-by: Ricardo González Moreno <[email protected]>
  • Loading branch information
richiware committed Jan 30, 2024
1 parent cd8b30a commit d1db044
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions include/fastcdr/Cdr.h
Original file line number Diff line number Diff line change
Expand Up @@ -3012,6 +3012,22 @@ class Cdr
return *this;
}

void set_serialized_member_size()
{
serialized_member_size_ = SERIALIZED_MEMBER_SIZE;
}

/*!
* @brief This function returns the extra bytes regarding the allignment.
* @param data_size The size of the data that will be serialized.
* @return The size needed for the alignment.
*/
inline size_t alignment(
size_t data_size) const
{
return data_size > last_data_size_ ? (data_size - ((offset_ - origin_) % data_size)) & (data_size - 1) : 0;
}

private:

Cdr(
Expand Down Expand Up @@ -3087,17 +3103,6 @@ class Cdr
return deserialize_array(array_t->data(), num_elements * array_t->size(), endianness);
}

/*!
* @brief This function returns the extra bytes regarding the allignment.
* @param data_size The size of the data that will be serialized.
* @return The size needed for the alignment.
*/
inline size_t alignment(
size_t data_size) const
{
return data_size > last_data_size_ ? (data_size - ((offset_ - origin_) % data_size)) & (data_size - 1) : 0;
}

/*!
* @brief This function jumps the number of bytes of the alignment. These bytes should be calculated with the function eprosima::fastcdr::Cdr::alignment.
* @param align The number of bytes to be skipped.
Expand Down

0 comments on commit d1db044

Please sign in to comment.