@@ -82,21 +82,21 @@ bool HelloWorldPubSubType::deserialize(
8282 SerializedPayload_t* payload,
8383 void * data)
8484{
85- // Convert DATA to pointer of your type
86- HelloWorld* p_type = static_cast <HelloWorld*>(data);
85+ try
86+ {
87+ // Convert DATA to pointer of your type
88+ HelloWorld* p_type = static_cast <HelloWorld*>(data);
8789
88- // Object that manages the raw buffer.
89- eprosima::fastcdr::FastBuffer fastbuffer (reinterpret_cast <char *>(payload->data ), payload->length );
90+ // Object that manages the raw buffer.
91+ eprosima::fastcdr::FastBuffer fastbuffer (reinterpret_cast <char *>(payload->data ), payload->length );
9092
91- // Object that deserializes the data.
92- eprosima::fastcdr::Cdr deser (fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN , eprosima::fastcdr::Cdr::DDS_CDR );
93+ // Object that deserializes the data.
94+ eprosima::fastcdr::Cdr deser (fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN , eprosima::fastcdr::Cdr::DDS_CDR );
9395
94- // Deserialize encapsulation.
95- deser.read_encapsulation ();
96- payload->encapsulation = deser.endianness () == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE ;
96+ // Deserialize encapsulation.
97+ deser.read_encapsulation ();
98+ payload->encapsulation = deser.endianness () == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE ;
9799
98- try
99- {
100100 // Deserialize the object.
101101 p_type->deserialize (deser);
102102 }
0 commit comments