mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 13:43:33 +08:00
Automated style fixes in order to bring the code a little bit closer to compliance with MISRA C++ rules. No changes in logic.
This commit is contained in:
@@ -11,7 +11,7 @@ namespace uavcan
|
||||
{
|
||||
|
||||
template <typename DataType_,
|
||||
typename Callback = void(*)(const ReceivedDataStructure<DataType_>&),
|
||||
typename Callback = void (*)(const ReceivedDataStructure<DataType_>&),
|
||||
unsigned int NumStaticReceivers = 2,
|
||||
unsigned int NumStaticBufs = 1>
|
||||
class Subscriber : public GenericSubscriber<DataType_, DataType_,
|
||||
@@ -28,17 +28,21 @@ class Subscriber : public GenericSubscriber<DataType_, DataType_,
|
||||
void handleReceivedDataStruct(ReceivedDataStructure<DataType_>& msg)
|
||||
{
|
||||
if (try_implicit_cast<bool>(callback_, true))
|
||||
{
|
||||
callback_(msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
handleFatalError("Invalid subscriber callback");
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
typedef DataType_ DataType;
|
||||
|
||||
explicit Subscriber(INode& node)
|
||||
: BaseType(node)
|
||||
, callback_()
|
||||
: BaseType(node)
|
||||
, callback_()
|
||||
{
|
||||
StaticAssert<DataTypeKind(DataType::DataTypeKind) == DataTypeKindMessage>::check();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user