Skip to content

Commit fac42e9

Browse files
author
MarcoFalke
committed
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.
1 parent aaaa3fa commit fac42e9

File tree

1 file changed

+12
-21
lines changed

1 file changed

+12
-21
lines changed

src/serialize.h

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,11 @@ const Out& AsBase(const In& x)
188188
*/
189189
#define FORMATTER_METHODS(cls, obj) \
190190
template<typename Stream> \
191-
static void Ser(Stream& s, const cls& obj) { SerializationOps(obj, s, CSerActionSerialize()); } \
191+
static void Ser(Stream& s, const cls& obj) { SerializationOps(obj, s, ActionSerialize{}); } \
192192
template<typename Stream> \
193-
static void Unser(Stream& s, cls& obj) { SerializationOps(obj, s, CSerActionUnserialize()); } \
193+
static void Unser(Stream& s, cls& obj) { SerializationOps(obj, s, ActionUnserialize{}); } \
194194
template<typename Stream, typename Type, typename Operation> \
195-
static inline void SerializationOps(Type& obj, Stream& s, Operation ser_action) \
195+
static void SerializationOps(Type& obj, Stream& s, Operation ser_action)
196196

197197
/**
198198
* 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)
953953
}
954954

955955

956-
957956
/**
958-
* Support for SERIALIZE_METHODS and READWRITE macro.
957+
* Support for all macros providing or using the ser_action parameter of the SerializationOps method.
959958
*/
960-
struct CSerActionSerialize
961-
{
959+
struct ActionSerialize {
962960
constexpr bool ForRead() const { return false; }
963961
};
964-
struct CSerActionUnserialize
965-
{
962+
struct ActionUnserialize {
966963
constexpr bool ForRead() const { return true; }
967964
};
968965

969966

970-
971-
972-
973-
974-
975-
976967
/* ::GetSerializeSize implementations
977968
*
978969
* Computing the serialized size of objects is done through a special stream
@@ -1031,36 +1022,36 @@ inline void UnserializeMany(Stream& s, Args&&... args)
10311022
}
10321023

10331024
template<typename Stream, typename... Args>
1034-
inline void SerReadWriteMany(Stream& s, CSerActionSerialize ser_action, const Args&... args)
1025+
inline void SerReadWriteMany(Stream& s, ActionSerialize ser_action, const Args&... args)
10351026
{
10361027
::SerializeMany(s, args...);
10371028
}
10381029

10391030
template<typename Stream, typename... Args>
1040-
inline void SerReadWriteMany(Stream& s, CSerActionUnserialize ser_action, Args&&... args)
1031+
inline void SerReadWriteMany(Stream& s, ActionUnserialize ser_action, Args&&... args)
10411032
{
10421033
::UnserializeMany(s, args...);
10431034
}
10441035

10451036
template<typename Stream, typename Type, typename Fn>
1046-
inline void SerRead(Stream& s, CSerActionSerialize ser_action, Type&&, Fn&&)
1037+
inline void SerRead(Stream& s, ActionSerialize ser_action, Type&&, Fn&&)
10471038
{
10481039
}
10491040

10501041
template<typename Stream, typename Type, typename Fn>
1051-
inline void SerRead(Stream& s, CSerActionUnserialize ser_action, Type&& obj, Fn&& fn)
1042+
inline void SerRead(Stream& s, ActionUnserialize ser_action, Type&& obj, Fn&& fn)
10521043
{
10531044
fn(s, std::forward<Type>(obj));
10541045
}
10551046

10561047
template<typename Stream, typename Type, typename Fn>
1057-
inline void SerWrite(Stream& s, CSerActionSerialize ser_action, Type&& obj, Fn&& fn)
1048+
inline void SerWrite(Stream& s, ActionSerialize ser_action, Type&& obj, Fn&& fn)
10581049
{
10591050
fn(s, std::forward<Type>(obj));
10601051
}
10611052

10621053
template<typename Stream, typename Type, typename Fn>
1063-
inline void SerWrite(Stream& s, CSerActionUnserialize ser_action, Type&&, Fn&&)
1054+
inline void SerWrite(Stream& s, ActionUnserialize ser_action, Type&&, Fn&&)
10641055
{
10651056
}
10661057

0 commit comments

Comments
 (0)