Removed sstream in OTR

This commit is contained in:
Pavel Kirienko
2014-04-10 11:50:14 +04:00
parent d7ec6918be
commit 266e95127b
3 changed files with 26 additions and 12 deletions
@@ -6,7 +6,6 @@
#include <cassert>
#include <limits>
#include <string>
#include <uavcan/stdint.hpp>
#include <uavcan/impl_constants.hpp>
#include <uavcan/util/compile_time.hpp>
@@ -5,7 +5,7 @@
#pragma once
#include <cassert>
#include <sstream>
#include <string>
#include <uavcan/stdint.hpp>
#include <uavcan/impl_constants.hpp>
#include <uavcan/map.hpp>
@@ -34,8 +34,8 @@ public:
, destination_node_id_(destination_node_id)
{
assert((transfer_type == TransferTypeMessageBroadcast) == destination_node_id.isBroadcast());
/* Service response transfers must use the same Transfer ID as matching service request transfer,
/*
* Service response transfers must use the same Transfer ID as matching service request transfer,
* so this registry is not applicable for service response transfers at all.
*/
assert(transfer_type != TransferTypeServiceResponse);
@@ -52,14 +52,7 @@ public:
(destination_node_id_ == rhs.destination_node_id_);
}
std::string toString() const
{
std::ostringstream os;
os << "dtid=" << int(data_type_id_.get())
<< " tt=" << int(transfer_type_)
<< " dnid=" << int(destination_node_id_.get());
return os.str();
}
std::string toString() const;
};
UAVCAN_PACKED_END
@@ -0,0 +1,22 @@
/*
* Copyright (C) 2014 Pavel Kirienko <pavel.kirienko@gmail.com>
*/
#include <cstdio>
#include <uavcan/transport/outgoing_transfer_registry.hpp>
namespace uavcan
{
/*
* OutgoingTransferRegistryKey
*/
std::string OutgoingTransferRegistryKey::toString() const
{
using namespace std;
char buf[40];
(void)snprintf(buf, sizeof(buf), "dtid=%u tt=%u dnid=%u",
int(data_type_id_.get()), int(transfer_type_), int(destination_node_id_.get()));
return std::string(buf);
}
}