mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-01 01:11:36 +08:00
YAML streaming for generated types
This commit is contained in:
@@ -102,6 +102,7 @@ public:
|
||||
enum { BitLen = BitLen_ };
|
||||
enum { MinBitLen = BitLen };
|
||||
enum { MaxBitLen = BitLen };
|
||||
enum { IsPrimitive = 1 };
|
||||
|
||||
typedef typename NativeFloatSelector<BitLen>::Type StorageType;
|
||||
|
||||
@@ -157,4 +158,17 @@ private:
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template <unsigned int BitLen, CastMode CastMode>
|
||||
struct YamlStreamer<FloatSpec<BitLen, CastMode> >
|
||||
{
|
||||
typedef typename FloatSpec<BitLen, CastMode>::StorageType StorageType;
|
||||
|
||||
template <typename Stream>
|
||||
static void stream(Stream& s, const StorageType value, int)
|
||||
{
|
||||
s << value;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user