Marshalling headers reorganized

This commit is contained in:
Pavel Kirienko 2014-02-22 21:56:24 +04:00
parent 056791619e
commit e2e4e420f1
9 changed files with 37 additions and 43 deletions

View File

@ -1,12 +0,0 @@
/*
* Copyright (C) 2014 Pavel Kirienko <pavel.kirienko@gmail.com>
*/
#pragma once
namespace uavcan
{
enum CastMode { CastModeSaturate, CastModeTruncate };
}

View File

@ -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

View File

@ -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
{

View File

@ -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
{

View 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;
};
}

View File

@ -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>

View File

@ -3,7 +3,6 @@
*/
#include <gtest/gtest.h>
#include <uavcan/internal/marshalling/float_spec.hpp>
#include <uavcan/internal/marshalling/types.hpp>

View File

@ -3,7 +3,6 @@
*/
#include <gtest/gtest.h>
#include <uavcan/internal/marshalling/integer_spec.hpp>
#include <uavcan/internal/marshalling/types.hpp>

View File

@ -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>