本文整理汇总了C++中ice::InputStreamPtr类的典型用法代码示例。如果您正苦于以下问题:C++ InputStreamPtr类的具体用法?C++ InputStreamPtr怎么用?C++ InputStreamPtr使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了InputStreamPtr类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: opExceptionPairNC
void opExceptionPairNC(bool ok, const pair<const Ice::Byte*, const Ice::Byte*>& outParams)
{
if(ok)
{
test(false);
}
else
{
Ice::InputStreamPtr in = Ice::createInputStream(_communicator, outParams);
in->startEncapsulation();
try
{
in->throwException();
}
catch(const Test::MyException&)
{
in->endEncapsulation();
called();
}
catch(...)
{
test(false);
}
}
}
开发者ID:joshmoore,项目名称:ice,代码行数:25,代码来源:AllTests.cpp
示例2:
void
Ice::UserException::__read(const Ice::InputStreamPtr& is)
{
is->startException();
__readImpl(is);
is->endException(false);
}
开发者ID:Jonavin,项目名称:ice,代码行数:7,代码来源:Exception.cpp
示例3: opString
void opString(const Ice::AsyncResultPtr& result)
{
string cmp = testString;
if(_useCookie)
{
CookiePtr cookie = CookiePtr::dynamicCast(result->getCookie());
cmp = cookie->getString();
}
Ice::ByteSeq outParams;
if(result->getProxy()->end_ice_invoke(outParams, result))
{
Ice::InputStreamPtr in = Ice::createInputStream(_communicator, outParams);
in->startEncapsulation();
string s;
in->read(s);
test(s == cmp);
in->read(s);
test(s == cmp);
in->endEncapsulation();
called();
}
else
{
test(false);
};
}
开发者ID:joshmoore,项目名称:ice,代码行数:27,代码来源:AllTests.cpp
示例4: opExceptionWC
void opExceptionWC(bool ok, const Ice::ByteSeq& outParams, const CookiePtr& cookie)
{
test(cookie->getString() == testString);
if(ok)
{
test(false);
}
else
{
Ice::InputStreamPtr in = Ice::createInputStream(_communicator, outParams);
in->startEncapsulation();
try
{
in->throwException();
}
catch(const Test::MyException&)
{
in->endEncapsulation();
called();
}
catch(...)
{
test(false);
}
}
}
开发者ID:joshmoore,项目名称:ice,代码行数:26,代码来源:AllTests.cpp
示例5: opException
void opException(const Ice::AsyncResultPtr& result)
{
if(_useCookie)
{
CookiePtr cookie = CookiePtr::dynamicCast(result->getCookie());
test(cookie->getString() == testString);
}
Ice::ByteSeq outParams;
if(result->getProxy()->end_ice_invoke(outParams, result))
{
test(false);
}
else
{
Ice::InputStreamPtr in = Ice::createInputStream(_communicator, outParams);
in->startEncapsulation();
try
{
in->throwException();
}
catch(const Test::MyException&)
{
in->endEncapsulation();
called();
}
catch(...)
{
test(false);
}
}
}
开发者ID:joshmoore,项目名称:ice,代码行数:32,代码来源:AllTests.cpp
示例6: opStringWC
void opStringWC(bool ok, const Ice::ByteSeq& outParams, const CookiePtr& cookie)
{
if(ok)
{
Ice::InputStreamPtr in = Ice::createInputStream(_communicator, outParams);
string s;
in->read(s);
test(s == cookie->getString());
in->read(s);
test(s == cookie->getString());
called();
}
else
{
test(false);
}
}
开发者ID:bholl,项目名称:zeroc-ice,代码行数:17,代码来源:AllTests.cpp
示例7: opStringNC
void opStringNC(bool ok, const Ice::ByteSeq& outParams)
{
if(ok)
{
Ice::InputStreamPtr in = Ice::createInputStream(_communicator, outParams);
string s;
in->read(s);
test(s == testString);
in->read(s);
test(s == testString);
called();
}
else
{
test(false);
}
}
开发者ID:bholl,项目名称:zeroc-ice,代码行数:17,代码来源:AllTests.cpp
示例8: opStringPairNC
void opStringPairNC(bool ok, const pair<const Ice::Byte*, const Ice::Byte*>& outParams)
{
if(ok)
{
Ice::InputStreamPtr in = Ice::createInputStream(_communicator, outParams);
in->startEncapsulation();
string s;
in->read(s);
test(s == testString);
in->read(s);
test(s == testString);
in->endEncapsulation();
called();
}
else
{
test(false);
}
}
开发者ID:joshmoore,项目名称:ice,代码行数:19,代码来源:AllTests.cpp
示例9: opExceptionNC
void opExceptionNC(bool ok, const Ice::ByteSeq& outParams)
{
if(ok)
{
test(false);
}
else
{
Ice::InputStreamPtr in = Ice::createInputStream(_communicator, outParams);
try
{
in->throwException();
}
catch(const Test::MyException&)
{
called();
}
catch(...)
{
test(false);
}
}
}
开发者ID:bholl,项目名称:zeroc-ice,代码行数:23,代码来源:AllTests.cpp
示例10: fs
//.........这里部分代码省略.........
StringSeq files = IcePatch2Internal::readDirectory(dbPath);
if(!files.empty())
{
cerr << "Output directory is not empty: " << dbPath << endl;
return EXIT_FAILURE;
}
ifstream fs(dbFile.c_str(), ios::binary);
if(fs.fail())
{
cerr << "Could not open input file: " << strerror(errno) << endl;
return EXIT_FAILURE;
}
fs.unsetf(ios::skipws);
fs.seekg(0, ios::end);
streampos fileSize = fs.tellg();
fs.seekg(0, ios::beg);
vector<Ice::Byte> buf;
buf.reserve(static_cast<size_t>(fileSize));
buf.insert(buf.begin(), istream_iterator<Ice::Byte>(fs), istream_iterator<Ice::Byte>());
fs.close();
if(!serverVersion.empty())
{
ValueFactoryPtr factory = new ValueFactoryI(serverVersion);
communicator()->addValueFactory(factory, "::IceGrid::ServerDescriptor");
communicator()->addValueFactory(factory, "::IceGrid::IceBoxDescriptor");
}
Ice::InputStreamPtr stream = Ice::wrapInputStream(communicator(), buf, dbContext.encoding);
string type;
int version;
stream->read(type);
if(type != "IceGrid")
{
cerr << "Incorrect input file type: " << type << endl;
return EXIT_FAILURE;
}
stream->read(version);
if(version / 100 == 305)
{
if(debug)
{
cout << "Reading Ice 3.5.x data" << endl;
}
skipFilter = true;
}
stream->read(data);
{
IceDB::Env env(dbPath, 5, mapSize);
IceDB::ReadWriteTxn txn(env);
if(debug)
{
cout << "Writing Applications Map:" << endl;
}
IceDB::Dbi<string, ApplicationInfo, IceDB::IceContext, Ice::OutputStreamPtr>
apps(txn, "applications", dbContext, MDB_CREATE);
开发者ID:joshmoore,项目名称:ice,代码行数:67,代码来源:IceGridDB.cpp
示例11: getTestEndpoint
Test::MyClassPrxPtr
allTests(const Ice::CommunicatorPtr& communicator)
{
string ref = "test:" + getTestEndpoint(communicator, 0);
Ice::ObjectPrxPtr base = communicator->stringToProxy(ref);
test(base);
Test::MyClassPrxPtr cl = ICE_CHECKED_CAST(Test::MyClassPrx, base);
test(cl);
Test::MyClassPrxPtr oneway = cl->ice_oneway();
Test::MyClassPrxPtr batchOneway = cl->ice_batchOneway();
cout << "testing ice_invoke... " << flush;
{
Ice::ByteSeq inEncaps, outEncaps;
if(!oneway->ice_invoke("opOneway", ICE_ENUM(OperationMode, Normal), inEncaps, outEncaps))
{
test(false);
}
test(batchOneway->ice_invoke("opOneway", ICE_ENUM(OperationMode, Normal), inEncaps, outEncaps));
test(batchOneway->ice_invoke("opOneway", ICE_ENUM(OperationMode, Normal), inEncaps, outEncaps));
test(batchOneway->ice_invoke("opOneway", ICE_ENUM(OperationMode, Normal), inEncaps, outEncaps));
test(batchOneway->ice_invoke("opOneway", ICE_ENUM(OperationMode, Normal), inEncaps, outEncaps));
batchOneway->ice_flushBatchRequests();
Ice::OutputStreamPtr out = Ice::createOutputStream(communicator);
out->startEncapsulation();
out->write(testString);
out->endEncapsulation();
out->finished(inEncaps);
// ice_invoke
if(cl->ice_invoke("opString", ICE_ENUM(OperationMode, Normal), inEncaps, outEncaps))
{
Ice::InputStreamPtr in = Ice::createInputStream(communicator, outEncaps);
in->startEncapsulation();
string s;
in->read(s);
test(s == testString);
in->read(s);
test(s == testString);
in->endEncapsulation();
}
else
{
test(false);
}
// ice_invoke with array mapping
pair<const ::Ice::Byte*, const ::Ice::Byte*> inPair(&inEncaps[0], &inEncaps[0] + inEncaps.size());
if(cl->ice_invoke("opString", ICE_ENUM(OperationMode, Normal), inPair, outEncaps))
{
Ice::InputStreamPtr in = Ice::createInputStream(communicator, outEncaps);
in->startEncapsulation();
string s;
in->read(s);
test(s == testString);
in->read(s);
test(s == testString);
in->endEncapsulation();
}
else
{
test(false);
}
}
{
Ice::ByteSeq inEncaps, outEncaps;
if(cl->ice_invoke("opException", ICE_ENUM(OperationMode, Normal), inEncaps, outEncaps))
{
test(false);
}
else
{
Ice::InputStreamPtr in = Ice::createInputStream(communicator, outEncaps);
in->startEncapsulation();
try
{
in->throwException();
}
catch(const Test::MyException&)
{
}
catch(...)
{
test(false);
}
in->endEncapsulation();
}
}
cout << "ok" << endl;
cout << "testing asynchronous ice_invoke... " << flush;
#ifdef ICE_CPP11_MAPPING
//.........这里部分代码省略.........
开发者ID:joshmoore,项目名称:ice,代码行数:101,代码来源:AllTests.cpp
示例12: if
//.........这里部分代码省略.........
Ice::OutputStreamPtr out = Ice::createOutputStream(communicator());
out->startEncapsulation();
Demo::CPtr c = new Demo::C;
c->s.name = "blue";
c->s.value = Demo::blue;
out->write(c);
out->writePendingObjects();
out->endEncapsulation();
out->finished(inParams);
//
// Invoke operation.
//
if(!obj->ice_invoke("printClass", Ice::Normal, inParams, outParams))
{
cout << "Unknown user exception" << endl;
}
}
else if(ch == '8')
{
//
// Invoke operation.
//
Ice::ByteSeq inParams, outParams;
if(!obj->ice_invoke("getValues", Ice::Normal, inParams, outParams))
{
cout << "Unknown user exception" << endl;
continue;
}
//
// Unmarshal the results.
//
Ice::InputStreamPtr in = Ice::createInputStream(communicator(), outParams);
in->startEncapsulation();
Demo::CPtr c;
in->read(c);
string str;
in->read(str);
in->readPendingObjects();
in->endEncapsulation();
cout << "Got string `" << str << "' and class: s.name=" << c->s.name
<< ", s.value=" << c->s.value << endl;
}
else if(ch == '9')
{
//
// Invoke operation.
//
Ice::ByteSeq inParams, outParams;
if(obj->ice_invoke("throwPrintFailure", Ice::Normal, inParams, outParams))
{
cout << "Expected exception" << endl;
continue;
}
Ice::InputStreamPtr in = Ice::createInputStream(communicator(), outParams);
in->startEncapsulation();
try
{
in->throwException();
}
catch(const Demo::PrintFailure&)
{
// Expected.
}
开发者ID:2008hatake,项目名称:zeroc-ice,代码行数:67,代码来源:Client.cpp
示例13: test
Test::MyClassPrx
allTests(const Ice::CommunicatorPtr& communicator)
{
string ref = "test:default -p 12010";
Ice::ObjectPrx base = communicator->stringToProxy(ref);
test(base);
Test::MyClassPrx cl = Test::MyClassPrx::checkedCast(base);
test(cl);
Test::MyClassPrx oneway = cl->ice_oneway();
void (Callback::*nullEx)(const Ice::Exception&) = 0;
void (Callback::*nullExWC)(const Ice::Exception&, const CookiePtr&) = 0;
cout << "testing ice_invoke... " << flush;
{
Ice::ByteSeq inParams, outParams;
if(!oneway->ice_invoke("opOneway", Ice::Normal, inParams, outParams))
{
test(false);
}
Ice::OutputStreamPtr out = Ice::createOutputStream(communicator);
out->write(testString);
out->finished(inParams);
// ice_invoke
if(cl->ice_invoke("opString", Ice::Normal, inParams, outParams))
{
Ice::InputStreamPtr in = Ice::createInputStream(communicator, outParams);
string s;
in->read(s);
test(s == testString);
in->read(s);
test(s == testString);
}
else
{
test(false);
}
// ice_invoke with array mapping
pair<const ::Ice::Byte*, const ::Ice::Byte*> inPair(&inParams[0], &inParams[0] + inParams.size());
if(cl->ice_invoke("opString", Ice::Normal, inPair, outParams))
{
Ice::InputStreamPtr in = Ice::createInputStream(communicator, outParams);
string s;
in->read(s);
test(s == testString);
in->read(s);
test(s == testString);
}
else
{
test(false);
}
}
{
Ice::ByteSeq inParams, outParams;
if(cl->ice_invoke("opException", Ice::Normal, inParams, outParams))
{
test(false);
}
else
{
Ice::InputStreamPtr in = Ice::createInputStream(communicator, outParams);
try
{
in->throwException();
}
catch(const Test::MyException&)
{
}
catch(...)
{
test(false);
}
}
}
cout << "ok" << endl;
cout << "testing asynchronous ice_invoke... " << flush;
{
CookiePtr cookie = new Cookie();
Ice::ByteSeq inParams, outParams;
Ice::AsyncResultPtr result = oneway->begin_ice_invoke("opOneway", Ice::Normal, inParams);
if(!oneway->end_ice_invoke(outParams, result))
{
test(false);
}
Ice::OutputStreamPtr out = Ice::createOutputStream(communicator);
out->write(testString);
out->finished(inParams);
//.........这里部分代码省略.........
开发者ID:bholl,项目名称:zeroc-ice,代码行数:101,代码来源:AllTests.cpp
注:本文中的ice::InputStreamPtr类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论