From 27e0164234c916adaf0ce78e29dffe565302ef53 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Sat, 25 Nov 2006 23:38:14 +0000 Subject: I think this is a better serializer model. --- src/serializer.cpp | 121 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) (limited to 'src/serializer.cpp') diff --git a/src/serializer.cpp b/src/serializer.cpp index 0afaf4b..587f613 100644 --- a/src/serializer.cpp +++ b/src/serializer.cpp @@ -14,6 +14,127 @@ bool Serializer::isLoading() { return bLoading; } +Serializer &Serializer::operator<<(bool p) +{ + write( &p, sizeof(p) ); + return *this; +} +Serializer &Serializer::operator<<(int8_t p) +{ + write( &p, sizeof(p) ); + return *this; +} +Serializer &Serializer::operator<<(int16_t p) +{ + write( &p, sizeof(p) ); + return *this; +} +Serializer &Serializer::operator<<(int32_t p) +{ + write( &p, sizeof(p) ); + return *this; +} +Serializer &Serializer::operator<<(int64_t p) +{ + write( &p, sizeof(p) ); + return *this; +} +Serializer &Serializer::operator<<(uint8_t p) +{ + write( &p, sizeof(p) ); + return *this; +} +Serializer &Serializer::operator<<(uint16_t p) +{ + write( &p, sizeof(p) ); + return *this; +} +Serializer &Serializer::operator<<(uint32_t p) +{ + write( &p, sizeof(p) ); + return *this; +} +Serializer &Serializer::operator<<(uint64_t p) +{ + write( &p, sizeof(p) ); + return *this; +} +Serializer &Serializer::operator<<(float p) +{ + write( &p, sizeof(p) ); + return *this; +} +Serializer &Serializer::operator<<(double p) +{ + write( &p, sizeof(p) ); + return *this; +} +Serializer &Serializer::operator<<(long double p) +{ + write( &p, sizeof(p) ); + return *this; +} + +Serializer &Serializer::operator>>(bool &p) +{ + read( &p, sizeof(p) ); + return *this; +} +Serializer &Serializer::operator>>(int8_t &p) +{ + read( &p, sizeof(p) ); + return *this; +} +Serializer &Serializer::operator>>(int16_t &p) +{ + read( &p, sizeof(p) ); + return *this; +} +Serializer &Serializer::operator>>(int32_t &p) +{ + read( &p, sizeof(p) ); + return *this; +} +Serializer &Serializer::operator>>(int64_t &p) +{ + read( &p, sizeof(p) ); + return *this; +} +Serializer &Serializer::operator>>(uint8_t &p) +{ + read( &p, sizeof(p) ); + return *this; +} +Serializer &Serializer::operator>>(uint16_t &p) +{ + read( &p, sizeof(p) ); + return *this; +} +Serializer &Serializer::operator>>(uint32_t &p) +{ + read( &p, sizeof(p) ); + return *this; +} +Serializer &Serializer::operator>>(uint64_t &p) +{ + read( &p, sizeof(p) ); + return *this; +} +Serializer &Serializer::operator>>(float &p) +{ + read( &p, sizeof(p) ); + return *this; +} +Serializer &Serializer::operator>>(double &p) +{ + read( &p, sizeof(p) ); + return *this; +} +Serializer &Serializer::operator>>(long double &p) +{ + read( &p, sizeof(p) ); + return *this; +} /*Serializer::Serializer &operator&(bool &p) { -- cgit v1.2.3