CORBA与网络管理
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
CORBA与网络管理
CORBA基础
CORBA公共对象请求代理体系结构
是一种分布式应用程序的框架
IDL接口定义语言
/pub/document/Computer/Develop/DCOM&CORBA/CORBA
实验环境----omniORB
ü 网址
见omniORB说明书
服务器的功能是实现字符串的回显
1. 选定一种CORBA平台IDLTOxx.EXE NAME SERVICE
等例如选定omniORB°üÀ¨omniORB的应用
程序路径
2. 定义IDL文件echo.idl
interface Echo {
string echoString(in string mesg);
};
3. 编译IDL文件
使用IDLomniidl2.exe编译上述IDL定义文本文件接口的C++映
射共生成三个文件echoDynSK.cc
定义了接口的C++映射类
Echo, the C++ mapping for its object reference is For the example interface
Echo_pt r. The generic object CORBA::Object provides a few more operations
and all of them can be invoked via Echo pt r.
public:
virtual char* echoString(const char* mesg) = 0;
static Echo_ptr _duplicate(Echo_ptr);
static Echo_ptr _narrow(CORBA::Object_ptr);
static Echo_ptr _nil();
ü SKELETON±ØÐëÖØÔØ
class _sk_Echo : public virtual Echo {
public:
_sk_Echo() {}
_sk_Echo(const omniORB::objectKey& k);
virtual ~_sk_Echo() {}
Echo_ptr _this() { return Echo::_duplicate(this); }
void _obj_is_ready(CORBA::BOA_ptr boa) { boa->obj_is_ready(this); }
CORBA::BOA_ptr _boa() { return CORBA::BOA::getBOA(); }
void _dispose() { _boa()->dispose(this); }
omniORB::objectKey _key();
virtual char* echoString(const char* mesg) = 0;
virtual CORBA::Boolean dispatch(GIOP_S &s,const char *op,CORBA::Boolean response);
protected:
virtual void *_widenFromTheMostDerivedIntf(const char *repoId,CORBA::Boolean is_cxx_type_id) {
return Echo::_widenFromTheMostDerivedIntf(repoId,is_cxx_type_id);
}
private:
_sk_Echo (const _sk_Echo&);
_sk_Echo &operator=(const _sk_Echo&);
};
4. 分别编写相应的客户端程序和服务器端程序并编译生成EXE文件要
用到第2步中生成的STUB和SKELETON
CORBA::ORB_ptr orb = CORBA::ORB_init(argc,argv,"omniORB2");
CORBA::BOA_ptr boa = orb->BOA_init(argc,argv,"omniORB2_BOA");
char pp[100];
strcpy(pp,argv[1]);
try {
CORBA::Object_var obj = getObjectReference(orb);
hello(obj,pp);
}
catch(CORBA::COMM_FAILURE& ex) {
cerr << "Caught system exception COMM_FAILURE, unable to contact the " << "object." << endl;
}
catch(omniORB::fatalException& ex) {
cerr << "Caught omniORB2 fatalException. This indicates a bug is caught " << "within omniORB2.\nPlease send a bug report.\n"
<< "The exception was thrown in file: " << ex.file() << "\n"
<< " line: " << ex.line() << "\n"
<< "The error message is: " << ex.errmsg() << endl;
}
catch(...) {
cerr << "Caught a system exception." << endl;
}
return 0;
}
static CORBA::Object_ptr getObjectReference(CORBA::ORB_ptr orb)
{
CosNaming::NamingContext_var rootContext;
try {
// Obtain a reference to the root context of the Name service:
CORBA::Object_var initServ;
initServ = orb->resolve_initial_references("NameService");
// Narrow the object returned by resolve_initial_references()
// to a CosNaming::NamingContext object:
rootContext = CosNaming::NamingContext::_narrow(initServ);
if (CORBA::is_nil(rootContext))
{
cerr << "Failed to narrow naming context." << endl;
return CORBA::Object::_nil();
}
catch(CORBA::ORB::InvalidName& ex) {
cerr << "Service required is invalid [does not exist]." << endl;
return CORBA::Object::_nil();
}
// Create a name object, containing the name test/context:
CosNaming::Name name;
name.length(2);
name[0].id = (const char*) "test"; // string copied
name[0].kind = (const char*) "my_context"; // string copied
name[1].id = (const char*) "Echo";
name[1].kind = (const char*) "Object";
// Note on kind: The kind field is used to indicate the type
// of the object. This is to avoid conventions such as that used
// by files (name.type -- e.g. test.ps = postscript etc.)
CORBA::Object_ptr obj;
try {
// Resolve the name to an object reference, and assign the reference
// returned to a CORBA::Object:
obj = rootContext->resolve(name);
}
catch(CosNaming::NamingContext::NotFound& ex)
{
// This exception is thrown if any of the components of the
// path [contexts or the object] aren't found:
cerr << "Context not found." << endl;
return CORBA::Object::_nil();
}
catch (CORBA::COMM_FAILURE& ex) {
cerr << "Caught system exception COMM_FAILURE, unable to contact the " << "naming service." << endl;
return CORBA::Object::_nil();
}
catch(omniORB::fatalException& ex) {
throw;
}
catch (...) {
cerr << "Caught a system exception while using the naming service."<< endl; return CORBA::Object::_nil();
return obj;
}
void hello(CORBA::Object_ptr obj,char* pp)
{
Echo_var e = Echo::_narrow(obj);
if (CORBA::is_nil(e)) {
cerr << "hello: cannot invoke on a nil object reference.\n" << endl;
return;
}
//CORBA::String_var src = (const char*) "Hello!"; // String literals are not
// const char*. Must do // explicit casting to
// force the use of the copy // operator=().
CORBA::String_var src = (const char*) pp; // String literals are not
CORBA::String_var dest;
dest = e->echoString(src);
cerr << "I said,\"" << (char*)src << "\"."
<< " The Object said,\"" << (char*)dest <<"\"" << endl;
}
ü 服务器端程序
#include <iostream.h>
#include "omnithread.h"
#include "echo.hh"
#include "echo_"
static CORBA::Boolean bindObjectToName(CORBA::ORB_ptr,CORBA::Object_ptr);
int
main(int argc, char **argv)
{
CORBA::ORB_ptr orb = CORBA::ORB_init(argc,argv,"omniORB2");
CORBA::BOA_ptr boa = orb->BOA_init(argc,argv,"omniORB2_BOA");
Echo_i *myobj = new Echo_i();
myobj->_obj_is_ready(boa);
{
Echo_var myobjRef = myobj->_this();
if (!bindObjectToName(orb,myobjRef)) {
return 1;
}
}
boa->impl_is_ready();
// Tell the BOA we are ready. The BOA's default behaviour is to block // on this call indefinitely.
return 0;
}
static
CORBA::Boolean
bindObjectToName(CORBA::ORB_ptr orb,CORBA::Object_ptr obj) {
CosNaming::NamingContext_var rootContext;
try {
// Obtain a reference to the root context of the Name service:
CORBA::Object_var initServ;
initServ = orb->resolve_initial_references("NameService");
// Narrow the object returned by resolve_initial_references() // to a CosNaming::NamingContext object:
rootContext = CosNaming::NamingContext::_narrow(initServ);
if (CORBA::is_nil(rootContext))
{
cerr << "Failed to narrow naming context." << endl;
return 0;
}
}
catch(CORBA::ORB::InvalidName& ex) {
cerr << "Service required is invalid [does not exist]." << endl;
return 0;
}
try {
// Bind a context called "test" to the root context:
CosNaming::Name contextName;
contextName.length(1);
contextName[0].id = (const char*) "test"; // string copied
contextName[0].kind = (const char*) "my_context"; // string copied // Note on kind: The kind field is used to indicate the type
// of the object. This is to avoid conventions such as that used
// by files (name.type -- e.g. test.ps = postscript etc.)
CosNaming::NamingContext_var testContext;
try {
// Bind the context to root, and assign testContext to it:
testContext = rootContext->bind_new_context(contextName);
}
catch(CosNaming::NamingContext::AlreadyBound& ex) {
// If the context already exists, this exception will be raised.
// In this case, just resolve the name and assign testContext
// to the object returned:
CORBA::Object_var tmpobj;
tmpobj = rootContext->resolve(contextName);
testContext = CosNaming::NamingContext::_narrow(tmpobj);
if (CORBA::is_nil(testContext)) {
cerr << "Failed to narrow naming context." << endl;
return 0;
}
}
// Bind the object (obj) to testContext, naming it Echo:
CosNaming::Name objectName;
objectName.length(1);
objectName[0].id = (const char*) "Echo"; // string copied
objectName[0].kind = (const char*) "Object"; // string copied
// Bind obj with name Echo to the testContext:
try {
testContext->bind(objectName,obj);
}
catch(CosNaming::NamingContext::AlreadyBound& ex) {
testContext->rebind(objectName,obj);
}
// Note: Using rebind() will overwrite any Object previously bound
// to /test/Echo with obj.
// Alternatively, bind() can be used, which will raise a
// CosNaming::NamingContext::AlreadyBound exception if the name // supplied is already bound to an object.
// Amendment: When using OrbixNames, it is necessary to first try bind
// and then rebind, as rebind on it's own will throw a NotFoundexception if // the Name has not already been bound. [This is incorrect behaviour -
// it should just bind].
}
catch (CORBA::COMM_FAILURE& ex) {
cerr << "Caught system exception COMM_FAILURE, unable to contact the "
<< "naming service." << endl;
return 0;
}
catch (omniORB::fatalException& ex) {
throw;
}
catch (...) {
cerr << "Caught a system exception while using the naming service."<< endl;
return 0;
}
return 1;
}
// echo_ - This source code demonstrates an implmentation of the
// object interface Echo. It is part of the three examples
// used in Chapter 2 "The Basics" of the omniORB2 user guide.
//
#include <string.h>
#include "echo.hh"
class Echo_i : public virtual _sk_Echo {
public:
Echo_i() {}
virtual ~Echo_i() {}
virtual char * echoString(const char *mesg);
};
char *
Echo_i::echoString(const char *mesg) {
char *p = CORBA::string_dup(mesg);
return p;
}
5. 启动NAME SERVICE
6. 启动服务器端程序
启动eg3_impl.exe
I said,"HelloWorld". The Object said,"HelloWorld"
8. 例子一
#include <iostream.h>
#include "echo.hh"
#include "echo_"
#include ""
int main(int argc, char **argv)
{
CORBA::ORB_ptr orb = CORBA::ORB_init(argc,argv,"omniORB2"); CORBA::BOA_ptr boa = orb->BOA_init(argc,argv,"omniORB2_BOA");
Echo_i *myobj = new Echo_i();
// Note: all implementation objects must be instantiated on the
// heap using the new operator.
myobj->_obj_is_ready(boa);
// Tell the BOA the object is ready to serve.
// This call is omniORB2 specific.
//
// This call is equivalent to the following call sequence:
// Echo_ptr myobjRef = myobj->_this();
// boa->obj_is_ready(myobjRef);
// CORBA::release(myobjRef);
boa->impl_is_ready(0,1);
// Tell the BOA we are ready and to return immediately once it has
// done its stuff. It is omniORB2 specific to call impl_is_ready()
// with the extra 2nd argument- CORBA::Boolean NonBlocking,
// which is set to TRUE (1) in this case.
Echo_ptr myobjRef = myobj->_this();
// Obtain an object reference.
// Note: always use _this() to obtain an object reference from the
// object implementation.
hello(myobjRef);
CORBA::release(myobjRef);
// Dispose of the object reference.
myobj->_dispose();
// Dispose of the object implementation.
// This call is omniORB2 specific.
// Note: *never* call the delete operator or the dtor of the object
// directly because the BOA needs to be informed.
//
// This call is equivalent to the following call sequence:
// Echo_ptr myobjRef = myobj->_this();
// boa->dispose(myobjRef);
// CORBA::release(myobjRef);
return 0;
}
9. idl.bat文件内容
set path=C:\Progra~1\DevStudio\VC\bin;%path%;
D:\omni\bin\x86_win32\omniidl2 -a -t -h .hh -s echo.idl
10. Setenv.bat文件内容
Set
path=C:\Progra~1\DevStudio\SharedIDE\bin;C:\Progra~1\DevStudio\VC\bin;D:\omni\bin\x8 6_win32;%path%;
set
include=D:\omni\include;D:\omni\include\omniORB2;D:\omni\include\omnithread;C:\Progra ~1\DevStudio\VC\include;
set lib=C:\Progra~1\DevStudio\VC\lib;D:\omni\lib\x86_win32
与网管的联系
ü 基于CORBA的代理
ü 基于CORBA的管理者
ü M-A都用CORBA实现
1. 基于omniORB的实现
信息模型
readonly attribute string sysServices;
};
F systemGR.hh文件
#ifndef __systemGR_hh__
#define __systemGR_hh__
#ifndef USE_omniORB_logStream
#define USE_omniORB_logStream
#endif
#ifndef __CORBA_H_EXTERNAL_GUARD__
#define __CORBA_H_EXTERNAL_GUARD__
#include <omniORB2/CORBA.h>
#endif
#ifdef _LC_attr
# error "A local CPP macro _LC_attr has already been defined."
#else
# ifdef USE_stub_in_nt_dll
# define _LC_attr _OMNIORB_NTDLL_IMPORT
# else
# define _LC_attr
# endif
#endif
#ifndef __systemGR__
#define __systemGR__
class systemGR;
typedef systemGR* systemGR_ptr;
typedef systemGR_ptr systemGRRef;
class systemGR_Helper {
public:
static systemGR_ptr _nil();
static CORBA::Boolean is_nil(systemGR_ptr p);
static void release(systemGR_ptr p);
static void duplicate(systemGR_ptr p);
static size_t NP_alignedSize(systemGR_ptr obj,size_t initialoffset);
static void marshalObjRef(systemGR_ptr obj,NetBufferedStream &s); static systemGR_ptr unmarshalObjRef(NetBufferedStream &s);
static void marshalObjRef(systemGR_ptr obj,MemBufferedStream &s); static systemGR_ptr unmarshalObjRef(MemBufferedStream &s);
};
typedef _CORBA_ObjRef_Var<systemGR,systemGR_Helper> systemGR_var;
#endif
#define systemGR_IntfRepoID "IDL:systemGR:1.0"
class systemGR : public virtual omniObject, public virtual CORBA::Object {
public:
virtual char* sysDescr() = 0;
virtual char* sysObjectID() = 0;
virtual char* sysUpTime() = 0;
virtual char* sysContact() = 0;
virtual char* sysName() = 0;
virtual char* sysLocation() = 0;
virtual char* sysServices() = 0;
static systemGR_ptr _duplicate(systemGR_ptr);
static systemGR_ptr _narrow(CORBA::Object_ptr);
static systemGR_ptr _nil();
static inline size_t NP_alignedSize(systemGR_ptr obj,size_t initialoffset) {
return CORBA::AlignedObjRef(obj,systemGR_IntfRepoID,17,initialoffset);
}
static inline void marshalObjRef(systemGR_ptr obj,NetBufferedStream &s) {
CORBA::MarshalObjRef(obj,systemGR_IntfRepoID,17,s);
}
static inline systemGR_ptr unmarshalObjRef(NetBufferedStream &s) {
CORBA::Object_ptr _obj = CORBA::UnMarshalObjRef(systemGR_IntfRepoID,s); systemGR_ptr _result = systemGR::_narrow(_obj);
CORBA::release(_obj);
return _result;
}
static inline void marshalObjRef(systemGR_ptr obj,MemBufferedStream &s) {
CORBA::MarshalObjRef(obj,systemGR_IntfRepoID,17,s);
}
static inline systemGR_ptr unmarshalObjRef(MemBufferedStream &s) {
CORBA::Object_ptr _obj = CORBA::UnMarshalObjRef(systemGR_IntfRepoID,s); systemGR_ptr _result = systemGR::_narrow(_obj);
CORBA::release(_obj);
return _result;
}
static CORBA::Boolean _0RL_is_a(const char *base_repoId);
protected:
systemGR() {
if (!is_proxy())
omniObject::PR_IRRepositoryId(systemGR_IntfRepoID);
this->PR_setobj(this);
}
virtual ~systemGR() {}
virtual void *_widenFromTheMostDerivedIntf(const char *repoId,CORBA::Boolean is_cxx_type_id=0);
private:
systemGR(const systemGR&);
systemGR &operator=(const systemGR&);
};
class _sk_systemGR : public virtual systemGR {
public:
_sk_systemGR() {}
_sk_systemGR(const omniORB::objectKey& k);
virtual ~_sk_systemGR() {}
systemGR_ptr _this() { return systemGR::_duplicate(this); }
void _obj_is_ready(CORBA::BOA_ptr boa) { boa->obj_is_ready(this); }
CORBA::BOA_ptr _boa() { return CORBA::BOA::getBOA(); }
void _dispose() { _boa()->dispose(this); }
omniORB::objectKey _key();
virtual char* sysDescr() = 0;
virtual char* sysObjectID() = 0;
virtual char* sysUpTime() = 0;
virtual char* sysContact() = 0;
virtual char* sysName() = 0;
virtual char* sysLocation() = 0;
virtual char* sysServices() = 0;
virtual CORBA::Boolean dispatch(GIOP_S &s,const char *op,CORBA::Boolean response);
protected:
virtual void *_widenFromTheMostDerivedIntf(const char *repoId,CORBA::Boolean is_cxx_type_id) {
return systemGR::_widenFromTheMostDerivedIntf(repoId,is_cxx_type_id);
}
private:
_sk_systemGR (const _sk_systemGR&);
_sk_systemGR &operator=(const _sk_systemGR&);
};
class _proxy_systemGR : public virtual systemGR {
public:
_proxy_systemGR (Rope *r,CORBA::Octet *key,size_t keysize,IOP::TaggedProfileList *profiles,CORBA::Boolean release) :
omniObject(systemGR_IntfRepoID,r,key,keysize,profiles,release) {
omni::objectIsReady(this);
}
virtual ~_proxy_systemGR() {}
virtual char* sysDescr();
virtual char* sysObjectID();
virtual char* sysUpTime();
virtual char* sysContact();
virtual char* sysName();
virtual char* sysLocation();
virtual char* sysServices();
protected:
_proxy_systemGR () {}
virtual void *_widenFromTheMostDerivedIntf(const char *repoId,CORBA::Boolean is_cxx_type) {
return systemGR::_widenFromTheMostDerivedIntf(repoId,is_cxx_type);
}
private:
_proxy_systemGR (const _proxy_systemGR&);
_proxy_systemGR &operator=(const _proxy_systemGR&);
};
class _nil_systemGR : public virtual systemGR {
public:
_nil_systemGR() : omniObject(omniObject::nilObjectManager()) { this->PR_setobj(0); } virtual ~_nil_systemGR() {}
char* sysDescr() {
throw CORBA::BAD_OPERATION(0,CORBA::COMPLETED_NO);
#ifdef NEED_DUMMY_RETURN
// never reach here! Dummy return to keep some compilers happy.
char* _0RL_result = 0;
return _0RL_result;
#endif
}
char* sysObjectID() {
throw CORBA::BAD_OPERATION(0,CORBA::COMPLETED_NO); #ifdef NEED_DUMMY_RETURN
// never reach here! Dummy return to keep some compilers happy.
char* _0RL_result = 0;
return _0RL_result;
#endif
}
char* sysUpTime() {
throw CORBA::BAD_OPERA TION(0,CORBA::COMPLETED_NO); #ifdef NEED_DUMMY_RETURN
// never reach here! Dummy return to keep some compilers happy.
char* _0RL_result = 0;
return _0RL_result;
#endif
}
char* sysContact() {
throw CORBA::BAD_OPERATION(0,CORBA::COMPLETED_NO); #ifdef NEED_DUMMY_RETURN
// never reach here! Dummy return to keep some compilers happy.
char* _0RL_result = 0;
return _0RL_result;
#endif
}
char* sysName() {
throw CORBA::BAD_OPERATION(0,CORBA::COMPLETED_NO); #ifdef NEED_DUMMY_RETURN
// never reach here! Dummy return to keep some compilers happy.
char* _0RL_result = 0;
return _0RL_result;
#endif
}
char* sysLocation() {
throw CORBA::BAD_OPERATION(0,CORBA::COMPLETED_NO);
#ifdef NEED_DUMMY_RETURN
// never reach here! Dummy return to keep some compilers happy.
char* _0RL_result = 0;
return _0RL_result;
#endif
}
char* sysServices() {
throw CORBA::BAD_OPERATION(0,CORBA::COMPLETED_NO);
#ifdef NEED_DUMMY_RETURN
// never reach here! Dummy return to keep some compilers happy.
char* _0RL_result = 0;
return _0RL_result;
#endif
}
protected:
virtual void *_widenFromTheMostDerivedIntf(const char *repoId,CORBA::Boolean is_cxx_type_id) {
return systemGR::_widenFromTheMostDerivedIntf(repoId,is_cxx_type_id);
}
};
class systemGR_proxyObjectFactory : public proxyObjectFactory {
public:
systemGR_proxyObjectFactory () {}
virtual ~systemGR_proxyObjectFactory () {}
virtual const char *irRepoId() const;
virtual CORBA::Object_ptr newPr oxyObject(Rope *r,CORBA::Octet *key,size_t keysize,IOP::TaggedProfileList *profiles,CORBA::Boolean release);
virtual CORBA::Boolean is_a(const char *base_repoId) const;
static systemGR_ptr _nil() {
if (!__nil_systemGR) {
__nil_systemGR = new _nil_systemGR;
}
return __nil_systemGR;
}
private:
static systemGR_ptr __nil_systemGR;
};
_CORBA_GLOBAL_VAR const CORBA::TypeCode_ptr _tc_systemGR;
void operator<<=(CORBA::Any& _a, systemGR_ptr _s);
void operator<<=(CORBA::Any& _a, systemGR_ptr* _s);
CORBA::Boolean operator>>=(const CORBA::Any& _a, systemGR_ptr& _s);
template <class T,CORBA::Boolean release>
class _tie_systemGR : public virtual _sk_systemGR
{
public:
_tie_systemGR (T* o) : pd_obj(o), pd_release(release) {}
_tie_systemGR (T* o, const omniORB::objectKey& k) : _sk_systemGR(k), pd_obj(o), pd_release(release) {}
~_tie_systemGR() { if (pd_release) delete pd_obj; }
char* sysDescr() { return pd_obj->sysDescr(); }
char* sysObjectID() { return pd_obj->sysObjectID(); }
char* sysUpTime() { return pd_obj->sysUpTime(); }
char* sysContact() { return pd_obj->sysContact(); }
char* sysName() { return pd_obj->sysName(); }
char* sysLocation() { return pd_obj->sysLocation(); }
char* sysServices() { return pd_obj->sysServices(); }
private:
T* pd_obj;
CORBA::Boolean pd_release;
_tie_systemGR();
};
#undef _LC_attr
#endif // __systemGR_hh__
F 文件
#include "systemGR.hh"
#include <omniORB2/proxyCall.h>
static const char* _0RL_library_version = omniORB_2_7;
// Proxy call descriptor class. Mangled signature:
// _cstring
class _0RL_pc_f400e14dd5504626_00000000
: public OmniProxyCallDesc
{
public:
inline _0RL_pc_f400e14dd5504626_00000000(const char* _op, size_t _op_len) :
OmniProxyCallDesc(_op, _op_len) {}
virtual void unmarshalReturnedValues(GIOP_C&);
inline char* result() { return pd_result; }
private:
char* pd_result;
};
void _0RL_pc_f400e14dd5504626_00000000::unmarshalReturnedValues(GIOP_C& giop_client)
{
{
CORBA::String_member _0RL_str_tmp;
_0RL_str_tmp <<= giop_client;
pd_result = _0RL_str_tmp._ptr;
_0RL_str_tmp._ptr = 0;
}
}
// Proxy call descriptor class. Mangled signature:
// void_i_cstring
class _0RL_pc_f400e14dd5504626_10000000
: public OmniProxyCallDesc
{
public:
inline _0RL_pc_f400e14dd5504626_10000000(const char* _op, size_t _op_len, const char* arg) :
OmniProxyCallDesc(_op, _op_len),
_value(arg) {}
virtual CORBA::ULong alignedSize(CORBA::ULong size_in);
virtual void marshalArguments(GIOP_C&);
private:
const char* _value;
};
CORBA::ULong _0RL_pc_f400e14dd5504626_10000000::alignedSize(CORBA::ULong msgsize)
{
msgsize = omni::align_to(msgsize,omni::ALIGN_4);
msgsize += 4 + (((const char*) _value)? strlen((const char*) _value) + 1 : 1);
return msgsize;
}
void _0RL_pc_f400e14dd5504626_10000000::marshalArguments(GIOP_C& giop_client) {
{
CORBA::ULong _len = (((const char*) _value)? strlen((const char*) _value) + 1 : 1); _len >>= giop_client;
if (_len > 1)
giop_client.put_char_array((const CORBA::Char *)((const char*) _value),_len); else {
if ((const char*) _value == 0 && omniORB::traceLevel > 1)
_CORBA_null_string_ptr(0);
CORBA::Char('\0') >>= giop_client;
}
}
}
char* _proxy_systemGR::sysDescr()
{
_0RL_pc_f400e14dd5504626_00000000 _call_desc("_get_sysDescr", 14);
OmniProxyCallWrapper::invoke(this, _call_desc);
return _call_desc.result();
}
char* _proxy_systemGR::sysObjectID()
{
_0RL_pc_f400e14dd5504626_00000000 _call_desc("_get_sysObjectID", 17);
OmniProxyCallWrapper::invoke(this, _call_desc);
return _call_desc.result();
}
char* _proxy_systemGR::sysUpTime()
{
_0RL_pc_f400e14dd5504626_00000000 _call_desc("_get_sysUpTime", 15);
OmniProxyCallWrapper::invoke(this, _call_desc);
return _call_desc.result();
}
char* _proxy_systemGR::sysContact()
{
_0RL_pc_f400e14dd5504626_00000000 _call_desc("_get_sysContact", 16);
OmniProxyCallWrapper::invoke(this, _call_desc);
return _call_desc.result();
}
char* _proxy_systemGR::sysName()
{
_0RL_pc_f400e14dd5504626_00000000 _call_desc("_get_sysName", 13);
OmniProxyCallWrapper::invoke(this, _call_desc);
return _call_desc.result();
}
char* _proxy_systemGR::sysLocation()
{
_0RL_pc_f400e14dd5504626_00000000 _call_desc("_get_sysLocation", 17);
OmniProxyCallWrapper::invoke(this, _call_desc);
return _call_desc.result();
}
char* _proxy_systemGR::sysServices()
{
_0RL_pc_f400e14dd5504626_00000000 _call_desc("_get_sysServices", 17);
OmniProxyCallWrapper::invoke(this, _call_desc);
return _call_desc.result();
}
CORBA::Boolean
_sk_systemGR::dispatch(GIOP_S &_0RL_s,const char *_0RL_op,CORBA::Boolean _0RL_response_expected)
{
if (strcmp(_0RL_op,"_get_sysDescr") == 0)
{
if (!_0RL_response_expected) {
throw CORBA::BAD_OPERATION(0,CORBA::COMPLETED_NO);
}
_0RL_s.RequestReceived();
CORBA::String_var _0RL_result = sysDescr();
size_t _0RL_msgsize = (size_t) GIOP_S::ReplyHeaderSize();
_0RL_msgsize = omni::align_to(_0RL_msgsize,omni::ALIGN_4);
_0RL_msgsize += 4 + (((const char*) _0RL_result)? strlen((const char*) _0RL_result) + 1 : 1);
_0RL_s.InitialiseReply(GIOP::NO_EXCEPTION,(CORBA::ULong)_0RL_msgsize);
{
CORBA::ULong _len = (((const char*) _0RL_result)? strlen((const char*) _0RL_result) + 1 : 1);
_len >>= _0RL_s;
if (_len > 1)
_0RL_s.put_char_array((const CORBA::Char *)((const char*) _0RL_result),_len); else {
if ((const char*) _0RL_result == 0 && omniORB::traceLevel > 1)
_CORBA_null_string_ptr(0);
CORBA::Char('\0') >>= _0RL_s;
}
}
_0RL_s.ReplyCompleted();
return 1;
}
else if (strcmp(_0RL_op,"_get_sysObjectID") == 0)
{
if (!_0RL_response_expected) {
throw CORBA::BAD_OPERATION(0,CORBA::COMPLETED_NO);
}
_0RL_s.RequestReceived();
CORBA::String_var _0RL_result = sysObjectID();
size_t _0RL_msgsize = (size_t) GIOP_S::ReplyHeaderSize();
_0RL_msgsize = omni::align_to(_0RL_msgsize,omni::ALIGN_4);
_0RL_msgsize += 4 + (((const char*) _0RL_result)? strlen((const char*) _0RL_result) + 1 : 1);
_0RL_s.InitialiseReply(GIOP::NO_EXCEPTION,(CORBA::ULong)_0RL_msgsize);
{
CORBA::ULong _len = (((const char*) _0RL_result)? strlen((const char*) _0RL_result) + 1 : 1);
_len >>= _0RL_s;
if (_len > 1)
_0RL_s.put_char_array((const CORBA::Char *)((const char*) _0RL_result),_len); else {
if ((const char*) _0RL_result == 0 && omniORB::traceLevel > 1)
_CORBA_null_string_ptr(0);
CORBA::Char('\0') >>= _0RL_s;
}
}
_0RL_s.ReplyCompleted();
return 1;
}
else if (strcmp(_0RL_op,"_get_sysUpTime") == 0)
{
if (!_0RL_response_expected) {
throw CORBA::BAD_OPERATION(0,CORBA::COMPLETED_NO);
}
_0RL_s.RequestReceived();
CORBA::String_var _0RL_result = sysUpTime();
size_t _0RL_msgsize = (size_t) GIOP_S::ReplyHeaderSize();
_0RL_msgsize = omni::align_to(_0RL_msgsize,omni::ALIGN_4);
_0RL_msgsize += 4 + (((const char*) _0RL_result)? strlen((const char*) _0RL_result) + 1 : 1);
_0RL_s.InitialiseReply(GIOP::NO_EXCEPTION,(CORBA::ULong)_0RL_msgsize);
{
CORBA::ULong _len = (((const char*) _0RL_result)? strlen((const char*) _0RL_result) + 1 : 1);
_len >>= _0RL_s;
if (_len > 1)
_0RL_s.put_char_array((const CORBA::Char *)((const char*) _0RL_result),_len); else {
if ((const char*) _0RL_result == 0 && omniORB::traceLevel > 1)
_CORBA_null_string_ptr(0);
CORBA::Char('\0') >>= _0RL_s;
}
}
_0RL_s.ReplyCompleted();
return 1;
}
else if (strcmp(_0RL_op,"_get_sysContact") == 0)
{
if (!_0RL_response_expected) {
throw CORBA::BAD_OPERATION(0,CORBA::COMPLETED_NO);
}
_0RL_s.RequestReceived();
CORBA::String_var _0RL_result = sysContact();
size_t _0RL_msgsize = (size_t) GIOP_S::ReplyHeaderSize();
_0RL_msgsize = omni::align_to(_0RL_msgsize,omni::ALIGN_4);。