本文整理汇总了C++中ice::ObjectAdapterPtr::getCommunicator方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectAdapterPtr::getCommunicator方法的具体用法?C++ ObjectAdapterPtr::getCommunicator怎么用?C++ ObjectAdapterPtr::getCommunicator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ice::ObjectAdapterPtr
的用法示例。
在下文中一共展示了ObjectAdapterPtr::getCommunicator方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FileCache
NodeI::NodeI(const Ice::ObjectAdapterPtr& adapter,
NodeSessionManager& sessions,
const ActivatorPtr& activator,
const IceUtil::TimerPtr& timer,
const TraceLevelsPtr& traceLevels,
const NodePrx& proxy,
const string& name,
const UserAccountMapperPrx& mapper,
const string& instanceName) :
_communicator(adapter->getCommunicator()),
_adapter(adapter),
_sessions(sessions),
_activator(activator),
_timer(timer),
_traceLevels(traceLevels),
_name(name),
_proxy(proxy),
_redirectErrToOut(false),
_allowEndpointsOverride(false),
_waitTime(0),
_instanceName(instanceName),
_userAccountMapper(mapper),
_platform("IceGrid.Node", _communicator, _traceLevels),
_fileCache(new FileCache(_communicator)),
_serial(1),
_consistencyCheckDone(false)
{
Ice::PropertiesPtr props = _communicator->getProperties();
const_cast<string&>(_dataDir) = _platform.getDataDir();
const_cast<string&>(_serversDir) = _dataDir + "/servers";
const_cast<string&>(_tmpDir) = _dataDir + "/tmp";
const_cast<Ice::Int&>(_waitTime) = props->getPropertyAsIntWithDefault("IceGrid.Node.WaitTime", 60);
const_cast<string&>(_outputDir) = props->getProperty("IceGrid.Node.Output");
const_cast<bool&>(_redirectErrToOut) = props->getPropertyAsInt("IceGrid.Node.RedirectErrToOut") > 0;
const_cast<bool&>(_allowEndpointsOverride) = props->getPropertyAsInt("IceGrid.Node.AllowEndpointsOverride") > 0;
//
// Parse the properties override property.
//
vector<string> overrides = props->getPropertyAsList("IceGrid.Node.PropertiesOverride");
if(!overrides.empty())
{
for(vector<string>::iterator p = overrides.begin(); p != overrides.end(); ++p)
{
if(p->find("--") != 0)
{
*p = "--" + *p;
}
}
Ice::PropertiesPtr p = Ice::createProperties();
p->parseCommandLineOptions("", overrides);
Ice::PropertyDict propDict = p->getPropertiesForPrefix("");
for(Ice::PropertyDict::const_iterator q = propDict.begin(); q != propDict.end(); ++q)
{
_propertiesOverride.push_back(createProperty(q->first, q->second));
}
}
}
示例2: TestI
RemoteObjectAdapterI::RemoteObjectAdapterI(const Ice::ObjectAdapterPtr& adapter) :
_adapter(adapter),
_testIntf(TestIntfPrx::uncheckedCast(_adapter->add(new TestI(),
adapter->getCommunicator()->stringToIdentity("test"))))
{
_adapter->activate();
}
示例3: main
int main(int argc, char *argv[]) {
int status = 0;
Ice::CommunicatorPtr ic;
try {
ic = Ice::initialize(argc, argv);
Ice::ObjectAdapterPtr adapter
= ic->createObjectAdapterWithEndpoints(
"SimplePrinterAdapter", "default -p 10000");
Ice::ObjectPtr object = new PrinterI;
adapter->add(object,
adapter->getCommunicator()->stringToIdentity("SimplePrinter"));
adapter->activate();
ic->waitForShutdown();
} catch (const Ice::Exception &e) {
cerr << e << endl;
status = 1;
} catch (const char *msg) {
cerr << msg << endl;
status = 1;
}
if (ic) {
try {
ic->destroy();
} catch (const Ice::Exception &e) {
cerr << e << endl;
status = 1;
}
}
return status;
}