Skip to content

Commit

Permalink
Refs eProsima#2080. Update XML example
Browse files Browse the repository at this point in the history
  • Loading branch information
JavierIH committed Jun 22, 2017
1 parent 188f994 commit 0eb15be
Showing 1 changed file with 3 additions and 22 deletions.
25 changes: 3 additions & 22 deletions examples/C++/XMLProfiles/XMLProfilesExamplePubSubTypes.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

/*!
/*!
* @file XMLProfilesExamplePubSubTypes.cpp
* This header file contains the implementation of the serialization functions.
*
Expand Down Expand Up @@ -45,16 +45,7 @@ bool XMLProfilesExamplePubSubType::serialize(void *data, SerializedPayload_t *pa
payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE;
// Serialize encapsulation
ser.serialize_encapsulation();

try
{
p_type->serialize(ser); // Serialize the object:
}
catch(eprosima::fastcdr::exception::NotEnoughMemoryException& exception)
{
return false;
}

p_type->serialize(ser); // Serialize the object:
payload->length = (uint32_t)ser.getSerializedDataLength(); //Get the serialized length
return true;
}
Expand All @@ -67,16 +58,7 @@ bool XMLProfilesExamplePubSubType::deserialize(SerializedPayload_t* payload, voi
// Deserialize encapsulation.
deser.read_encapsulation();
payload->encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE;

try
{
p_type->deserialize(deser); //Deserialize the object:
}
catch(eprosima::fastcdr::exception::NotEnoughMemoryException& exception)
{
return false;
}

p_type->deserialize(deser); //Deserialize the object:
return true;
}

Expand Down Expand Up @@ -117,4 +99,3 @@ bool XMLProfilesExamplePubSubType::getKey(void *data, InstanceHandle_t* handle)
}
return true;
}

0 comments on commit 0eb15be

Please sign in to comment.