call_funcs.cxx

来自「这是经典的CORBA程序」· CXX 代码 · 共 68 行

CXX
68
字号
//-----------------------------------------------------------------------------// Copyright (c) 2003-2020 EBUPT INFO CO.,LTD//-----------------------------------------------------------------------------//// Client-side calling functions that invoke operations on the server.//#include <omg/orb.hh>#include "call_funcs.h"#include "it_print_funcs.h"#include "it_random_funcs.h"#include <it_cal/iostream.h>IT_USING_NAMESPACE_STD// Declare the global ORB defined in the client main file.//extern CORBA::ORB_varglobal_orb;// call_Hello_getGreeting -- client function that illustrates how to invoke IDL // operation Hello::getGreeting.//voidcall_Hello_getGreeting(    Hello_ptr IT_obj){    // Variables to be used as parameters to the call    //    CORBA::String_var               _result;    cout << "call_Hello_getGreeting(): invoking operation" << endl;    //--------    // Make the call and handle any exceptions that are thrown    //--------    try {        _result = IT_obj->getGreeting();    }    catch(const CORBA::SystemException &ex) {        cout << "call_Hello_getGreeting(): call failed." << endl             << ex << endl;        //--------        // No memory management issues to take care of        //--------        return;    }    // Diagnostics: print the values of "out" and "inout" parameters,    // and return value, if any.    //    cout << "call_Hello_getGreeting(): "         << "success: got back..."         << endl;    cout << "    _result = ";    global_print->print_string(cout, _result, 1);    cout << endl;    //--------    // No memory management issues to take care of    //--------}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?