C++ Middleware Writer version 1.10 is now on line

B

Brian

Release 1.10 of the C++ Middleware Writer is now available
on line. This release has the following changes:

1. Support added for stream constructors. Previously types
were required to have default constructors in order to be
(de)marshalled by the C++ Midddle Writer. A function named
Receive was then called to demarshall the object. Below is
an example of how the code has changed in this area. The
old version is shown first with some added comments to
indicate how things have changed in the new version.

inline void
Base::BuildPolyInstance(Buffer* buf, Base*& p)
{
unsigned short type_num; // --> uint16_t

buf->PersistentRead(&type_num, sizeof(type_num));
switch (type_num) {
case Base_num:
p = new Base; // --> p = new Base(buf);
break;

case Derived_num:
p = new Derived; // --> p = new Derived(buf);
break;

default:
throw failure("Base::BuildPolyInstance: Unknown type");
}

p->Receive(buf); // This typically virtual function call
} // is no longer needed.



// new version as of release 1.10.
inline void
Base::BuildPolyInstance(Buffer* buf, Base*& p)
{
uint16_t type_num;

buf->PersistentRead(&type_num, sizeof(type_num));
switch (type_num) {
case Base_num:
p = new Base(buf);
break;

case Derived_num:
p = new Derived(buf);
break;

default:
throw failure("Base::BuildPolyInstance: Unknown type");
}
}


2. Support added for int8_t, int16_t, int32_t, uint8_t,
uint16_t and uint32_t.

3. The command line interface to the C++ Middleware Writer --
http://webEbenezer.net/build_integration.html -- has been
tested on a big-endian Mac. The program also works on
little-endian machines.

I'm interested in hearing what your thoughts are on the
C++ Middleware Writer.


Shalom
Brian Wood
http://webEbenezer.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,967
Messages
2,570,148
Members
46,694
Latest member
LetaCadwal

Latest Threads

Top