mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-20 10:09:06 +08:00
Marshalling headers reorganized
This commit is contained in:
parent
056791619e
commit
e2e4e420f1
@ -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 <math.h> // Needed for isfinite
|
||||
#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>
|
||||
|
||||
namespace uavcan
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
#include <limits>
|
||||
#include <uavcan/internal/util.hpp>
|
||||
#include <uavcan/internal/marshalling/scalar_codec.hpp>
|
||||
#include <uavcan/internal/marshalling/cast_mode.hpp>
|
||||
#include <uavcan/internal/marshalling/type_util.hpp>
|
||||
|
||||
namespace uavcan
|
||||
{
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
#include <stdexcept>
|
||||
#include <uavcan/internal/impl_constants.hpp>
|
||||
#include <uavcan/internal/util.hpp>
|
||||
#include <uavcan/internal/marshalling/types.hpp>
|
||||
#include <uavcan/internal/marshalling/type_util.hpp>
|
||||
|
||||
namespace uavcan
|
||||
{
|
||||
|
||||
32
libuavcan/include/uavcan/internal/marshalling/type_util.hpp
Normal file
32
libuavcan/include/uavcan/internal/marshalling/type_util.hpp
Normal file
@ -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
|
||||
|
||||
#include <uavcan/internal/util.hpp>
|
||||
#include <uavcan/internal/marshalling/integer_spec.hpp>
|
||||
#include <uavcan/internal/marshalling/float_spec.hpp>
|
||||
|
||||
namespace uavcan
|
||||
{
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
}
|
||||
#include <uavcan/internal/marshalling/static_array.hpp>
|
||||
#include <uavcan/internal/marshalling/type_util.hpp>
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
*/
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include <uavcan/internal/marshalling/float_spec.hpp>
|
||||
#include <uavcan/internal/marshalling/types.hpp>
|
||||
|
||||
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
*/
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include <uavcan/internal/marshalling/integer_spec.hpp>
|
||||
#include <uavcan/internal/marshalling/types.hpp>
|
||||
|
||||
|
||||
|
||||
@ -3,9 +3,6 @@
|
||||
*/
|
||||
|
||||
#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>
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user