aboutsummaryrefslogtreecommitdiff
path: root/src/tests/cache.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/cache.cpp')
-rw-r--r--src/tests/cache.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/tests/cache.cpp b/src/tests/cache.cpp
index 4751559..3b32daf 100644
--- a/src/tests/cache.cpp
+++ b/src/tests/cache.cpp
@@ -5,8 +5,8 @@
5 5
6class Something : public Bu::CacheObject<Bu::Uuid, Something> 6class Something : public Bu::CacheObject<Bu::Uuid, Something>
7{ 7{
8friend Bu::ArchiveBase &operator>>( Bu::ArchiveBase &ar, Something &s ); 8friend Bu::Archive &operator>>( Bu::Archive &ar, Something &s );
9friend Bu::ArchiveBase &operator<<( Bu::ArchiveBase &ar, const Something &s ); 9friend Bu::Archive &operator<<( Bu::Archive &ar, const Something &s );
10public: 10public:
11 Something() 11 Something()
12 { 12 {
@@ -47,8 +47,8 @@ private:
47 47
48class SubSomethingA : public Something 48class SubSomethingA : public Something
49{ 49{
50friend Bu::ArchiveBase &operator>>( Bu::ArchiveBase &ar, SubSomethingA &s ); 50friend Bu::Archive &operator>>( Bu::Archive &ar, SubSomethingA &s );
51friend Bu::ArchiveBase &operator<<( Bu::ArchiveBase &ar, const SubSomethingA &s ); 51friend Bu::Archive &operator<<( Bu::Archive &ar, const SubSomethingA &s );
52public: 52public:
53 SubSomethingA() 53 SubSomethingA()
54 { 54 {
@@ -71,8 +71,8 @@ private:
71 71
72class SubSomethingB : public Something 72class SubSomethingB : public Something
73{ 73{
74friend Bu::ArchiveBase &operator>>( Bu::ArchiveBase &ar, SubSomethingB &s ); 74friend Bu::Archive &operator>>( Bu::Archive &ar, SubSomethingB &s );
75friend Bu::ArchiveBase &operator<<( Bu::ArchiveBase &ar, const SubSomethingB &s ); 75friend Bu::Archive &operator<<( Bu::Archive &ar, const SubSomethingB &s );
76public: 76public:
77 SubSomethingB() 77 SubSomethingB()
78 { 78 {
@@ -93,32 +93,32 @@ private:
93 Bu::String sString; 93 Bu::String sString;
94}; 94};
95 95
96Bu::ArchiveBase &operator>>( Bu::ArchiveBase &ar, Something &s ) 96Bu::Archive &operator>>( Bu::Archive &ar, Something &s )
97{ 97{
98 return ar >> s.uId >> s.sName; 98 return ar >> s.uId >> s.sName;
99} 99}
100 100
101Bu::ArchiveBase &operator<<( Bu::ArchiveBase &ar, const Something &s ) 101Bu::Archive &operator<<( Bu::Archive &ar, const Something &s )
102{ 102{
103 return ar << s.uId << s.sName; 103 return ar << s.uId << s.sName;
104} 104}
105 105
106Bu::ArchiveBase &operator>>( Bu::ArchiveBase &ar, SubSomethingA &s ) 106Bu::Archive &operator>>( Bu::Archive &ar, SubSomethingA &s )
107{ 107{
108 return ar >> (Something &)s >> s.iNumber; 108 return ar >> (Something &)s >> s.iNumber;
109} 109}
110 110
111Bu::ArchiveBase &operator<<( Bu::ArchiveBase &ar, const SubSomethingA &s ) 111Bu::Archive &operator<<( Bu::Archive &ar, const SubSomethingA &s )
112{ 112{
113 return ar << (Something &)s << s.iNumber; 113 return ar << (Something &)s << s.iNumber;
114} 114}
115 115
116Bu::ArchiveBase &operator>>( Bu::ArchiveBase &ar, SubSomethingB &s ) 116Bu::Archive &operator>>( Bu::Archive &ar, SubSomethingB &s )
117{ 117{
118 return ar >> (Something &)s >> s.sString; 118 return ar >> (Something &)s >> s.sString;
119} 119}
120 120
121Bu::ArchiveBase &operator<<( Bu::ArchiveBase &ar, const SubSomethingB &s ) 121Bu::Archive &operator<<( Bu::Archive &ar, const SubSomethingB &s )
122{ 122{
123 return ar << (Something &)s << s.sString; 123 return ar << (Something &)s << s.sString;
124} 124}
@@ -128,7 +128,7 @@ namespace Bu
128 template<> 128 template<>
129 void _cacheObjectSave<const Something>( Bu::Stream &s, const Something *pObject ) 129 void _cacheObjectSave<const Something>( Bu::Stream &s, const Something *pObject )
130 { 130 {
131 Bu::Archive ar( s, Bu::Archive::save ); 131 Bu::ArchiveBinary ar( s, Bu::ArchiveBinary::save );
132 if( typeid(*pObject) == typeid(SubSomethingA) ) 132 if( typeid(*pObject) == typeid(SubSomethingA) )
133 { 133 {
134 ar << (uint8_t)1 << (SubSomethingA &)*pObject; 134 ar << (uint8_t)1 << (SubSomethingA &)*pObject;
@@ -147,7 +147,7 @@ namespace Bu
147 template<> 147 template<>
148 Something *_cacheObjectLoad<Bu::Uuid, Something>( Bu::CacheObject<Bu::Uuid, Something>::Initializer &initObj, const Bu::Uuid &rKey, Bu::Stream &s ) 148 Something *_cacheObjectLoad<Bu::Uuid, Something>( Bu::CacheObject<Bu::Uuid, Something>::Initializer &initObj, const Bu::Uuid &rKey, Bu::Stream &s )
149 { 149 {
150 Bu::Archive ar( s, Bu::Archive::load ); 150 Bu::ArchiveBinary ar( s, Bu::ArchiveBinary::load );
151 uint8_t uType; 151 uint8_t uType;
152 ar >> uType; 152 ar >> uType;
153 switch( uType ) 153 switch( uType )