summaryrefslogtreecommitdiff
path: root/cpp/demo/Ice/invoke
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2009-11-06 02:36:38 +0100
committerJose <jose@zeroc.com>2009-11-06 02:36:38 +0100
commit488d2234965a5495306a5a4f9f40a37f6df02aae (patch)
tree20990d18f6c2641f4336da3be34ddc62185b7801 /cpp/demo/Ice/invoke
parentanother fix to watch dog thread in TestUtil (diff)
downloadice-488d2234965a5495306a5a4f9f40a37f6df02aae.tar.bz2
ice-488d2234965a5495306a5a4f9f40a37f6df02aae.tar.xz
ice-488d2234965a5495306a5a4f9f40a37f6df02aae.zip
855 - Stream template functions and template programming.
Diffstat (limited to 'cpp/demo/Ice/invoke')
-rw-r--r--cpp/demo/Ice/invoke/Client.cpp14
-rw-r--r--cpp/demo/Ice/invoke/PrinterI.cpp12
2 files changed, 13 insertions, 13 deletions
diff --git a/cpp/demo/Ice/invoke/Client.cpp b/cpp/demo/Ice/invoke/Client.cpp
index ad92664a007..4226899e60a 100644
--- a/cpp/demo/Ice/invoke/Client.cpp
+++ b/cpp/demo/Ice/invoke/Client.cpp
@@ -74,7 +74,7 @@ public:
//
Ice::InputStreamPtr in = Ice::createInputStream(_communicator, outParams);
Demo::CPtr c;
- Demo::ice_readC(in, c);
+ in->read(c);
string str = in->readString();
in->readPendingObjects();
cout << "Got string `" << str << "' and class: s.name=" << c->s.name
@@ -250,7 +250,7 @@ InvokeClient::run(int argc, char* argv[])
Demo::StringDict dict;
dict["The"] = "streaming";
dict["API"] = "works!";
- Demo::ice_writeStringDict(out, dict);
+ out->write(dict);
out->finished(inParams);
//
@@ -275,7 +275,7 @@ InvokeClient::run(int argc, char* argv[])
//
Ice::ByteSeq inParams, outParams;
Ice::OutputStreamPtr out = Ice::createOutputStream(communicator());
- Demo::ice_writeColor(out, Demo::green);
+ out->write(Demo::green);
out->finished(inParams);
//
@@ -303,7 +303,7 @@ InvokeClient::run(int argc, char* argv[])
Demo::Structure s;
s.name = "red";
s.value = Demo::red;
- Demo::ice_writeStructure(out, s);
+ out->write(s);
out->finished(inParams);
//
@@ -338,7 +338,7 @@ InvokeClient::run(int argc, char* argv[])
arr.push_back(Demo::Structure());
arr.back().name = "blue";
arr.back().value = Demo::blue;
- Demo::ice_writeStructureSeq(out, arr);
+ out->write(arr);
out->finished(inParams);
//
@@ -366,7 +366,7 @@ InvokeClient::run(int argc, char* argv[])
Demo::CPtr c = new Demo::C;
c->s.name = "blue";
c->s.value = Demo::blue;
- Demo::ice_writeC(out, c);
+ out->write(c);
out->writePendingObjects();
out->finished(inParams);
@@ -409,7 +409,7 @@ InvokeClient::run(int argc, char* argv[])
//
Ice::InputStreamPtr in = Ice::createInputStream(communicator(), outParams);
Demo::CPtr c;
- Demo::ice_readC(in, c);
+ in->read(c);
string str = in->readString();
in->readPendingObjects();
cout << "Got string `" << str << "' and class: s.name=" << c->s.name
diff --git a/cpp/demo/Ice/invoke/PrinterI.cpp b/cpp/demo/Ice/invoke/PrinterI.cpp
index f6752c6b16b..c6ca9c4aef8 100644
--- a/cpp/demo/Ice/invoke/PrinterI.cpp
+++ b/cpp/demo/Ice/invoke/PrinterI.cpp
@@ -65,7 +65,7 @@ PrinterI::ice_invoke(const vector<Ice::Byte>& inParams, vector<Ice::Byte>& outPa
else if(current.operation == "printDictionary")
{
Demo::StringDict dict;
- Demo::ice_readStringDict(in, dict);
+ in->read(dict);
cout << "Printing dictionary {";
for(Demo::StringDict::iterator p = dict.begin(); p != dict.end(); ++p)
{
@@ -81,21 +81,21 @@ PrinterI::ice_invoke(const vector<Ice::Byte>& inParams, vector<Ice::Byte>& outPa
else if(current.operation == "printEnum")
{
Demo::Color c;
- Demo::ice_readColor(in, c);
+ in->read(c);
cout << "Printing enum " << c << endl;
return true;
}
else if(current.operation == "printStruct")
{
Demo::Structure s;
- Demo::ice_readStructure(in, s);
+ in->read(s);
cout << "Printing struct: name=" << s.name << ", value=" << s.value << endl;
return true;
}
else if(current.operation == "printStructSequence")
{
Demo::StructureSeq seq;
- Demo::ice_readStructureSeq(in, seq);
+ in->read(seq);
cout << "Printing struct sequence: {";
for(Demo::StructureSeq::iterator p = seq.begin(); p != seq.end(); ++p)
{
@@ -111,7 +111,7 @@ PrinterI::ice_invoke(const vector<Ice::Byte>& inParams, vector<Ice::Byte>& outPa
else if(current.operation == "printClass")
{
Demo::CPtr c;
- Demo::ice_readC(in, c);
+ in->read(c);
in->readPendingObjects();
cout << "Printing class: s.name=" << c->s.name << ", s.value=" << c->s.value << endl;
return true;
@@ -122,7 +122,7 @@ PrinterI::ice_invoke(const vector<Ice::Byte>& inParams, vector<Ice::Byte>& outPa
c->s.name = "green";
c->s.value = Demo::green;
Ice::OutputStreamPtr out = Ice::createOutputStream(communicator);
- Demo::ice_writeC(out, c);
+ out->write(c);
out->writeString("hello");
out->writePendingObjects();
out->finished(outParams);