Archived
This forum has been archived. Please start a new discussion on GitHub.
streaming function "write/readContext" for Ice::Context
Dear All,
While I am developing my project (in c++) using the Ice streaming functionalities, I came accross the following thing:
I would like to be able to write/read some internal Ice types, like Ice::Context, in a similar way to what is possible for basic types. For instance I would like to do:
out->writeByteSeq(mySeq);
out->writeContext(myCtx); //or ice_writeContext(out,myCtx);
However, the functions to stream these kind of Ice types are not present.
My solution was simply to define my own "context" type as a dictionary<string,string> in a slice file and use the --stream option of the slice2cpp compiler.
Of course this works perfectly, at least as long as Ice::Context remains a dictionary<string,string>.
Is there a more elegant way to achieve easy streaming of Ice::Context (or Ice::OperationMode e.g.)?
Thanks in advance.
While I am developing my project (in c++) using the Ice streaming functionalities, I came accross the following thing:
I would like to be able to write/read some internal Ice types, like Ice::Context, in a similar way to what is possible for basic types. For instance I would like to do:
out->writeByteSeq(mySeq);
out->writeContext(myCtx); //or ice_writeContext(out,myCtx);
However, the functions to stream these kind of Ice types are not present.
My solution was simply to define my own "context" type as a dictionary<string,string> in a slice file and use the --stream option of the slice2cpp compiler.
Of course this works perfectly, at least as long as Ice::Context remains a dictionary<string,string>.
Is there a more elegant way to achieve easy streaming of Ice::Context (or Ice::OperationMode e.g.)?
Thanks in advance.
0