forked from compAIR/libcreate
Replace boost features with C++11 equivalents (#58)
* Replace boost features with C++11 equivalents Signed-off-by: Jacob Perron <jacob@openrobotics.org> * Include <cmath> in util.h Needed for std::abs Signed-off-by: Jacob Perron <jacob@openrobotics.org>
This commit is contained in:
parent
850b011a55
commit
2b9591f0f7
17 changed files with 95 additions and 87 deletions
10
src/data.cpp
10
src/data.cpp
|
@ -1,6 +1,6 @@
|
|||
#include "create/data.h"
|
||||
|
||||
#define ADD_PACKET(id,nbytes,info,enabledVersion) if ((enabledVersion) & version) packets[id]=boost::make_shared<Packet>(nbytes,info)
|
||||
#define ADD_PACKET(id,nbytes,info,enabledVersion) if ((enabledVersion) & version) packets[id]=std::make_shared<Packet>(nbytes,info)
|
||||
|
||||
namespace create {
|
||||
|
||||
|
@ -45,7 +45,7 @@ namespace create {
|
|||
ADD_PACKET(ID_STASIS, 1, "stasis", V_3);
|
||||
|
||||
totalDataBytes = 0;
|
||||
for (std::map<uint8_t, boost::shared_ptr<Packet> >::iterator it = packets.begin();
|
||||
for (std::map<uint8_t, std::shared_ptr<Packet> >::iterator it = packets.begin();
|
||||
it != packets.end();
|
||||
++it) {
|
||||
ids.push_back(it->first);
|
||||
|
@ -62,15 +62,15 @@ namespace create {
|
|||
return false;
|
||||
}
|
||||
|
||||
boost::shared_ptr<Packet> Data::getPacket(uint8_t id) {
|
||||
std::shared_ptr<Packet> Data::getPacket(uint8_t id) {
|
||||
if (isValidPacketID(id)) {
|
||||
return packets[id];
|
||||
}
|
||||
return boost::shared_ptr<Packet>();
|
||||
return std::shared_ptr<Packet>();
|
||||
}
|
||||
|
||||
void Data::validateAll() {
|
||||
for (std::map<uint8_t, boost::shared_ptr<Packet> >::iterator it = packets.begin();
|
||||
for (std::map<uint8_t, std::shared_ptr<Packet> >::iterator it = packets.begin();
|
||||
it != packets.end();
|
||||
++it) {
|
||||
it->second->validate();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue