[BLACKBOX] AW: [BLACKBOX] Storing an extended object

From: [at]} <Gerhard.Marent{>
Date: Tue, 11 Nov 2008 08:17:52 +0100

----boundary-LibPST-iamunique-67328100_-_-
Content-type: text/plain

Hi Doug,

you have to write 2 Externalize procedures like this:

    PROCEDURE (base: Base) Externalize- (VAR wr: Stores.Writer), EXTENSIBLE;
    BEGIN
       wr.WriteInt(base.data);
     END Externalize;

   PROCEDURE (sub: Sub) Externalize- (VAR wr: Stores.Writer);
    BEGIN
       sub.Externalize^(wr);
       wr.WriteInt(sub.moreData);
     END Externalize;

Regards Gerhard Marent


-----Ursprüngliche Nachricht-----
Von: BlackBox [mailto:BLACKBOX{([at]})nowhere.xy
Gesendet: Dienstag, 11. November 2008 00:21
An: BLACKBOX{([at]})nowhere.xy
Betreff: [BLACKBOX] Storing an extended object


I am not quite sure how to implement the Externalize and Internalize
procedures
for objects that are an extension of a base type. If I write an
Externalize procedure
(one for the base and one for the extension) then BB complains. So must
I do something
like the following?

    TYPE
       Base = POINTER TO EXTENSIBLE RECORD(Stores.Store)
           data: INTEGER
           END;
       Sub = POINTER TO RECORD(Base)
          moreData: INTEGER;
          END;

    PROCEDURE (base: Base) Externalize- (VAR wr: Stores.Writer);
    BEGIN
       wr.WriteInt(base.data);
       WITH base: Sub DO
          wr.WriteInt(base.moreData);
       ELSE
       END
    END Externalize;

But now when I internalize what must I do?

This seems cumbersome and not very elegant.
-Doug Danforth


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xyVorarlberger Illwerke Aktiengesellschaft ein Unternehmen von illwerke vkw
Rechtsform: Aktiengesellschaft, Sitz: Bregenz, Firmenbuchnummer: FN 59202m
Firmenbuchgericht: LG Feldkirch, DVR 0008753, UID-Nr.: ATU 36737402
Vorarlberger Kraftwerke Aktiengesellschaft ein Unternehmen von illwerke vkw
Rechtsform: Aktiengesellschaft, Sitz: Bregenz, Firmenbuchnummer: FN58920y
Firmenbuchgericht: LG Feldkirch, DVR 0027961, UID-Nr.: ATU 36737304
----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-67328100_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzc1xmY2hhcnNldDAgQXJpYWw7fQ0Ke1xmMVxmbW9kZXJuIENvdXJpZXIgTmV3O30NCntcZjJc
Zm5pbFxmY2hhcnNldDIgU3ltYm9sO30NCntcZjNcZm1vZGVyblxmY2hhcnNldDAgQ291cmllciBO
ZXc7fX0NCntcY29sb3J0YmxccmVkMFxncmVlbjBcYmx1ZTA7XHJlZDBcZ3JlZW4wXGJsdWUyNTU7
fQ0KXHVjMVxwYXJkXHBsYWluXGRlZnRhYjM2MCBcZjBcZnMyMCBIaSBEb3VnLFxwYXINClxwYXIN
CnlvdSBoYXZlIHRvIHdyaXRlIDIgRXh0ZXJuYWxpemUgcHJvY2VkdXJlcyBsaWtlIHRoaXM6XHBh
cg0KXHBhcg0KICAgIFBST0NFRFVSRSAoYmFzZTogQmFzZSkgRXh0ZXJuYWxpemUtIChWQVIgd3I6
IFN0b3Jlcy5Xcml0ZXIpLCBFWFRFTlNJQkxFO1xwYXINCiAgICBCRUdJTlxwYXINCiAgICAgICB3
ci5Xcml0ZUludChiYXNlLmRhdGEpO1xwYXINCiAgICAgRU5EIEV4dGVybmFsaXplO1xwYXINClxw
YXINCiAgIFBST0NFRFVSRSAoc3ViOiBTdWIpIEV4dGVybmFsaXplLSAoVkFSIHdyOiBTdG9yZXMu
V3JpdGVyKTtccGFyDQogICAgQkVHSU5ccGFyDQogICAgICAgc3ViLkV4dGVybmFsaXplXih3cik7
XHBhcg0KICAgICAgIHdyLldyaXRlSW50KHN1Yi5tb3JlRGF0YSk7XHBhcg0KICAgICBFTkQgRXh0
ZXJuY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wYXINClxwYXINClZvcmFybGJlcmdlciBLcmFmdHdlcmtlIEFrdGllbmdl
c2VsbHNjaGFmdCBlaW4gVW50ZXJuZWhtZW4gdm9uIGlsbHdlcmtlIHZrd1xwYXINClJlY2h0c2Zv
cm06IEFrdGllbmdlc2VsbHNjaGFmdCwgU2l0ejogQnJlZ2VueiwgRmlybWVuYnVjaG51bW1lcjog
Rk41ODkyMHlccGFyDQpGaXJtZW5idWNoZ2VyaWNodDogTEcgRmVsZGtpcmNoLCBEVlIgMDAyNzk2
MSwgVUlELU5yLjogQVRVIDM2NzM3MzA0XHBhcg0KXHBhcg0KXHBhcg0KLS0tLVxwYXINClRvIHVu
c3Vic2NyaWJlLCBzZW5kIGEgbWVzc2FnZSB3aXRoIGJvZHkgIlNJR05PRkYgQkxBQ0tCT1giIHRv
IExJU1RTRVJWQExJU1RTLk9CRVJPTi5DSFxwYXJ9fQA
----boundary-LibPST-iamunique-67328100_-_---
Received on Tue Nov 11 2008 - 08:17:52 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:30:52 UTC