Skip to content

Commit

Permalink
Release v3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
arobenko committed May 19, 2021
2 parents 0dbca5c + 7610ec4 commit 4263ad5
Show file tree
Hide file tree
Showing 36 changed files with 1,055 additions and 196 deletions.
28 changes: 10 additions & 18 deletions comms/doc/page_custom_checksum_layer.dox
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
/// // Due to the fact that the used checksums have different lengths, the
/// // functionality of reading a field's value also needs to be customized.
/// template <typename TMsg, typename TIter>
/// static comms::ErrorStatus readField(const TMsg* msgPtr, Field& field, TIter& iter, std::size_t len)
/// static comms::ErrorStatus doReadField(const TMsg* msgPtr, Field& field, TIter& iter, std::size_t len)
/// {
/// if (msgPtr == nullptr) {
/// return comms::ErrorStatus::ProtocolError;
Expand All @@ -177,7 +177,7 @@
/// // Due to the fact that the used checksums have different lengths, the
/// // functionality of reading a field's value also needs to be customized.
/// template <typename TMsg, typename TIter>
/// static comms::ErrorStatus writeField(const TMsg* msgPtr, const Field& field, TIter& iter, std::size_t len)
/// static comms::ErrorStatus doWriteField(const TMsg* msgPtr, const Field& field, TIter& iter, std::size_t len)
/// {
/// if (msgPtr == nullptr) {
/// return comms::ErrorStatus::ProtocolError;
Expand Down Expand Up @@ -255,26 +255,18 @@
/// It is done by passing @ref comms::option::def::ExtendingClass extension option with
/// the type of the layer class being defined to the @ref comms::protocol::ChecksumLayer.
///
/// The extending class is expected to define the listed below functions. They do not
/// The extending class can customize the default behavior by overriding
/// the listed below functions. They do not
/// necessarily need to be @b static, accessing inner private state of the layer object
/// is also acceptable.
/// @li @ref comms::protocol::ChecksumLayer::doReadField() "doReadField()" - Member
/// function that is invoked to read field's value.
/// @li @ref comms::protocol::ChecksumLayer::doWriteField() "doWriteField()" - Member
/// function that is invoked to write field's value.
/// @li @ref comms::protocol::ChecksumLayer::doFieldLength() "doFieldLength()" - Member
/// function that is invoked to calculate serialization length of the field.
/// @li @ref comms::protocol::ChecksumLayer::calculateChecksum() "calculateChecksum()" -
/// Member function that is responsible to calculate a checksum on provided range.
/// @li @ref comms::protocol::ChecksumLayer::readField() "readField()" - Member function
/// that is responsible to read field's value. Needs to be overridden in case the
/// possible checksum values can have different lengths.
/// @li @ref comms::protocol::ChecksumLayer::writeField() "writeField()" - Member function
/// that is responsible to write field's value. Needs to be overridden in case the
/// possible checksum values can have different lengths.
/// @li @ref comms::protocol::ChecksumLayer::doFieldLength() "doFieldLength()" -
/// Member function used to calculate serialization length of the checksum field.
///
/// @b NOTE, that overriding of @ref comms::protocol::ChecksumLayer::readField() "readField()",
/// @ref comms::protocol::ChecksumLayer::writeField() "writeField()", and
/// @ref comms::protocol::ChecksumLayer::doFieldLength() "doFieldLength()" is not necessary
/// in case all of the used checksum types are of the same length, i.e. use the
/// same field abstraction to read/write checksum values. In this case the default
/// implementation provided by the @ref comms::protocol::ChecksumLayer is enough.
///
/// The newly defined custom protocol stack layer can be used instead of
/// @ref comms::protocol::ChecksumLayer when defining
Expand Down
9 changes: 8 additions & 1 deletion comms/doc/page_custom_id_layer.dox
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,16 @@
/// It is done by passing @ref comms::option::def::ExtendingClass extension option with
/// the type of the layer class being defined to the @ref comms::protocol::MsgIdLayer.
///
/// The extending class is expected to define the listed below functions. They do not
/// The extending class can customize the default behavior by overriding
/// the listed below functions. They do not
/// necessarily need to be @b static, accessing inner private state of the layer object
/// is also acceptable.
/// @li @ref comms::protocol::MsgIdLayer::doReadField() "doReadField()" - Member
/// function that is invoked to read field's value.
/// @li @ref comms::protocol::MsgIdLayer::doWriteField() "doWriteField()" - Member
/// function that is invoked to write field's value.
/// @li @ref comms::protocol::MsgIdLayer::doFieldLength() "doFieldLength()" - Member
/// function that is invoked to calculate serialization length of the field.
/// @li @ref comms::protocol::MsgIdLayer::getMsgIdFromField() "getMsgIdFromField()" -
/// Member function that is invoked to retrieve the
/// numeric message ID out of the provided field object.
Expand Down
9 changes: 8 additions & 1 deletion comms/doc/page_custom_size_layer.dox
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,16 @@
/// It is done by passing @ref comms::option::def::ExtendingClass extension option with
/// the type of the layer class being defined to the @ref comms::protocol::MsgSizeLayer.
///
/// The extending class is expected to define the listed below functions. They do not
/// The extending class can customize the default behavior by overriding
/// the listed below functions. They do not
/// necessarily need to be @b static, accessing inner private state of the layer object
/// is also acceptable.
/// @li @ref comms::protocol::MsgSizeLayer::doReadField() "doReadField()" - Member
/// function that is invoked to read field's value.
/// @li @ref comms::protocol::MsgSizeLayer::doWriteField() "doWriteField()" - Member
/// function that is invoked to write field's value.
/// @li @ref comms::protocol::MsgSizeLayer::doFieldLength() "doFieldLength()" - Member
/// function that is invoked to calculate serialization length of the field.
/// @li @ref comms::protocol::MsgSizeLayer::getRemainingSizeFromField() "getRemainingSizeFromField()" -
/// Member function that is invoked to retrieve the
/// remaining length out of the provided field object.
Expand Down
11 changes: 10 additions & 1 deletion comms/doc/page_custom_sync_prefix_layer.dox
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,16 @@
/// It is done by passing @ref comms::option::def::ExtendingClass extension option with
/// the type of the layer class being defined to the @ref comms::protocol::SyncPrefixLayer.
///
/// The extending class is expected to define the listed below functions.
/// The extending class can customize the default behavior by overriding
/// the listed below functions. They do not
/// necessarily need to be @b static, accessing inner private state of the layer object
/// is also acceptable.
/// @li @ref comms::protocol::SyncPrefixLayer::doReadField() "doReadField()" - Member
/// function that is invoked to read field's value.
/// @li @ref comms::protocol::SyncPrefixLayer::doWriteField() "doWriteField()" - Member
/// function that is invoked to write field's value.
/// @li @ref comms::protocol::SyncPrefixLayer::doFieldLength() "doFieldLength()" - Member
/// function that is invoked to calculate serialization length of the field.
/// @li @ref comms::protocol::SyncPrefixLayer::verifyFieldValue() "verifyFieldValue()" -
/// Member function that is invoked to check the validity of the read prefix.
/// @li @ref comms::protocol::SyncPrefixLayer::prepareFieldForWrite() "prepareFieldForWrite()" -
Expand Down
9 changes: 8 additions & 1 deletion comms/doc/page_custom_transport_value_layer.dox
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,16 @@
/// It is done by passing @ref comms::option::def::ExtendingClass extension option with
/// the type of the layer class being defined to the @ref comms::protocol::TransportValueLayer.
///
/// The extending class is expected to define the listed below functions. They do not
/// The extending class can customize the default behavior by overriding
/// the listed below functions. They do not
/// necessarily need to be @b static, accessing inner private state of the layer object
/// is also acceptable.
/// @li @ref comms::protocol::TransportValueLayer::doReadField() "doReadField()" - Member
/// function that is invoked to read field's value.
/// @li @ref comms::protocol::TransportValueLayer::doWriteField() "doWriteField()" - Member
/// function that is invoked to write field's value.
/// @li @ref comms::protocol::TransportValueLayer::doFieldLength() "doFieldLength()" - Member
/// function that is invoked to calculate serialization length of the field.
/// @li @ref comms::protocol::TransportValueLayer::reassignFieldValue() "reassignFieldValue()" -
/// Member function that is invoked right before reading
/// message payload. It's responsibility is to re-assign the transport field value to
Expand Down
2 changes: 2 additions & 0 deletions comms/include/comms/field/ArrayList.h
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,8 @@ class ArrayList : private details::ArrayListBase<TFieldBase, TElement, TOptions.
"comms::option::def::FixedBitLength option is not applicable to ArrayList field");
static_assert(!ParsedOptions::HasVarLengthLimits,
"comms::option::def::VarLength option is not applicable to ArrayList field");
static_assert(!ParsedOptions::HasAvailableLengthLimit,
"comms::option::def::AvailableLengthLimit option is not applicable to ArrayList field");
static_assert(!ParsedOptions::HasScalingRatio,
"comms::option::def::ScalingRatio option is not applicable to ArrayList field");
static_assert(!ParsedOptions::HasUnits,
Expand Down
2 changes: 2 additions & 0 deletions comms/include/comms/field/Bitfield.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,8 @@ class Bitfield : private
"comms::option::def::FixedBitLength option is not applicable to Bitfield field");
static_assert(!ParsedOptions::HasVarLengthLimits,
"comms::option::def::VarLength option is not applicable to Bitfield field");
static_assert(!ParsedOptions::HasAvailableLengthLimit,
"comms::option::def::AvailableLengthLimit option is not applicable to Bitfield field");
static_assert(!ParsedOptions::HasSequenceElemLengthForcing,
"comms::option::def::SequenceElemLengthForcingEnabled option is not applicable to Bitfield field");
static_assert(!ParsedOptions::HasSequenceSizeForcing,
Expand Down
2 changes: 2 additions & 0 deletions comms/include/comms/field/BitmaskValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,8 @@ class BitmaskValue : public TFieldBase
"comms::option::def::NumValueSerOffset option is not applicable to BitmaskValue field");
static_assert(!ParsedOptions::HasVarLengthLimits,
"comms::option::def::VarLength option is not applicable to BitmaskValue field");
static_assert(!ParsedOptions::HasAvailableLengthLimit,
"comms::option::def::AvailableLengthLimit option is not applicable to BitmaskValue field");
static_assert(!ParsedOptions::HasSequenceElemLengthForcing,
"comms::option::def::SequenceElemLengthForcingEnabled option is not applicable to BitmaskValue field");
static_assert(!ParsedOptions::HasSequenceSizeForcing,
Expand Down
2 changes: 2 additions & 0 deletions comms/include/comms/field/Bundle.h
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,8 @@ class Bundle : private details::AdaptBasicFieldT<basic::Bundle<TFieldBase, TMemb
"comms::option::def::FixedBitLength option is not applicable to Bundle field");
static_assert(!ParsedOptions::HasVarLengthLimits,
"comms::option::def::VarLength option is not applicable to Bundle field");
static_assert(!ParsedOptions::HasAvailableLengthLimit,
"comms::option::def::AvailableLengthLimit option is not applicable to Bundle field");
static_assert(!ParsedOptions::HasSequenceElemLengthForcing,
"comms::option::def::SequenceElemLengthForcingEnabled option is not applicable to Bundle field");
static_assert(!ParsedOptions::HasSequenceSizeForcing,
Expand Down
19 changes: 19 additions & 0 deletions comms/include/comms/field/EnumValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,25 @@ class EnumValue : private details::AdaptBasicFieldT<basic::EnumValue<TFieldBase,
return BaseImpl::setVersion(version);
}

/// @brief Force serialization length of the field.
/// @details Available only when @ref comms::option::def::AvailableLengthLimit
/// option is used for field definition.
/// @param[in] len Forced serialization length.
/// @li 0 means default serialization length determined by the storage type
/// @li positive value means limit of the serialization length
/// @li negative value means the length is determined by the stored value
void setForcedLength(int len)
{
BaseImpl::setForcedLength(len);
}

/// @brief Get forced serialization length
/// @see @ref setForcedLength()
int getForcedLength() const
{
return BaseImpl::getForcedLength();
}

protected:
using BaseImpl::readData;
using BaseImpl::writeData;
Expand Down
2 changes: 2 additions & 0 deletions comms/include/comms/field/FloatValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ class FloatValue : private details::AdaptBasicFieldT<basic::FloatValue<TFieldBas
private:
static_assert(!ParsedOptions::HasVarLengthLimits,
"comms::option::def::VarLength option is not applicable to FloatValue field");
static_assert(!ParsedOptions::HasAvailableLengthLimit,
"comms::option::def::AvailableLengthLimit option is not applicable to FloatValue field");
static_assert(!ParsedOptions::HasSequenceElemLengthForcing,
"comms::option::def::SequenceElemLengthForcingEnabled option is not applicable to FloatValue field");
static_assert(!ParsedOptions::HasSequenceSizeForcing,
Expand Down
19 changes: 19 additions & 0 deletions comms/include/comms/field/IntValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,25 @@ class IntValue : private details::AdaptBasicFieldT<basic::IntValue<TFieldBase, T
return BaseImpl::setVersion(version);
}

/// @brief Force serialization length of the field.
/// @details Available only when @ref comms::option::def::AvailableLengthLimit
/// option is used for field definition.
/// @param[in] len Forced serialization length.
/// @li 0 means default serialization length determined by the storage type
/// @li positive value means limit of the serialization length
/// @li negative value means the length is determined by the stored value
void setForcedLength(int len)
{
BaseImpl::setForcedLength(len);
}

/// @brief Get forced serialization length
/// @see @ref setForcedLength()
int getForcedLength() const
{
return BaseImpl::getForcedLength();
}

protected:
using BaseImpl::readData;
using BaseImpl::writeData;
Expand Down
2 changes: 2 additions & 0 deletions comms/include/comms/field/String.h
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,8 @@ class String : private details::StringBase<TFieldBase, TOptions...>
"comms::option::def::FixedBitLength option is not applicable to String field");
static_assert(!ParsedOptions::HasVarLengthLimits,
"comms::option::def::VarLength option is not applicable to String field");
static_assert(!ParsedOptions::HasAvailableLengthLimit,
"comms::option::def::AvailableLengthLimit option is not applicable to String field");
static_assert(!ParsedOptions::HasScalingRatio,
"comms::option::def::ScalingRatio option is not applicable to String field");
static_assert(!ParsedOptions::HasUnits,
Expand Down
2 changes: 2 additions & 0 deletions comms/include/comms/field/Variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,8 @@ class Variant : private
"comms::option::def::FixedBitLength option is not applicable to Variant field");
static_assert(!ParsedOptions::HasVarLengthLimits,
"comms::option::def::VarLength option is not applicable to Variant field");
static_assert(!ParsedOptions::HasAvailableLengthLimit,
"comms::option::def::AvailableLengthLimit option is not applicable to Variant field");
static_assert(!ParsedOptions::HasSequenceElemLengthForcing,
"comms::option::def::SequenceElemLengthForcingEnabled option is not applicable to Variant field");
static_assert(!ParsedOptions::HasSequenceSizeForcing,
Expand Down
Loading

0 comments on commit 4263ad5

Please sign in to comment.