本文整理汇总了C++中ice::ObjectPtr类的典型用法代码示例。如果您正苦于以下问题:C++ ObjectPtr类的具体用法?C++ ObjectPtr怎么用?C++ ObjectPtr使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ObjectPtr类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char** argv)
{
Ice::ObjectPtr viewerPtr;
//signal(SIGINT,signalHandler);
Ice::CommunicatorPtr ic;
try{
ic = EasyIce::initialize(argc, argv);
Ice::PropertiesPtr prop = ic->getProperties();
std::string Endpoints = prop->getProperty("Visualization.Endpoints");
// Naming Service
int nsActive = prop->getPropertyAsIntWithDefault("NamingService.Enabled", 0);
if (nsActive)
{
std::string ns_proxy = prop->getProperty("NamingService.Proxy");
try
{
namingService = new jderobot::ns(ic, ns_proxy);
}
catch (Ice::ConnectionRefusedException& ex)
{
jderobot::Logger::getInstance()->error("Impossible to connect with NameService!");
exit(-1);
}
}
Ice::ObjectAdapterPtr adapter =ic->createObjectAdapterWithEndpoints("Visualization", Endpoints);
std::string objPrefix("Visualization.");
std::string viewerName = prop->getProperty(objPrefix + "Name");
Ice::ObjectPtr object = new visualization::VisualizationI(objPrefix, ic);
adapter->add(object, ic->stringToIdentity(viewerName));
if (namingService)
namingService->bind(viewerName, Endpoints, object->ice_staticId());
adapter->activate();
ic->waitForShutdown();
}catch (const Ice::Exception& ex) {
std::cerr << ex<<" 1 " << std::endl;
exit(-1);
} catch (const char* msg) {
std::cerr << msg<< " 2 " << std::endl;
exit(-1);
}
}
示例2: Exception
void
createAdminInterface( const Context& context, Ice::ObjectPtr& object, const orca::FQComponentName& fqName )
{
if ( object==0 )
throw gbxutilacfr::Exception( ERROR_INFO, "Cannot add a null object to the admin interface" );
const std::string interfaceType = object->ice_id();
const std::string facetName = orcaice::toAdminFacet( fqName, interfaceType );
// try
// {
context.communicator()->addAdminFacet( object, facetName );
context.tracer().info( string("Added admin facet ")+facetName );
// }
// catch ( const Ice::AlreadyRegisteredException& e )
// {
// stringstream ss;
// ss << "(while installng "<<facetName<<" facet) : "<<e.what();
// context_.tracer().error( ss.str() );
// context_.shutdown();
//
// }
// manually to home registry
orca::ProvidedInterface iface;
iface.name = facetName;
// this is a local call
iface.id = interfaceType;
context.home().addProvidedInterface( iface );
}
示例3: initialize
virtual void
initialize(const Ice::ObjectAdapterPtr& /*adapter*/, const Ice::Identity& /*identity*/, const string& /*facet*/,
const Ice::ObjectPtr& servant)
{
BetI* bet = dynamic_cast<BetI*>(servant.get());
bet->init(_server._betEvictor, _server._bankEdge);
}
示例4: assert
void
HSFoward::__patch__HSBnsProcPtr(void* __addr, ::Ice::ObjectPtr& v)
{
::HSFoward::HSBnsProcPtr* p = static_cast< ::HSFoward::HSBnsProcPtr*>(__addr);
assert(p);
*p = ::HSFoward::HSBnsProcPtr::dynamicCast(v);
if(v && !*p)
{
IceInternal::Ex::throwUOE(::HSFoward::HSBnsProc::ice_staticId(), v->ice_id());
}
}
示例5: assert
void
MyUtil::__patch__GlobalIdPtr(void* __addr, ::Ice::ObjectPtr& v)
{
::MyUtil::GlobalIdPtr* p = static_cast< ::MyUtil::GlobalIdPtr*>(__addr);
assert(p);
*p = ::MyUtil::GlobalIdPtr::dynamicCast(v);
if(v && !*p)
{
IceInternal::Ex::throwUOE(::MyUtil::GlobalId::ice_staticId(), v->ice_id());
}
}
示例6: assert
void
Factory::__patch__DeviceFactoryPtr(void* __addr, ::Ice::ObjectPtr& v)
{
::Factory::DeviceFactoryPtr* p = static_cast< ::Factory::DeviceFactoryPtr*>(__addr);
assert(p);
*p = ::Factory::DeviceFactoryPtr::dynamicCast(v);
if(v && !*p)
{
IceInternal::Ex::throwUOE(::Factory::DeviceFactory::ice_staticId(), v->ice_id());
}
}
示例7: assert
void
level1::level2::__patch__testPtr(void* __addr, ::Ice::ObjectPtr& v)
{
::level1::level2::testPtr* p = static_cast< ::level1::level2::testPtr*>(__addr);
assert(p);
*p = ::level1::level2::testPtr::dynamicCast(v);
if(v && !*p)
{
IceInternal::Ex::throwUOE(::level1::level2::test::ice_staticId(), v->ice_id());
}
}
示例8: assert
void ICE_DECLSPEC_EXPORT
loggerice::__patch__loggerctrlPtr(void* __addr, ::Ice::ObjectPtr& v)
{
::loggerice::loggerctrlPtr* p = static_cast< ::loggerice::loggerctrlPtr*>(__addr);
assert(p);
*p = ::loggerice::loggerctrlPtr::dynamicCast(v);
if(v && !*p)
{
IceInternal::Ex::throwUOE(::loggerice::loggerctrl::ice_staticId(), v->ice_id());
}
}
示例9: assert
void
jderobot::__patch__QuadrotorPtr(void* __addr, ::Ice::ObjectPtr& v)
{
::jderobot::QuadrotorPtr* p = static_cast< ::jderobot::QuadrotorPtr*>(__addr);
assert(p);
*p = ::jderobot::QuadrotorPtr::dynamicCast(v);
if(v && !*p)
{
IceInternal::Ex::throwUOE(::jderobot::Quadrotor::ice_staticId(), v->ice_id());
}
}
示例10: assert
void
Temp::__patch__TimeInfoPtr(void* __addr, ::Ice::ObjectPtr& v)
{
::Temp::TimeInfoPtr* p = static_cast< ::Temp::TimeInfoPtr*>(__addr);
assert(p);
*p = ::Temp::TimeInfoPtr::dynamicCast(v);
if(v && !*p)
{
IceInternal::Ex::throwUOE(::Temp::TimeInfo::ice_staticId(), v->ice_id());
}
}
示例11: assert
void
Communication::__patch__DataInterfacePtr(void* __addr, ::Ice::ObjectPtr& v)
{
::Communication::DataInterfacePtr* p = static_cast< ::Communication::DataInterfacePtr*>(__addr);
assert(p);
*p = ::Communication::DataInterfacePtr::dynamicCast(v);
if(v && !*p)
{
IceInternal::Ex::throwUOE(::Communication::DataInterface::ice_staticId(), v->ice_id());
}
}
示例12: assert
void
GlobalTable::__patch__DistributedMapPtr(void* __addr, ::Ice::ObjectPtr& v)
{
::GlobalTable::DistributedMapPtr* p = static_cast< ::GlobalTable::DistributedMapPtr*>(__addr);
assert(p);
*p = ::GlobalTable::DistributedMapPtr::dynamicCast(v);
if(v && !*p)
{
IceInternal::Ex::throwUOE(::GlobalTable::DistributedMap::ice_staticId(), v->ice_id());
}
}
示例13: assert
void
orca::util::__patch__LatencyPingerPtr(void* __addr, ::Ice::ObjectPtr& v)
{
::orca::util::LatencyPingerPtr* p = static_cast< ::orca::util::LatencyPingerPtr*>(__addr);
assert(p);
*p = ::orca::util::LatencyPingerPtr::dynamicCast(v);
if(v && !*p)
{
::Ice::UnexpectedObjectException e(__FILE__, __LINE__);
e.type = v->ice_id();
e.expectedType = ::orca::util::LatencyPinger::ice_staticId();
throw e;
}
}
示例14: tprintf
TestIntfPrx
allTests(const Ice::CommunicatorPtr& communicator)
{
Ice::ObjectPrx obj = communicator->stringToProxy("Test:default -p 12010");
TestIntfPrx test = TestIntfPrx::checkedCast(obj);
tprintf("base as Object... ");
{
Ice::ObjectPtr o;
try
{
o = test->SBaseAsObject();
test(o);
test(o->ice_id() == "::Test::SBase");
}
catch(...)
{
test(0);
}
SBasePtr sb = SBasePtr::dynamicCast(o);
test(sb);
test(sb->sb == "SBase.sb");
}
tprintf("ok\n");
tprintf("base as base... ");
{
SBasePtr sb;
try
{
sb = test->SBaseAsSBase();
test(sb->sb == "SBase.sb");
}
catch(...)
{
test(0);
}
}
tprintf("ok\n");
tprintf("base with known derived as base... ");
{
SBasePtr sb;
try
{
sb = test->SBSKnownDerivedAsSBase();
test(sb->sb == "SBSKnownDerived.sb");
}
catch(...)
{
test(0);
}
SBSKnownDerivedPtr sbskd = SBSKnownDerivedPtr::dynamicCast(sb);
test(sbskd);
test(sbskd->sbskd == "SBSKnownDerived.sbskd");
}
tprintf("ok\n");
tprintf("base with known derived as known derived... ");
{
SBSKnownDerivedPtr sbskd;
try
{
sbskd = test->SBSKnownDerivedAsSBSKnownDerived();
test(sbskd->sbskd == "SBSKnownDerived.sbskd");
}
catch(...)
{
test(0);
}
}
tprintf("ok\n");
tprintf("base with unknown derived as base... ");
{
SBasePtr sb;
try
{
sb = test->SBSUnknownDerivedAsSBase();
test(sb->sb == "SBSUnknownDerived.sb");
}
catch(...)
{
test(0);
}
}
tprintf("ok\n");
tprintf("unknown with Object as Object... ");
{
Ice::ObjectPtr o;
try
{
o = test->SUnknownAsObject();
test(0);
}
catch(const Ice::MarshalException&)
{
}
catch(...)
//.........这里部分代码省略.........
示例15: assert
void
SeaBeeSimEvents::__patch__CameraConfigMessagePtr(void* __addr, ::Ice::ObjectPtr& v)
{
::SeaBeeSimEvents::CameraConfigMessagePtr* p = static_cast< ::SeaBeeSimEvents::CameraConfigMessagePtr*>(__addr);
assert(p);
*p = ::SeaBeeSimEvents::CameraConfigMessagePtr::dynamicCast(v);
if(v && !*p)
{
IceInternal::Ex::throwUOE(::SeaBeeSimEvents::CameraConfigMessage::ice_staticId(), v->ice_id());
}
}