Skip to content

Commit

Permalink
Old optional approach
Browse files Browse the repository at this point in the history
A
  • Loading branch information
pablogs9 committed Apr 19, 2021
1 parent 56890dc commit 3d6786d
Show file tree
Hide file tree
Showing 3 changed files with 304 additions and 88 deletions.
17 changes: 0 additions & 17 deletions include/uxr/agent/types/Optional.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#define _UXR_AGENT_TYPES_OPTIONAL_HPP_

#include <utility>
#include <fastcdr/Cdr.h>

namespace eprosima {

Expand Down Expand Up @@ -87,22 +86,6 @@ class Optional
return present_;
}

void serialize(eprosima::fastcdr::Cdr& cdr) const
{
cdr << present_;
if(present_){
cdr << (data_);
}
}

void deserialize(eprosima::fastcdr::Cdr& cdr) const
{
cdr >> present_;
if(present_){
cdr >> (data_);
}
}

private:
bool present_ = false;
T data_;
Expand Down
Loading

0 comments on commit 3d6786d

Please sign in to comment.