Rename CSerAction* to Action*

This allows new code, added in the next commit, to conform to the coding
guideline: No C-prefix for class names.
This commit is contained in:
MarcoFalke committed 2023-08-28 17:48:15 +02:00
1 parent aaaa3fa947
commit fac42e9d35
1 file changed
+12 -21
+12 -21
View File
@@ -188,11 +188,11 @@ const Out& AsBase(const In& x)
*/ */
#define FORMATTER_METHODS(cls, obj) \ #define FORMATTER_METHODS(cls, obj) \
template<typename Stream> \ template<typename Stream> \
static void Ser(Stream& s, const cls& obj) { SerializationOps(obj, s, CSerActionSerialize()); } \ static void Ser(Stream& s, const cls& obj) { SerializationOps(obj, s, ActionSerialize{}); } \
template<typename Stream> \ template<typename Stream> \
static void Unser(Stream& s, cls& obj) { SerializationOps(obj, s, CSerActionUnserialize()); } \ static void Unser(Stream& s, cls& obj) { SerializationOps(obj, s, ActionUnserialize{}); } \
template<typename Stream, typename Type, typename Operation> \ template<typename Stream, typename Type, typename Operation> \
static inline void SerializationOps(Type& obj, Stream& s, Operation ser_action) \ static void SerializationOps(Type& obj, Stream& s, Operation ser_action)
/** /**
* Implement the Serialize and Unserialize methods by delegating to a single templated * Implement the Serialize and Unserialize methods by delegating to a single templated
@@ -953,26 +953,17 @@ void Unserialize(Stream& is, std::shared_ptr<const T>& p)
} }
/** /**
* Support for SERIALIZE_METHODS and READWRITE macro. * Support for all macros providing or using the ser_action parameter of the SerializationOps method.
*/ */
struct CSerActionSerialize struct ActionSerialize {
{
constexpr bool ForRead() const { return false; } constexpr bool ForRead() const { return false; }
}; };
struct CSerActionUnserialize struct ActionUnserialize {
{
constexpr bool ForRead() const { return true; } constexpr bool ForRead() const { return true; }
}; };
/* ::GetSerializeSize implementations /* ::GetSerializeSize implementations
* *
* Computing the serialized size of objects is done through a special stream * Computing the serialized size of objects is done through a special stream
@@ -1031,36 +1022,36 @@ inline void UnserializeMany(Stream& s, Args&&... args)
} }
template<typename Stream, typename... Args> template<typename Stream, typename... Args>
inline void SerReadWriteMany(Stream& s, CSerActionSerialize ser_action, const Args&... args) inline void SerReadWriteMany(Stream& s, ActionSerialize ser_action, const Args&... args)
{ {
::SerializeMany(s, args...); ::SerializeMany(s, args...);
} }
template<typename Stream, typename... Args> template<typename Stream, typename... Args>
inline void SerReadWriteMany(Stream& s, CSerActionUnserialize ser_action, Args&&... args) inline void SerReadWriteMany(Stream& s, ActionUnserialize ser_action, Args&&... args)
{ {
::UnserializeMany(s, args...); ::UnserializeMany(s, args...);
} }
template<typename Stream, typename Type, typename Fn> template<typename Stream, typename Type, typename Fn>
inline void SerRead(Stream& s, CSerActionSerialize ser_action, Type&&, Fn&&) inline void SerRead(Stream& s, ActionSerialize ser_action, Type&&, Fn&&)
{ {
} }
template<typename Stream, typename Type, typename Fn> template<typename Stream, typename Type, typename Fn>
inline void SerRead(Stream& s, CSerActionUnserialize ser_action, Type&& obj, Fn&& fn) inline void SerRead(Stream& s, ActionUnserialize ser_action, Type&& obj, Fn&& fn)
{ {
fn(s, std::forward<Type>(obj)); fn(s, std::forward<Type>(obj));
} }
template<typename Stream, typename Type, typename Fn> template<typename Stream, typename Type, typename Fn>
inline void SerWrite(Stream& s, CSerActionSerialize ser_action, Type&& obj, Fn&& fn) inline void SerWrite(Stream& s, ActionSerialize ser_action, Type&& obj, Fn&& fn)
{ {
fn(s, std::forward<Type>(obj)); fn(s, std::forward<Type>(obj));
} }
template<typename Stream, typename Type, typename Fn> template<typename Stream, typename Type, typename Fn>
inline void SerWrite(Stream& s, CSerActionUnserialize ser_action, Type&&, Fn&&) inline void SerWrite(Stream& s, ActionUnserialize ser_action, Type&&, Fn&&)
{ {
} }