本文整理汇总了C++中ice::CommunicatorPtr类的典型用法代码示例。如果您正苦于以下问题:C++ CommunicatorPtr类的具体用法?C++ CommunicatorPtr怎么用?C++ CommunicatorPtr使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CommunicatorPtr类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: main
int main (int argc, char* argv[]) {
int status;
Ice::CommunicatorPtr ic;
try {
ic = Ice::initialize(argc, argv);
// Contact to Encoders
Ice::ObjectPrx Encoders = ic->propertyToProxy("automata.Encoders.Proxy");
if (Encoders == 0)
throw "Could not create proxy with Encoders";
Encodersprx = jderobot::EncodersPrx::checkedCast(Encoders);
if (Encodersprx == 0)
throw "Invalid proxy automata.Encoders.Proxy";
std::cout << "Encoders connected" << std::endl;
// Contact to Motors
Ice::ObjectPrx Motors = ic->propertyToProxy("automata.Motors.Proxy");
if (Motors == 0)
throw "Could not create proxy with Motors";
Motorsprx = jderobot::MotorsPrx::checkedCast(Motors);
if (Motorsprx == 0)
throw "Invalid proxy automata.Motors.Proxy";
std::cout << "Motors connected" << std::endl;
automatagui = new AutomataGui(argc, argv);
displayAutomataGui = showAutomataGui();
pthread_create(&thr_sub_1, NULL, &subautomata_1, NULL);
pthread_join(thr_sub_1, NULL);
if (displayAutomataGui)
pthread_join(thr_automatagui, NULL);
} catch ( const Ice::Exception& ex ) {
std::cerr << ex << std::endl;
status = 1;
} catch ( const char* msg ) {
std::cerr << msg << std::endl;
status = 1;
}
if (ic)
ic->destroy();
return status;
}
开发者ID:reysam93,项目名称:TFG,代码行数:46,代码来源:example3.cpp
示例2: ServantLocatorAMDI
int
run(int, char**, const Ice::CommunicatorPtr& communicator)
{
communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010:udp");
communicator->getProperties()->setProperty("Ice.Warn.Dispatch", "0");
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter");
adapter->addServantLocator(new ServantLocatorAMDI(""), "");
adapter->addServantLocator(new ServantLocatorAMDI("category"), "category");
adapter->add(new TestAMDI, communicator->stringToIdentity("asm"));
adapter->add(new TestActivationI, communicator->stringToIdentity("test/activation"));
adapter->activate();
TEST_READY
adapter->waitForDeactivate();
return EXIT_SUCCESS;
}
开发者ID:dayongxie,项目名称:zeroc-ice-androidndk,代码行数:17,代码来源:ServerAMD.cpp
示例3: main
int main(int argc, char** argv) {
int status;
cameraview::colorTuner viewer;
Ice::CommunicatorPtr ic;
try {
ic = EasyIce::initialize(argc,argv);
Ice::ObjectPrx base = ic->propertyToProxy("Cameraview.Camera.Proxy");
if (0==base)
throw "Could not create proxy";
/*cast to CameraPrx*/
jderobot::CameraPrx cprx = jderobot::CameraPrx::checkedCast(base);
if (0==cprx)
throw "Invalid proxy";
while(viewer.isVisible()) {
jderobot::ImageDataPtr data = cprx->getImageData(colorspaces::ImageRGB8::FORMAT_RGB8.get()->name);
cv::Mat image = cv::Mat(cv::Size(data->description->width,data->description->height),CV_8UC3,&(data->pixelData[0]));
colorspaces::Image::FormatPtr fmt = colorspaces::Image::Format::searchFormat(data->description->format);
if (!fmt)
throw "Format not supported";
viewer.display(image);
image.release();
}
} catch (const Ice::Exception& ex) {
std::cerr << ex << std::endl;
status = 1;
} catch (const char* msg) {
std::cerr << msg << std::endl;
status = 1;
}
if (ic)
ic->destroy();
return status;
}
开发者ID:aitormf,项目名称:JdeRobot,代码行数:46,代码来源:colorTuner.cpp
示例4: Dispatcher
int
main(int argc, char* argv[])
{
int status;
Ice::CommunicatorPtr communicator;
try
{
Ice::InitializationData initData;
initData.properties = Ice::createProperties(argc, argv);
#ifdef ICE_CPP11
Ice::DispatcherPtr dispatcher = new Dispatcher();
initData.dispatcher = Ice::newDispatcher(
[=](const Ice::DispatcherCallPtr& call, const Ice::ConnectionPtr& conn)
{
dispatcher->dispatch(call, conn);
});
#else
initData.dispatcher = new Dispatcher();
#endif
communicator = Ice::initialize(argc, argv, initData);
status = run(argc, argv, communicator);
}
catch(const Ice::Exception& ex)
{
cerr << ex << endl;
status = EXIT_FAILURE;
}
if(communicator)
{
try
{
communicator->destroy();
}
catch(const Ice::Exception& ex)
{
cerr << ex << endl;
status = EXIT_FAILURE;
}
}
Dispatcher::terminate();
return status;
}
开发者ID:dayongxie,项目名称:zeroc-ice-androidndk,代码行数:45,代码来源:Server.cpp
示例5: gui
int
main(int argc, char* argv[])
{
int status = 0;
int count=0;
Ice::CommunicatorPtr ic;
GUI gui(argc, argv);
try {
ic = Ice::initialize(argc, argv);
Ice::ObjectPrx base = ic->stringToProxy("AirportInterface:default -p 10000");
if (!base)
throw "Invalid base";
ATCDisplay::AirportInterfacePrx airportsim = ATCDisplay::AirportInterfacePrx::checkedCast(base);
if (!airportsim)
throw "Invalid proxy";
int milisec = 100; // length of time to sleep, in miliseconds
struct timespec req;
req.tv_sec = 0;
req.tv_nsec = milisec * 1000000L;
//while(1)
//std::cout<<airportsim->getPoints()<<std::endl;
gui.init(airportsim);
gui.run();
} catch (const Ice::Exception& ex) {
cerr << ex << endl;
status = 1;
} catch (const char* msg) {
cerr << msg << endl;
status = 1;
}
if (ic)
ic->destroy();
return status;
}
开发者ID:JGabrielGalindo,项目名称:ATCSim,代码行数:45,代码来源:cppgui.cpp
示例6: run
int
main(int argc, char* argv[])
{
#ifdef ICE_STATIC_LIBS
Ice::registerIceSSL();
#endif
int status;
Ice::CommunicatorPtr communicator;
try
{
Ice::InitializationData initData;
initData.properties = Ice::createProperties(argc, argv);
initData.properties->setProperty("Ice.Warn.Dispatch", "0");
initData.properties->setProperty("Ice.Warn.Connections", "0");
initData.properties->setProperty("TestAdapter.Endpoints", "default -p 12010:udp");
initData.properties->setProperty("Ice.MessageSizeMax", "10"); // 10KB max
initData.properties->setProperty("TestAdapter2.Endpoints", "default -p 12011");
initData.properties->setProperty("TestAdapter2.MessageSizeMax", "0");
initData.properties->setProperty("TestAdapter3.Endpoints", "default -p 12012");
initData.properties->setProperty("TestAdapter3.MessageSizeMax", "1");
communicator = Ice::initialize(argc, argv, initData);
status = run(argc, argv, communicator);
}
catch(const Ice::Exception& ex)
{
cerr << ex << endl;
status = EXIT_FAILURE;
}
if(communicator)
{
try
{
communicator->destroy();
}
catch(const Ice::Exception& ex)
{
cerr << ex << endl;
status = EXIT_FAILURE;
}
}
return status;
}
开发者ID:RichardChengshaojin,项目名称:ice,代码行数:45,代码来源:ServerAMD.cpp
示例7: init
// ######################################################################
void PrimaryMotorCortexI::init(Ice::CommunicatorPtr ic, Ice::ObjectAdapterPtr adapter)
{
Ice::ObjectPtr pmcPtr = this;
itsObjectPrx = adapter->add(pmcPtr,
ic->stringToIdentity("PrimaryMotorCortex"));
IceStorm::TopicPrx topicPrx;
itsTopicsSubscriptions.push_back(SimEventsUtils::TopicInfo("ActionMessageTopic", topicPrx));
SimEventsUtils::initSimEvents(ic, itsObjectPrx, itsTopicsSubscriptions);
Ice::ObjectPrx base = ic->stringToProxy(
"IRobotService:default -p 10000 -h roomba");
itsRobot = Robots::IRobotPrx::checkedCast(base);
if(!itsRobot) LFATAL("Invalid Robot Proxy");
itsRobot->sendStart();
itsRobot->setMode(Robots::SafeMode);
}
开发者ID:ulyssesrr,项目名称:carmen_lcad,代码行数:19,代码来源:PrimaryMotorCortexI.C
示例8: allTests
int
run(int, char**, const Ice::CommunicatorPtr& communicator, const CommunicatorObserverIPtr& observer)
{
communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0));
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter");
adapter->add(ICE_MAKE_SHARED(MetricsI), Ice::stringToIdentity("metrics"));
//adapter->activate(); // Don't activate OA to ensure collocation is used.
communicator->getProperties()->setProperty("ControllerAdapter.Endpoints", getTestEndpoint(communicator, 1));
Ice::ObjectAdapterPtr controllerAdapter = communicator->createObjectAdapter("ControllerAdapter");
controllerAdapter->add(ICE_MAKE_SHARED(ControllerI, adapter), Ice::stringToIdentity("controller"));
//controllerAdapter->activate(); // Don't activate OA to ensure collocation is used.
MetricsPrxPtr allTests(const Ice::CommunicatorPtr&, const CommunicatorObserverIPtr&);
MetricsPrxPtr metrics = allTests(communicator, observer);
metrics->shutdown();
return EXIT_SUCCESS;
}
开发者ID:ming-hai,项目名称:ice,代码行数:18,代码来源:Collocated.cpp
示例9: allTests
int
run(int, char**, const Ice::CommunicatorPtr& communicator)
{
Ice::ObjectFactoryPtr factory = new MyObjectFactory;
communicator->addObjectFactory(factory, "::Test::B");
communicator->addObjectFactory(factory, "::Test::C");
communicator->addObjectFactory(factory, "::Test::D");
communicator->addObjectFactory(factory, "::Test::E");
communicator->addObjectFactory(factory, "::Test::F");
communicator->addObjectFactory(factory, "::Test::I");
communicator->addObjectFactory(factory, "::Test::J");
communicator->addObjectFactory(factory, "::Test::H");
InitialPrx allTests(const Ice::CommunicatorPtr&);
InitialPrx initial = allTests(communicator);
initial->shutdown();
return EXIT_SUCCESS;
}
开发者ID:Jonavin,项目名称:ice,代码行数:18,代码来源:Client.cpp
示例10: setSpeeds
void MainWindow::setSpeeds(Ice::CommunicatorPtr ic){
Ice::PropertiesPtr prop = ic->getProperties();
this->max_x = std::atof( prop->getPropertyWithDefault("UAVViewer.Xmax", "0.3").c_str() );
this->max_y = std::atof( prop->getPropertyWithDefault("UAVViewer.Ymax", "0.3").c_str() );
this->max_z = std::atof( prop->getPropertyWithDefault("UAVViewer.Zmax", "0.3").c_str() );
this->max_yaw = std::atof( prop->getPropertyWithDefault("UAVViewer.Yawmax", "0.3").c_str() );
}
开发者ID:aitormf,项目名称:JdeRobot,代码行数:9,代码来源:mainwindow.cpp
示例11: ClientError
Glacier2::RouterPrx const client::getRouter(const Ice::CommunicatorPtr& comm) const {
Ice::RouterPrx prx = comm->getDefaultRouter();
if ( ! prx ) {
throw omero::ClientError(__FILE__,__LINE__,"No default router found.");
}
Glacier2::RouterPrx router = Glacier2::RouterPrx::checkedCast(prx);
if ( ! router ) {
throw ClientError(__FILE__, __LINE__, "Error obtaining Glacier2 router");
}
// For whatever reason, we have to set the context
// on the router context here as well.
router = Glacier2::RouterPrx::uncheckedCast(router->ice_context(comm->getImplicitContext()->getContext()));
return router;
}
开发者ID:Daniel-Walther,项目名称:openmicroscopy,代码行数:18,代码来源:client.cpp
示例12: getTestEndpoint
int
run(int, char**, const Ice::CommunicatorPtr& communicator)
{
communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0));
communicator->getProperties()->setProperty("TestAdapter.ACM.Timeout", "0");
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter");
Ice::Identity id = Ice::stringToIdentity("communicator");
adapter->add(ICE_MAKE_SHARED(RemoteCommunicatorI), id);
adapter->activate();
TEST_READY
// Disable ready print for further adapters.
communicator->getProperties()->setProperty("Ice.PrintAdapterReady", "0");
communicator->waitForShutdown();
return EXIT_SUCCESS;
}
开发者ID:yuanbaopapa,项目名称:ice,代码行数:18,代码来源:Server.cpp
示例13: initialize
void MyUtil::initialize() {
ServiceI& service = ServiceI::instance();
service.getAdapter()->add(&FeedFocusInvertI::instance(), service.createIdentity(
"M", ""));
Ice::CommunicatorPtr communicator = service.getCommunicator();
int mod = communicator->getProperties()->getPropertyAsInt( "FeedFocusInvert.Mod");
int interval = communicator->getProperties()->getPropertyAsIntWithDefault( "FeedFocusInvert.Interval", 5);
xce::serverstate::ServerStateSubscriber::instance().initialize( "ControllerFeedFocusInvertR", &FeedFocusInvertI::instance(), mod, interval,
new XceFeedChannel());
//register 2 controller
xce::feed::serverstate::FeedServerStateSubscriber::instance().initialize( "ControllerFeedFocusInvertR", &FeedFocusInvertI::instance(), mod, interval,
new XceFeedControllerChannel());
MCE_INFO("MyUtil::initialize. mod:" << mod << " interval:" << interval);
TaskManager::instance().scheduleRepeated(&FeedFocusInvertStatTimer::instance());
}
开发者ID:gunner14,项目名称:old_rr_code,代码行数:18,代码来源:FeedFocusInvertI.cpp
示例14:
int
run(int, char**, const Ice::CommunicatorPtr& communicator)
{
communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010");
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter");
adapter->add(ICE_MAKE_SHARED(MetricsI), Ice::stringToIdentity("metrics"));
adapter->activate();
communicator->getProperties()->setProperty("ControllerAdapter.Endpoints", "default -p 12011");
Ice::ObjectAdapterPtr controllerAdapter = communicator->createObjectAdapter("ControllerAdapter");
controllerAdapter->add(ICE_MAKE_SHARED(ControllerI, adapter), Ice::stringToIdentity("controller"));
controllerAdapter->activate();
TEST_READY
communicator->waitForShutdown();
return EXIT_SUCCESS;
}
开发者ID:hadoop835,项目名称:ice,代码行数:18,代码来源:ServerAMD.cpp
示例15: initMotors
Thread_control::Thread_control(Ice::CommunicatorPtr ic, KobukiManager* kobuki_manager)
{
this->ic = ic;
prop = ic->getProperties();
this->kobuki_manager = kobuki_manager;
initMotors();
initEncoders();
}
开发者ID:AeroCano,项目名称:JdeRobot,代码行数:9,代码来源:thread_control.cpp
示例16: run
int
main(int argc, char* argv[])
{
#ifdef ICE_STATIC_LIBS
Ice::registerIceSSL();
#endif
int status;
Ice::CommunicatorPtr communicator;
try
{
//
// In this test, we need a longer server idle time, otherwise
// our test servers may time out before they are used in the
// test.
//
Ice::InitializationData initData;
initData.properties = Ice::createProperties(argc, argv);
initData.properties->setProperty("Ice.ServerIdleTime", "120"); // Two minutes.
communicator = Ice::initialize(argc, argv, initData);
status = run(argc, argv, communicator);
}
catch(const Ice::Exception& ex)
{
cerr << ex << endl;
status = EXIT_FAILURE;
}
if(communicator)
{
try
{
communicator->destroy();
}
catch(const Ice::Exception& ex)
{
cerr << ex << endl;
status = EXIT_FAILURE;
}
}
return status;
}
开发者ID:RichardChengshaojin,项目名称:ice,代码行数:44,代码来源:Server.cpp
示例17: main
int main(int argc, char **argv) {
Ice::CommunicatorPtr ic;
jderobot::cameraClient* camRGB;
try {
ic = EasyIce::initialize(argc, argv);
Ice::ObjectPrx base = ic->propertyToProxy("Cameraview.Camera.Proxy");
Ice::PropertiesPtr prop = ic->getProperties();
if (0==base)
throw "Could not create Proxy\n";
camRGB = new jderobot::cameraClient(ic, "Cameraview.Camera.");
if (camRGB == NULL) {
throw "Invalid Proxy";
} else {
camRGB->start();
std::cout << "Using ICE camera server..";
cv::Mat rgb;
while(1) {
camRGB->getImage(rgb);
if (rgb.rows==0 || rgb.cols==0) continue;
imshow("frame:ICE", rgb);
waitKey(33);
}
}
} catch (const char* msg) {
}
ros::init(argc, argv, "listener");
ros::NodeHandle n,nh;
image_transport::ImageTransport it(nh);
image_transport::Subscriber camera_sub = it.subscribe("cameratopic", 1000, cameracallback);
ros::Subscriber sub = n.subscribe("chatter", 1001, chatterCallback);
ros::spin();
return 0;
}
开发者ID:JdeRobot,项目名称:colab-satyaki,代码行数:44,代码来源:CameraClient.cpp
示例18: main
int main(int argc, char ** argv){
vector<string> names;
if(argc == 1){
cout << "useage:" << endl;
cout << "1. Dump all instances : " << argv[0] << " " << DUMPALL << endl;
cout << "2. Dump specified instances,combine instances by space : " << argv[0] << " instance1 [...]" << endl;
cout << "\nexample:" << endl;
cout << argv[0] << " vipmember user_config buddycore_friend_a" << endl;
return 0;
} else if (argc >= 2) {
string name = argv[1];
if(name == DUMPALL) {
names.push_back("");
} else {
for(int i=1; i<argc; i++) {
names.push_back(argv[i]);
}
}
} else {
cout << "Argument error" << endl;
return 0;
}
MyUtil::OceChannel channel;
Ice::CommunicatorPtr ic = channel.getCommunicator();
DbDescriptorPrx proxy = DbDescriptorPrx::checkedCast(ic->stringToProxy("[email protected]"));
cout << "dumping..." << endl;
for(vector<string>::iterator iv = names.begin(); iv < names.end(); iv++){
if((*iv) == ""){
DbInstanceSeq instances = proxy->getDbInstances();
cout << "Instances size = " << instances.size() << endl;
for(DbInstanceSeq::iterator it = instances.begin(); it != instances.end(); it++){
dumpObserver(proxy, (*it)->name);
}
} else {
dumpObserver(proxy, (*iv));
}
}
ic->destroy();
cout << "done." << endl;
return 0;
}
开发者ID:bradenwu,项目名称:oce,代码行数:44,代码来源:main.cpp
示例19: admin
TraceLevels::TraceLevels(const Ice::CommunicatorPtr& communicator, const string& prefix) :
admin(0),
adminCat("Admin"),
application(0),
applicationCat("Application"),
node(0),
nodeCat("Node"),
replica(0),
replicaCat("Replica"),
server(0),
serverCat("Server"),
adapter(0),
adapterCat("Adapter"),
object(0),
objectCat("Object"),
activator(0),
activatorCat("Activator"),
patch(0),
patchCat("Patch"),
locator(0),
locatorCat("Locator"),
session(0),
sessionCat("Session"),
discovery(0),
discoveryCat("Discovery"),
logger(communicator->getLogger())
{
Ice::PropertiesPtr properties = communicator->getProperties();
string keyBase = prefix + ".Trace.";
const_cast<int&>(admin) = properties->getPropertyAsInt(keyBase + adminCat);
const_cast<int&>(application) = properties->getPropertyAsInt(keyBase + applicationCat);
const_cast<int&>(node) = properties->getPropertyAsInt(keyBase + nodeCat);
const_cast<int&>(replica) = properties->getPropertyAsInt(keyBase + replicaCat);
const_cast<int&>(server) = properties->getPropertyAsInt(keyBase + serverCat);
const_cast<int&>(adapter) = properties->getPropertyAsInt(keyBase + adapterCat);
const_cast<int&>(object) = properties->getPropertyAsInt(keyBase + objectCat);
const_cast<int&>(activator) = properties->getPropertyAsInt(keyBase + activatorCat);
const_cast<int&>(patch) = properties->getPropertyAsInt(keyBase + patchCat);
const_cast<int&>(locator) = properties->getPropertyAsInt(keyBase + locatorCat);
const_cast<int&>(session) = properties->getPropertyAsInt(keyBase + sessionCat);
const_cast<int&>(discovery) = properties->getPropertyAsInt(keyBase + discoveryCat);
}
开发者ID:ming-hai,项目名称:ice,代码行数:43,代码来源:TraceLevels.cpp
示例20: run
int
main(int argc, char* argv[])
{
int status;
Ice::CommunicatorPtr communicator;
try
{
//
// In this test, we need at least two threads in the
// client side thread pool for nested AMI.
//
Ice::InitializationData initData;
initData.properties = Ice::createProperties(argc, argv);
initData.properties->setProperty("Ice.ThreadPool.Client.Size", "2");
initData.properties->setProperty("Ice.ThreadPool.Client.SizeWarn", "0");
initData.properties->setProperty("Ice.BatchAutoFlushSize", "100");
communicator = Ice::initialize(argc, argv, initData);
status = run(argc, argv, communicator, initData);
}
catch(const Ice::Exception& ex)
{
cerr << ex << endl;
status = EXIT_FAILURE;
}
if(communicator)
{
try
{
communicator->destroy();
}
catch(const Ice::Exception& ex)
{
cerr << ex << endl;
status = EXIT_FAILURE;
}
}
return status;
}
开发者ID:Jonavin,项目名称:ice,代码行数:43,代码来源:Client.cpp
注:本文中的ice::CommunicatorPtr类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论