command.cpp
Go to the documentation of this file.
1 
28 #include <boost/serialization/access.hpp>
29 #include <boost/serialization/nvp.hpp>
30 #include <boost/serialization/split_free.hpp>
32 
34 
35 namespace tesseract_environment
36 {
38 
39 template <class Archive>
40 void save(Archive& ar, const CommandType& g, const unsigned int /*version*/)
41 {
42  int value = static_cast<int>(g);
43  ar& BOOST_SERIALIZATION_NVP(value);
44 }
45 
46 template <class Archive>
47 void load(Archive& ar, CommandType& g, const unsigned int /*version*/)
48 {
49  int value = 0;
50  ar& BOOST_SERIALIZATION_NVP(value);
51  g = static_cast<CommandType>(value);
52 }
53 
54 template <class Archive>
55 void serialize(Archive& ar, CommandType& g, const unsigned int version)
56 {
57  split_free(ar, g, version);
58 }
59 
60 bool Command::operator==(const Command& rhs) const
61 {
62  bool equal = true;
63  equal &= type_ == rhs.type_;
64  return equal;
65 }
66 bool Command::operator!=(const Command& rhs) const { return !operator==(rhs); } // LCOV_EXCL_LINE
67 
68 template <class Archive>
69 void Command::serialize(Archive& ar, const unsigned int /*version*/)
70 {
71  ar& BOOST_SERIALIZATION_NVP(type_);
72 }
73 } // namespace tesseract_environment
74 
77 BOOST_CLASS_EXPORT_IMPLEMENT(tesseract_environment::Command)
tesseract_environment::Command::operator!=
bool operator!=(const Command &rhs) const
Definition: command.cpp:66
tesseract_environment::Command::operator==
bool operator==(const Command &rhs) const
Definition: command.cpp:60
tesseract_environment
Definition: command.h:45
tesseract_environment::Command
Definition: command.h:83
TESSERACT_SERIALIZE_ARCHIVES_INSTANTIATE
#define TESSERACT_SERIALIZE_ARCHIVES_INSTANTIATE(Type)
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#define TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
command.h
This contains classes for recording operations applied to the environment for tracking changes....
tesseract_environment::Command::type_
CommandType type_
Definition: command.h:102
tesseract_environment::serialize
void serialize(Archive &ar, CommandType &g, const unsigned int version)
Definition: command.cpp:55
serialization.h
tesseract_environment::Command::serialize
void serialize(Archive &ar, const unsigned int version)
Definition: command.cpp:69
TESSERACT_COMMON_IGNORE_WARNINGS_POP
type
type
tesseract_environment::load
void load(Archive &ar, CommandType &g, const unsigned int version)
Definition: command.cpp:47
tesseract_environment::Command::Command
Command(CommandType type=CommandType::UNINITIALIZED)
Definition: command.cpp:37
macros.h
tesseract_environment::CommandType
CommandType
Definition: command.h:47
tesseract_environment::save
void save(Archive &ar, const CommandType &g, const unsigned int version)
Definition: command.cpp:40


tesseract_environment
Author(s): Levi Armstrong
autogenerated on Sun May 18 2025 03:02:21