persistency and Ice objects

nsnsnsns Member ✭✭
Hi,

how can I store an Ice object in an external DB ?
(Freeze does not suit me)

For example,

// my_data.ice

struct A { // I need to store only such simple structs
int i;
float f;
string s;
};

I need something like

std::string A::serialize() const;

the function which returns internal presentation of the Ice object.

Or maybe, smth like this:

std::string buffer;
IceInternal::BasicStream os(buffer); // does not exists
A::__write(&os); // not in the user API

Thank you,
nsns

Comments

  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    There is currently no public API to serialize a Slice construct to a binary string encoded using the Ice encoding. But you could look at the Freeze sources to figure out the private API ;).

    Also Ice (Freeze) no longer provides an XML or plain text encoding.

    If you want to store this simple struct in a relational database, you could be better off doing the conversion yourself: for example store each data member in its own column.

    Cheers,
    Bernard
  • nsnsnsns Member ✭✭
    "There is currently no public API to serialize a Slice construct to a binary string encoded using the Ice encoding. "

    Hope, it will be added to the TODO list.

    Cheers, Nikolai (nsns)
  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    Consider it added. It's rather simple to do anyway.
Sign In or Register to comment.