mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-22 01:50:34 +08:00
Marshalling headers reorganized
This commit is contained in:
@@ -1,12 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2014 Pavel Kirienko <pavel.kirienko@gmail.com>
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
namespace uavcan
|
|
||||||
{
|
|
||||||
|
|
||||||
enum CastMode { CastModeSaturate, CastModeTruncate };
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
#include <limits>
|
#include <limits>
|
||||||
#include <math.h> // Needed for isfinite
|
#include <math.h> // Needed for isfinite
|
||||||
#include <uavcan/internal/util.hpp>
|
#include <uavcan/internal/util.hpp>
|
||||||
#include <uavcan/internal/marshalling/cast_mode.hpp>
|
#include <uavcan/internal/marshalling/type_util.hpp>
|
||||||
#include <uavcan/internal/marshalling/integer_spec.hpp>
|
#include <uavcan/internal/marshalling/integer_spec.hpp>
|
||||||
|
|
||||||
namespace uavcan
|
namespace uavcan
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
#include <limits>
|
#include <limits>
|
||||||
#include <uavcan/internal/util.hpp>
|
#include <uavcan/internal/util.hpp>
|
||||||
#include <uavcan/internal/marshalling/scalar_codec.hpp>
|
#include <uavcan/internal/marshalling/scalar_codec.hpp>
|
||||||
#include <uavcan/internal/marshalling/cast_mode.hpp>
|
#include <uavcan/internal/marshalling/type_util.hpp>
|
||||||
|
|
||||||
namespace uavcan
|
namespace uavcan
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <uavcan/internal/impl_constants.hpp>
|
#include <uavcan/internal/impl_constants.hpp>
|
||||||
#include <uavcan/internal/util.hpp>
|
#include <uavcan/internal/util.hpp>
|
||||||
#include <uavcan/internal/marshalling/types.hpp>
|
#include <uavcan/internal/marshalling/type_util.hpp>
|
||||||
|
|
||||||
namespace uavcan
|
namespace uavcan
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2014 Pavel Kirienko <pavel.kirienko@gmail.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <uavcan/internal/util.hpp>
|
||||||
|
|
||||||
|
namespace uavcan
|
||||||
|
{
|
||||||
|
|
||||||
|
enum CastMode { CastModeSaturate, CastModeTruncate };
|
||||||
|
|
||||||
|
|
||||||
|
template <typename T, typename Enable = void>
|
||||||
|
struct StorageTypeImpl { typedef T Type; };
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
struct StorageTypeImpl<T, typename EnableIfType<typename T::StorageType>::Type>
|
||||||
|
{
|
||||||
|
typedef typename T::StorageType Type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
class StorageType : public T
|
||||||
|
{
|
||||||
|
StorageType();
|
||||||
|
public:
|
||||||
|
typedef typename StorageTypeImpl<T>::Type Type;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
@@ -4,28 +4,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <uavcan/internal/util.hpp>
|
|
||||||
#include <uavcan/internal/marshalling/integer_spec.hpp>
|
#include <uavcan/internal/marshalling/integer_spec.hpp>
|
||||||
#include <uavcan/internal/marshalling/float_spec.hpp>
|
#include <uavcan/internal/marshalling/float_spec.hpp>
|
||||||
|
#include <uavcan/internal/marshalling/static_array.hpp>
|
||||||
namespace uavcan
|
#include <uavcan/internal/marshalling/type_util.hpp>
|
||||||
{
|
|
||||||
|
|
||||||
template <typename T, typename Enable = void>
|
|
||||||
struct StorageTypeImpl { typedef T Type; };
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
struct StorageTypeImpl<T, typename EnableIfType<typename T::StorageType>::Type>
|
|
||||||
{
|
|
||||||
typedef typename T::StorageType Type;
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
class StorageType : public T
|
|
||||||
{
|
|
||||||
StorageType();
|
|
||||||
public:
|
|
||||||
typedef typename StorageTypeImpl<T>::Type Type;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include <uavcan/internal/marshalling/float_spec.hpp>
|
|
||||||
#include <uavcan/internal/marshalling/types.hpp>
|
#include <uavcan/internal/marshalling/types.hpp>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include <uavcan/internal/marshalling/integer_spec.hpp>
|
|
||||||
#include <uavcan/internal/marshalling/types.hpp>
|
#include <uavcan/internal/marshalling/types.hpp>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include <uavcan/internal/marshalling/static_array.hpp>
|
|
||||||
#include <uavcan/internal/marshalling/integer_spec.hpp>
|
|
||||||
#include <uavcan/internal/marshalling/float_spec.hpp>
|
|
||||||
#include <uavcan/internal/marshalling/types.hpp>
|
#include <uavcan/internal/marshalling/types.hpp>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user