Skip to content

Commit 5b06df7

Browse files
committed
Adding transaction deserializer
1 parent 16486aa commit 5b06df7

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

fuse_core/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ add_library(
5151
src/serialization.cpp
5252
# src/timestamp_manager.cpp
5353
src/transaction.cpp
54-
# src/transaction_deserializer.cpp
54+
src/transaction_deserializer.cpp
5555
src/uuid.cpp
5656
src/variable.cpp
5757
)

fuse_core/include/fuse_core/transaction_deserializer.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@
3434
#ifndef FUSE_CORE_TRANSACTION_DESERIALIZER_H
3535
#define FUSE_CORE_TRANSACTION_DESERIALIZER_H
3636

37-
#include <fuse_msgs/SerializedTransaction.h>
37+
#include <fuse_msgs/msg/serialized_transaction.hpp>
3838
#include <fuse_core/constraint.h>
3939
#include <fuse_core/transaction.h>
4040
#include <fuse_core/variable.h>
41-
#include <pluginlib/class_loader.h>
41+
#include <pluginlib/class_loader.hpp>
4242

4343

4444
namespace fuse_core
@@ -47,7 +47,7 @@ namespace fuse_core
4747
/**
4848
* @brief Serialize a transaction into a message
4949
*/
50-
void serializeTransaction(const fuse_core::Transaction& transaction, fuse_msgs::SerializedTransaction& msg);
50+
void serializeTransaction(const fuse_core::Transaction& transaction, fuse_msgs::msg::SerializedTransaction& msg);
5151

5252
/**
5353
* @brief Deserialize a Transaction
@@ -73,7 +73,7 @@ class TransactionDeserializer
7373
* @param[IN] msg The SerializedTransaction message to be deserialized
7474
* @return A fuse Transaction object
7575
*/
76-
fuse_core::Transaction deserialize(const fuse_msgs::SerializedTransaction::ConstPtr& msg) const;
76+
fuse_core::Transaction deserialize(const fuse_msgs::msg::SerializedTransaction::ConstSharedPtr& msg) const;
7777

7878
/**
7979
* @brief Deserialize a SerializedTransaction message into a fuse Transaction object.
@@ -84,7 +84,7 @@ class TransactionDeserializer
8484
* @param[IN] msg The SerializedTransaction message to be deserialized
8585
* @return A fuse Transaction object
8686
*/
87-
fuse_core::Transaction deserialize(const fuse_msgs::SerializedTransaction& msg) const;
87+
fuse_core::Transaction deserialize(const fuse_msgs::msg::SerializedTransaction& msg) const;
8888

8989
private:
9090
pluginlib::ClassLoader<fuse_core::Variable> variable_loader_; //!< Pluginlib class loader for Variable types

fuse_core/src/transaction_deserializer.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@
3434
#include <fuse_core/transaction_deserializer.h>
3535

3636
#include <fuse_core/serialization.h>
37-
#include <fuse_msgs/SerializedTransaction.h>
37+
#include <fuse_msgs/msg/serialized_transaction.hpp>
3838

3939
#include <boost/iostreams/stream.hpp>
4040

4141

4242
namespace fuse_core
4343
{
4444

45-
void serializeTransaction(const fuse_core::Transaction& transaction, fuse_msgs::SerializedTransaction& msg)
45+
void serializeTransaction(const fuse_core::Transaction& transaction, fuse_msgs::msg::SerializedTransaction& msg)
4646
{
4747
// Serialize the transaction into the msg.data field
4848
boost::iostreams::stream<fuse_core::MessageBufferStreamSink> stream(msg.data);
@@ -75,12 +75,12 @@ TransactionDeserializer::TransactionDeserializer() :
7575
}
7676
}
7777

78-
fuse_core::Transaction TransactionDeserializer::deserialize(const fuse_msgs::SerializedTransaction::ConstPtr& msg) const
78+
fuse_core::Transaction TransactionDeserializer::deserialize(const fuse_msgs::msg::SerializedTransaction::ConstSharedPtr& msg) const
7979
{
8080
return deserialize(*msg);
8181
}
8282

83-
fuse_core::Transaction TransactionDeserializer::deserialize(const fuse_msgs::SerializedTransaction& msg) const
83+
fuse_core::Transaction TransactionDeserializer::deserialize(const fuse_msgs::msg::SerializedTransaction& msg) const
8484
{
8585
// The Transaction object is not a plugin and has no derived types. That makes it much easier to use.
8686
auto transaction = fuse_core::Transaction();

0 commit comments

Comments
 (0)