Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit b5a80eb4 authored by EXT Arnaud Clère's avatar EXT Arnaud Clère
Browse files

cosmetic change

parent fafb37c0
......@@ -254,7 +254,7 @@ static Phone phone {Phone::Home,"+44 1234567"};
groupWarmup=(previousTotal<0.01 || std::abs(groupTotal-previousTotal)*100/previousTotal > 1.); \
previousTotal=groupTotal; \
groupTotal=0.; \
if (previousTotal<0.01) { fprintf(results,"group "); fprintf(samples, "%s |================================================================================\n", group); } else fprintf(results,"%-12s",group);
if (previousTotal<0.01) { fprintf(results,"============"); fprintf(samples, "%s |================================================================================\n", group); } else fprintf(results,"%-12s",group);
#define GROUP_STOP \
if (previousTotal<0.01) fprintf(results,"|total(usecs)|variation(%%)\n"); else fprintf(results,"|%12.1f|%5.1f\n", groupTotal, previousTotal>=0.01 ? std::abs(groupTotal-previousTotal)*100/previousTotal : 0); \
......@@ -406,25 +406,25 @@ int main(int argc, char *argv[])
}
STOP("QByteArray",ba.toHex());
QBindable<> writables[5];
QBindable<> bindables[5];
START {
writables[0] = 1.333333333333f;
writables[1] = PI;
writables[2] = ascii;
writables[3] = false;
writables[4] = color;
bindables[0] = 1.333333333333f;
bindables[1] = PI;
bindables[2] = ascii;
bindables[3] = false;
bindables[4] = color;
}
STOP("Writables","");
STOP("Bindables","");
START {
ba.resize(0);
QCborWriter(&ba).bind(writables);
QCborWriter(&ba).bind(bindables);
}
STOP("Writables>Cbor",ba.toHex());
STOP("Bindables>Cbor",ba.toHex());
START {
b.seek(0); b.buffer().resize(0);
QJsonWriter(&b).bind(writables);
QJsonWriter(&b).bind(bindables);
}
STOP("Writables>Json",b.buffer());
STOP("Bindables>Json",b.buffer());
}
GROUP_STOP;
GROUP("doubles>")//========================================================
......@@ -502,21 +502,21 @@ int main(int argc, char *argv[])
}
STOP("QByteArray",str.toHex());
QBindable<> writable;
QBindable<> bindable;
START {
writable = transform;
bindable = transform;
}
STOP("Writable","");
STOP("Bindable","");
START {
ba.resize(0);
QCborWriter(&ba).bind(writable);
QCborWriter(&ba).bind(bindable);
}
STOP("Writable>Cbor",ba.toHex());
STOP("Bindable>Cbor",ba.toHex());
START {
b.seek(0); b.buffer().resize(0);
QJsonWriter(&b).bind(writable);
QJsonWriter(&b).bind(bindable);
}
STOP("Writable>Json",b.buffer());
STOP("Bindable>Json",b.buffer());
}
GROUP_STOP
GROUP("Person>")//=========================================================
......@@ -628,21 +628,21 @@ int main(int argc, char *argv[])
STOP("protobuf",QByteArray::fromStdString(buf).toHex());
#endif
QBindable<> writable;
QBindable<> bindable;
START {
writable = person;
bindable = person;
}
STOP("Writable","");
STOP("Bindable","");
START {
ba.resize(0);
QCborWriter(&ba).bind(writable);
QCborWriter(&ba).bind(bindable);
}
STOP("Writable>Cbor",ba.toHex());
STOP("Bindable>Cbor",ba.toHex());
START {
b.seek(0); b.buffer().resize(0);
QJsonWriter(&b).bind(writable);
QJsonWriter(&b).bind(bindable);
}
STOP("Writable>Json",b.buffer());
STOP("Bindable>Json",b.buffer());
}
GROUP_STOP
GROUP("Phone>")//=========================================================
......@@ -708,21 +708,21 @@ int main(int argc, char *argv[])
}
STOP("QByteArray",str.toHex());
QBindable<> writable;
QBindable<> bindable;
START {
writable = phone;
bindable = phone;
}
STOP("Writable","");
STOP("Bindable","");
START {
ba.resize(0);
QCborWriter(&ba).bind(writable);
QCborWriter(&ba).bind(bindable);
}
STOP("Writable>Cbor",ba.toHex());
STOP("Bindable>Cbor",ba.toHex());
START {
b.seek(0); b.buffer().resize(0);
QJsonWriter(&b).bind(writable);
QJsonWriter(&b).bind(bindable);
}
STOP("Writable>Json",b.buffer());
STOP("Bindable>Json",b.buffer());
}
GROUP_STOP
......@@ -1011,15 +1011,14 @@ void doGuiExample() {
.item("first name")
.meta(qmColor, person.age >= 42 ? "green" : "blue")
.bind(person.firstName)
.item("office phone")
.with([&](Val<Cursor>&& v) {
for (auto&& phone : person.phones) {
if (phone._t == Phone::Office) {
return v.bind(phone._n);
}
.item("office phone").with([&](Val<Cursor>&& v) {
for (auto&& phone : person.phones) {
if (phone._t == Phone::Office) {
return v.bind(phone._n);
}
return v.null();
})
}
return v.null();
})
.out();
}
return std::move(s); // So caller stops calling IBind if user function was unable to keep track of the active Cursor
......
......@@ -9,9 +9,9 @@ QCborStream |85fa3faaaaabfb400921fb54442d1878256173636969206368617261637465727
Data |3ff5555560000000400921fb54442d1800000026617363696920636861726163746572732061726520636f6d6d6f6e20696e20514465627567000001ffff2d2d0000baba0000
QDataStream |3ff5555560000000400921fb54442d1800000026617363696920636861726163746572732061726520636f6d6d6f6e20696e20514465627567000001ffff2d2d0000baba0000
QByteArray |abaaaa3f182d4454fb210940617363696920636861726163746572732061726520636f6d6d6f6e20696e205144656275670001000000ffff2d2d0000baba00000000
Writables |
Writables>Cbor|85fa3faaaaabfb400921fb54442d187825617363696920636861726163746572732061726520636f6d6d6f6e20696e20514465627567f4bf635247429f182d0018baff646261736518ffff
Writables>Json|[1.33333337,3.1415926535897931,"ascii characters are common in QDebug",false,{"RGB":[45,0,186],"base":255}]
Bindables |
Bindables>Cbor|85fa3faaaaabfb400921fb54442d187825617363696920636861726163746572732061726520636f6d6d6f6e20696e20514465627567f4bf635247429f182d0018baff646261736518ffff
Bindables>Json|[1.33333337,3.1415926535897931,"ascii characters are common in QDebug",false,{"RGB":[45,0,186],"base":255}]
doubles> |================================================================================
QDebug |0.333333 0.666667 0.333333 1 0.666667 0.333333 0.666667 1 0.333333 0.666667 0.333333 1 0 0 0 1
Text |[ 0.333333 0.666667 0.333333 1 0.666667 0.333333 0.666667 1 0.333333 0.666667 0.333333 1 0 0 0 1]
......@@ -23,9 +23,9 @@ QCborStream |90fb3fd5555555555555fb3fe5555555555555fb3fd5555555555555fb3ff0000
Data |000000103fd55555555555553fe55555555555553fd55555555555553ff00000000000003fe55555555555553fd55555555555553fe55555555555553ff00000000000003fd55555555555553fe55555555555553fd55555555555553ff00000000000000000000000000000000000000000000000000000000000003ff0000000000000
QDataStream |000000103fd55555555555553fe55555555555553fd55555555555553ff00000000000003fe55555555555553fd55555555555553fe55555555555553ff00000000000003fd55555555555553fe55555555555553fd55555555555553ff00000000000000000000000000000000000000000000000000000000000003ff0000000000000
QByteArray |10000000555555555555d53f555555555555e53f555555555555d53f000000000000f03f555555555555e53f555555555555d53f555555555555e53f000000000000f03f555555555555d53f555555555555e53f555555555555d53f000000000000f03f000000000000000000000000000000000000000000000000000000000000f03f
Writable |
Writable>Cbor |90fb3fd5555555555555fb3fe5555555555555fb3fd5555555555555fb3ff0000000000000fb3fe5555555555555fb3fd5555555555555fb3fe5555555555555fb3ff0000000000000fb3fd5555555555555fb3fe5555555555555fb3fd5555555555555fb3ff0000000000000fb0000000000000000fb0000000000000000fb0000000000000000fb3ff0000000000000
Writable>Json |[0.33333333333333331,0.66666666666666663,0.33333333333333331,1,0.66666666666666663,0.33333333333333331,0.66666666666666663,1,0.33333333333333331,0.66666666666666663,0.33333333333333331,1,0,0,0,1]
Bindable |
Bindable>Cbor |90fb3fd5555555555555fb3fe5555555555555fb3fd5555555555555fb3ff0000000000000fb3fe5555555555555fb3fd5555555555555fb3fe5555555555555fb3ff0000000000000fb3fd5555555555555fb3fe5555555555555fb3fd5555555555555fb3ff0000000000000fb0000000000000000fb0000000000000000fb0000000000000000fb3ff0000000000000
Bindable>Json |[0.33333333333333331,0.66666666666666663,0.33333333333333331,1,0.66666666666666663,0.33333333333333331,0.66666666666666663,1,0.33333333333333331,0.66666666666666663,0.33333333333333331,1,0,0,0,1]
Person> |================================================================================
QDebug |Person("John", "Doe", 1.75, 18, QVector(), "unicode is likely U+01 \u0001 + U+1F \u001F + U+A4 ¤ U+B0 ° U+D8 Ø U+FF ÿ", ())
Text |(Person)[ names:[ John Doe] height:1.75 age:18 phones:[] comments:unicode is likely U+01  + U+1F  + U+A4 ¤ U+B0 ° U+D8 Ø U+FF ÿ children:[]]
......@@ -38,9 +38,9 @@ QCborStream |bf656e616d65739f644a6f686e63446f65ff66686569676874fb3ffc000000000
Data |00000008004a006f0068006e000000060044006f00653ffc00000000000000000012000000000000007e0075006e00690063006f006400650020006900730020006c0069006b0065006c007900200055002b00300031002000010020002b00200055002b003100460020001f0020002b00200055002b00410034002000a400200055002b00420030002000b000200055002b00440038002000d800200055002b00460046002000ff00000000
QDataStream |00000008004a006f0068006e000000060044006f00653ffc00000000000000000012000000000000007e0075006e00690063006f006400650020006900730020006c0069006b0065006c007900200055002b00300031002000010020002b00200055002b003100460020001f0020002b00200055002b00410034002000a400200055002b00420030002000b000200055002b00440038002000d800200055002b00460046002000ff00000000
QByteArray |4a006f0044006f000000000000fc3f120000000000000075006e00690063006f006400650020006900730020006c0069006b0065006c007900200055002b00300031002000010020002b00200055002b00310046002000000000
Writable |
Writable>Cbor |bf656e616d65739f644a6f686e63446f65ff66686569676874fb3ffc00000000000063616765126670686f6e65738068636f6d6d656e74737843756e69636f6465206973206c696b656c7920552b30312001202b20552b3146201f202b20552b413420c2a420552b423020c2b020552b443820c39820552b464620c3bf686368696c6472656e80ff
Writable>Json |{"names":["John","Doe"],"height":1.75,"age":18,"phones":[],"comments":"unicode is likely U+01 \u0001 + U+1F \u001F + U+A4 ¤ U+B0 ° U+D8 Ø U+FF ÿ","children":[]}
Bindable |
Bindable>Cbor |bf656e616d65739f644a6f686e63446f65ff66686569676874fb3ffc00000000000063616765126670686f6e65738068636f6d6d656e74737843756e69636f6465206973206c696b656c7920552b30312001202b20552b3146201f202b20552b413420c2a420552b423020c2b020552b443820c39820552b464620c3bf686368696c6472656e80ff
Bindable>Json |{"names":["John","Doe"],"height":1.75,"age":18,"phones":[],"comments":"unicode is likely U+01 \u0001 + U+1F \u001F + U+A4 ¤ U+B0 ° U+D8 Ø U+FF ÿ","children":[]}
Phone> |================================================================================
QDebug |Phone(Phone::Home, "+44 1234567")
Text |(Phone)[ type:(Home)2 number:+44 1234567]
......@@ -52,9 +52,9 @@ QCborStream |bf647479706502666e756d6265726b2b34342031323334353637ff
Data |0200000016002b0034003400200031003200330034003500360037
QDataStream |0200000016002b0034003400200031003200330034003500360037
QByteArray |022b34342031323334353637
Writable |
Writable>Cbor |bf647479706502666e756d6265726b2b34342031323334353637ff
Writable>Json |{"type":2,"number":"+44 1234567"}
Bindable |
Bindable>Cbor |bf647479706502666e756d6265726b2b34342031323334353637ff
Bindable>Json |{"type":2,"number":"+44 1234567"}
Person<>Json |================================================================================
Json>P |(Person)[ names:[ John Doe] height:1.75 age:-1 phones:[] comments: children:[]] | [ Ignored character 0:1 Ignored character 0:15 Ignored character 0:23 Ignored character 0:40 Ignored character 0:42 Ignored character 0:58 Ignored character 0:76 Ignored character 0:77]
P>Json |{"names":["John","Doe"],"height":1.7500000000000002,"age":-1,"phones":[],"comments":"","children":[]}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment