X-Git-Url: https://ecere.com/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ecere%2Fsrc%2Fcom%2Fcontainers%2FArray.ec;h=5079f7d7bb52150c489d66c011b56873be38e9e8;hb=f2674b92161ba87030a477853a20e18774a85c12;hp=748dd4421a0147dfa27588cf8822e70f63eb83a9;hpb=3d36514bca3977202ae4c57577ab97601d099a55;p=sdk diff --git a/ecere/src/com/containers/Array.ec b/ecere/src/com/containers/Array.ec index 748dd44..5079f7d 100644 --- a/ecere/src/com/containers/Array.ec +++ b/ecere/src/com/containers/Array.ec @@ -7,6 +7,10 @@ import "Container" // #define MEMTRACKING #endif +default: +extern int __ecereVMethodID_class_OnUnserialize; +private: + public class Array : Container { class_fixed @@ -21,6 +25,22 @@ public: delete array; } + void OnUnserialize(IOChannel channel) + { + Array array = eInstance_New(_class.fullName); + uint count, c; + Class Dclass = class(D); + channel.Get(count); + //printf("%d %ss\n", count, Dclass.name); + if(count > 10000) + printf("Bug"); + array.size = count; + for(c = 0; c < count; c++) + ((void (*)(void *, void *, void *))(void *)Dclass._vTbl[__ecereVMethodID_class_OnUnserialize]) + (Dclass, ((byte *)array.array) + Dclass.typeSize * c, channel); + this = array; + } + // Generic iterator support IteratorPointer GetFirst() { return (IteratorPointer)array; } IteratorPointer GetLast() { return (IteratorPointer)(array ? (array + (count - 1)) : null); }