Skip to content

Commit 71f016c

Browse files
committed
Remove old serialization primitives
1 parent 92beff1 commit 71f016c

File tree

1 file changed

+1
-37
lines changed

1 file changed

+1
-37
lines changed

src/serialize.h

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -43,26 +43,6 @@ static const unsigned int MAX_VECTOR_ALLOCATE = 5000000;
4343
struct deserialize_type {};
4444
constexpr deserialize_type deserialize {};
4545

46-
/**
47-
* Used to bypass the rule against non-const reference to temporary
48-
* where it makes sense with wrappers.
49-
*/
50-
template<typename T>
51-
inline T& REF(const T& val)
52-
{
53-
return const_cast<T&>(val);
54-
}
55-
56-
/**
57-
* Used to acquire a non-const pointer "this" to generate bodies
58-
* of const serialization operations from a template
59-
*/
60-
template<typename T>
61-
inline T* NCONST_PTR(const T* val)
62-
{
63-
return const_cast<T*>(val);
64-
}
65-
6646
//! Safely convert odd char pointer types to standard ones.
6747
inline char* CharCast(char* c) { return c; }
6848
inline char* CharCast(unsigned char* c) { return (char*)c; }
@@ -193,22 +173,6 @@ template<typename X> const X& ReadWriteAsHelper(const X& x) { return x; }
193173
#define SER_READ(obj, code) ::SerRead(s, ser_action, obj, [&](Stream& s, typename std::remove_const<Type>::type& obj) { code; })
194174
#define SER_WRITE(obj, code) ::SerWrite(s, ser_action, obj, [&](Stream& s, const Type& obj) { code; })
195175

196-
/**
197-
* Implement three methods for serializable objects. These are actually wrappers over
198-
* "SerializationOp" template, which implements the body of each class' serialization
199-
* code. Adding "ADD_SERIALIZE_METHODS" in the body of the class causes these wrappers to be
200-
* added as members.
201-
*/
202-
#define ADD_SERIALIZE_METHODS \
203-
template<typename Stream> \
204-
void Serialize(Stream& s) const { \
205-
NCONST_PTR(this)->SerializationOp(s, CSerActionSerialize()); \
206-
} \
207-
template<typename Stream> \
208-
void Unserialize(Stream& s) { \
209-
SerializationOp(s, CSerActionUnserialize()); \
210-
}
211-
212176
/**
213177
* Implement the Ser and Unser methods needed for implementing a formatter (see Using below).
214178
*
@@ -1004,7 +968,7 @@ void Unserialize(Stream& is, std::shared_ptr<const T>& p)
1004968

1005969

1006970
/**
1007-
* Support for ADD_SERIALIZE_METHODS and READWRITE macro
971+
* Support for SERIALIZE_METHODS and READWRITE macro.
1008972
*/
1009973
struct CSerActionSerialize
1010974
{

0 commit comments

Comments
 (0)