pibytearray patch, now automatic supports all simple types
This commit is contained in:
16
main.cpp
16
main.cpp
@@ -2,31 +2,27 @@
|
||||
|
||||
struct A {
|
||||
double x1;
|
||||
//double x2;
|
||||
//PIString str;
|
||||
};
|
||||
inline PIByteArray & operator <<(PIByteArray & s, const A & a) {s << a.x1/* << a.x2*/; return s;}
|
||||
inline PIByteArray & operator >>(PIByteArray & s, A & a) {s >> a.x1/* >> a.x2*/; return s;}
|
||||
//inline PIByteArray & operator <<(PIByteArray & s, const A & a) {s << a.x1/* << a.x2*/; return s;}
|
||||
//inline PIByteArray & operator >>(PIByteArray & s, A & a) {s >> a.x1/* >> a.x2*/; return s;}
|
||||
|
||||
struct B {
|
||||
B() {
|
||||
x1=0;
|
||||
//x2=0;
|
||||
}
|
||||
B(const B & b) = default;
|
||||
B & operator =(const B & b) {x1=b.x1; return *this;}
|
||||
//B & operator =(const B & b) {x1=b.x1; return *this;}
|
||||
//A aa;
|
||||
double x1;
|
||||
//double x2;
|
||||
};
|
||||
inline PIByteArray & operator <<(PIByteArray & s, const B & a) {s << a.x1/* << a.x2*/; return s;}
|
||||
inline PIByteArray & operator >>(PIByteArray & s, B & a) {s >> a.x1/* >> a.x2*/; return s;}
|
||||
|
||||
//__PIVECTOR_SIMPLE_TYPE__(B)
|
||||
|
||||
#include "piconditionvar.h"
|
||||
int main() {
|
||||
PITimeMeasurer tm;
|
||||
PIByteArray ba; ba.reserve(100*100*16);
|
||||
|
||||
PITimeMeasurer tm;
|
||||
PIVector2D<double> vx;
|
||||
PIVector2D<double> vd;
|
||||
ba << vx;
|
||||
|
||||
Reference in New Issue
Block a user