• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ corba::Object_ptr类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中corba::Object_ptr的典型用法代码示例。如果您正苦于以下问题:C++ Object_ptr类的具体用法?C++ Object_ptr怎么用?C++ Object_ptr使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Object_ptr类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1:

ReqServer_ptr
ReqServer::_narrow(CORBA::Object_ptr obj)
{
  if( !obj || obj->_NP_is_nil() || obj->_NP_is_pseudo() ) return _nil();
  _ptr_type e = (_ptr_type) obj->_PR_getobj()->_realNarrow(_PD_repoId);
  return e ? e : _nil();
}
开发者ID:XeanoRRR,项目名称:mmo-resourse,代码行数:7,代码来源:ReqServerSK.cpp


示例2:

systemCommand_ptr
systemCommand::_unchecked_narrow(::CORBA::Object_ptr obj)
{
  if( !obj || obj->_NP_is_nil() || obj->_NP_is_pseudo() ) return _nil();
  _ptr_type e = (_ptr_type) obj->_PR_getobj()->_uncheckedNarrow(_PD_repoId);
  return e ? e : _nil();
}
开发者ID:techeten,项目名称:hiroken-ros-pkg,代码行数:7,代码来源:systemCommand.cpp


示例3:

jointAnglePlugin_ptr
jointAnglePlugin::_unchecked_narrow(::CORBA::Object_ptr obj)
{
  if( !obj || obj->_NP_is_nil() || obj->_NP_is_pseudo() ) return _nil();
  _ptr_type e = (_ptr_type) obj->_PR_getobj()->_uncheckedNarrow(_PD_repoId);
  return e ? e : _nil();
}
开发者ID:orioli,项目名称:MAID-ROBOT,代码行数:7,代码来源:jointAnglePlugin.cpp


示例4:

OpenHRP::CommandReceiver_ptr
OpenHRP::CommandReceiver::_narrow(::CORBA::Object_ptr obj)
{
  if( !obj || obj->_NP_is_nil() || obj->_NP_is_pseudo() ) return _nil();
  _ptr_type e = (_ptr_type) obj->_PR_getobj()->_realNarrow(_PD_repoId);
  return e ? e : _nil();
}
开发者ID:orioli,项目名称:MAID-ROBOT,代码行数:7,代码来源:HRPcontroller.cpp


示例5: return

extern "C" JNIEXPORT jboolean JNICALL Java_omnijni_ObjectImpl__1is_1a (JNIEnv* env, jclass, jlong ref, jstring jrepoId)
{
    CORBA::Object_ptr object = reinterpret_cast<CORBA::Object_ptr>(ref);
    const char* repoId = env->GetStringUTFChars(jrepoId, NULL);
    CORBA::Boolean result = object->_is_a(repoId);
    env->ReleaseStringUTFChars(jrepoId, repoId);
    return (jboolean)result;
}
开发者ID:Axios-Engineering,项目名称:framework-core,代码行数:8,代码来源:object.cpp


示例6: recoverTaoObject

jint JNICALL Java_i2jrt_TAOObject__1hash(JNIEnv *jni, jobject jThis,
                                         jint i)
{
  CORBA::Object_ptr ptr = recoverTaoObject(jni, jThis);

  try {
    return ptr->_hash(i);

  } catch (const CORBA::SystemException &se) {
    throw_java_exception(jni, se);
  }

  return 0;
}
开发者ID:AndroidDev77,项目名称:OpenDDS,代码行数:14,代码来源:i2jrt_TAOObject.cpp


示例7: rCORBA_Stub_invoke

VALUE rCORBA_Stub_invoke(int _argc, VALUE *_argv, VALUE self)
{
  // since rb_exc_raise () does not return and does *not* honour
  // C++ exception rules we invoke from an inner function and
  // only raise the user exception when returned so all stack
  // unwinding has been correctly handled.
  VALUE ret=Qnil;
  bool _raise = false;
  CORBA::Object_ptr obj;
  VALUE opname = Qnil;
  VALUE arg_list = Qnil;
  VALUE result_type = Qnil;
  VALUE exc_list = Qnil;
  VALUE v1=Qnil;

  // extract and check arguments
  rb_scan_args(_argc, _argv, "20", &opname, &v1);
  Check_Type (v1, T_HASH);

  arg_list = rb_hash_aref (v1, ID_arg_list);
  result_type = rb_hash_aref (v1, ID_result_type);
  exc_list = rb_hash_aref (v1, ID_exc_list);

  Check_Type(opname, T_STRING);
  if (arg_list != Qnil)
    Check_Type (arg_list, T_ARRAY);
  if (result_type != Qnil)
    r2tao_check_type(result_type, r2tao_cTypecode);
  if (exc_list != Qnil)
    Check_Type (exc_list, T_ARRAY);

  obj = r2tao_Object_r2t (self);

  R2TAO_TRY
  {
    CORBA::Request_var _req = obj->_request (RSTRING(opname)->ptr);

    if (arg_list != Qnil)
      _r2tao_set_request_arguments(_req.in (), arg_list);
    if (exc_list != Qnil)
      _r2tao_set_request_exceptions(_req.in (), exc_list);
    if (result_type != Qnil)
      _r2tao_set_request_return_type(_req.in (), result_type);

    ret = _r2tao_invoke_request(_req.in (), _raise);
  }
  R2TAO_CATCH;
  if (_raise) rb_exc_raise (ret);
  return ret;
}
开发者ID:noda50,项目名称:RubyItk,代码行数:50,代码来源:object.cpp


示例8:

VALUE
rCORBA_Object_interface_repository_id(VALUE self)
{
  VALUE ret = Qnil;

  CORBA::Object_ptr obj = r2tao_Object_r2t (self);

  R2TAO_TRY
  {
    ret = rb_str_new2 (obj->_interface_repository_id ());
  }
  R2TAO_CATCH;

  return ret;
}
开发者ID:noda50,项目名称:RubyItk,代码行数:15,代码来源:object.cpp


示例9: jsm

jboolean JNICALL Java_i2jrt_TAOObject__1is_1a(JNIEnv *jni, jobject jThis,
                                              jstring repoID)
{
  JStringMgr jsm(jni, repoID);
  CORBA::Object_ptr ptr = recoverTaoObject(jni, jThis);

  try {
    return ptr->_is_a(jsm.c_str());

  } catch (const CORBA::SystemException &se) {
    throw_java_exception(jni, se);
  }

  return 0;
}
开发者ID:AndroidDev77,项目名称:OpenDDS,代码行数:15,代码来源:i2jrt_TAOObject.cpp


示例10:

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

CORBA::Boolean
TAO_Default_Collocation_Resolver::is_collocated (CORBA::Object_ptr object) const
{
  return object->_is_collocated ();
}
开发者ID:asdlei00,项目名称:ACE,代码行数:7,代码来源:Default_Collocation_Resolver.cpp


示例11: defined

CORBA::Object_ptr
TAO_CEC_ProxyPushSupplier::apply_policy_obj (CORBA::Object_ptr pre)
{
#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
  CORBA::Object_var post = CORBA::Object::_duplicate (pre);
  if (this->timeout_ > ACE_Time_Value::zero)
    {
      CORBA::PolicyList policy_list;
      policy_list.length (1);
#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
      if (this->typed_event_channel_)
        {
          policy_list[0] = this->typed_event_channel_->
            create_roundtrip_timeout_policy (this->timeout_);
        }
      else
        {
#endif
          policy_list[0] = this->event_channel_->
            create_roundtrip_timeout_policy (this->timeout_);
#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
        }
#endif
      post = pre->_set_policy_overrides (policy_list, CORBA::ADD_OVERRIDE);

      policy_list[0]->destroy ();
      policy_list.length (0);
    }
  return post._retn ();
#else
  return CORBA::Object::_duplicate (pre);
#endif /* TAO_HAS_CORBA_MESSAGING */
}
开发者ID:chenbk85,项目名称:ACE-Middleware,代码行数:33,代码来源:CEC_ProxyPushSupplier.cpp


示例12: resolver

// This function does what TAO does in order to get a transport.
CORBA::Boolean
first_request_flag (CORBA::Object_ptr obj)
{
  TAO_Stub *const stub = obj->_stubobj ();
  if (0 == stub)
    {
      ACE_ERROR_RETURN ((LM_DEBUG,
                         "CORBA::Object has stub = 0\n"),
                        1);
    }

  TAO::Profile_Transport_Resolver resolver (obj, stub, true);

  resolver.resolve (0);

  TAO_Transport *transport = resolver.transport ();
  if (0 == transport)
    {
      ACE_ERROR_RETURN ((LM_DEBUG,
                         "Transport is 0\n"),
                        1);
    }

  return transport->first_request ();
}
开发者ID:asdlei00,项目名称:ACE,代码行数:26,代码来源:client.cpp


示例13:

//
// handle_activate
//
int IOR_File_Trait::
handle_activate (::CORBA::Object_ptr obj, const ACE_CString & value)
{
  OASIS_TAO_TRACE ("int IOR_File_Trait::handle_activate (::CORBA::Object_ptr, const ACE_CString &)");

  // Get the ORB for this object.
  ::CORBA::ORB_var orb = obj->_get_orb ();

  if (::CORBA::is_nil (orb.in ()))
    ACE_ERROR_RETURN ((LM_ERROR,
                       ACE_TEXT ("%T (%t) - %M - failed to resolve ORB\n")),
                       1);

  // Convert the object to a string.
  ::CORBA::String_var str = orb->object_to_string (obj);

  // Write the string to the specified file.
  std::ofstream file;
  file.open (value.c_str ());

  if (!file.is_open ())
    ACE_ERROR_RETURN ((LM_ERROR,
                       ACE_TEXT ("%T (%t) - %M - failed to open %s for writing\n"),
                       value.c_str ()),
                       1);

  file << str.in ();
  file.close ();

  return 0;
}
开发者ID:EnasAlikhashashashneh,项目名称:OASIS,代码行数:34,代码来源:IOR_File_Trait.cpp


示例14: policy_list

int
insecure_invocation_test (CORBA::ORB_ptr orb,
                          CORBA::Object_ptr obj)
{
  // Disable protection for this insecure invocation test.

  Security::QOP qop = Security::SecQOPNoProtection;

  CORBA::Any no_protection;
  no_protection <<= qop;

  // Create the Security::QOPPolicy.
  CORBA::Policy_var policy =
    orb->create_policy (Security::SecQOPPolicy,
                        no_protection);

  CORBA::PolicyList policy_list (1);
  policy_list.length (1);
  policy_list[0] = CORBA::Policy::_duplicate (policy.in ());

  // Create an object reference that uses plain IIOP (i.e. no
  // protection).
  CORBA::Object_var object =
    obj->_set_policy_overrides (policy_list,
                                CORBA::SET_OVERRIDE);

  Foo::Bar_var server =
    Foo::Bar::_narrow (object.in ());

  if (CORBA::is_nil (server.in ()))
    {
      ACE_ERROR ((LM_ERROR,
                  "(%P|%t) ERROR: Object reference <%s> is "
                  "nil.\n",
                  ior));

      return 1;
    }

  try
    {
      // This invocation should result in a CORBA::NO_PERMISSION
      // exception.
      server->baz ();
    }
  catch (const CORBA::NO_PERMISSION&)
    {
      ACE_DEBUG ((LM_INFO,
                  "(%P|%t) Received CORBA::NO_PERMISSION from "
                  "server, as expected.\n"));

      return 0;
    }

  ACE_ERROR ((LM_ERROR,
              "(%P|%t) ERROR: CORBA::NO_PERMISSION was not thrown.\n"
              "(%P|%t) ERROR: It should have been thrown.\n"));

  return 1;
}
开发者ID:OspreyHub,项目名称:ATCD,代码行数:60,代码来源:client.cpp


示例15:

// Constructor used in Thru-POA collocation code.
TAO_ServerRequest::TAO_ServerRequest (TAO_ORB_Core * orb_core,
                                      TAO_Operation_Details const & details,
                                      CORBA::Object_ptr target)
  : mesg_base_ (0),
    operation_ (details.opname ()),
    operation_len_ (details.opname_len ()),
    release_operation_ (false),
    is_forwarded_ (false),
    incoming_ (0),
    outgoing_ (0),
    response_expected_ (details.response_flags () == TAO_TWOWAY_RESPONSE_FLAG
                        || details.response_flags () == static_cast<CORBA::Octet> (Messaging::SYNC_WITH_SERVER)
                        || details.response_flags () == static_cast<CORBA::Octet> (Messaging::SYNC_WITH_TARGET)),
    deferred_reply_ (false),
    sync_with_server_ (details.response_flags () == static_cast<CORBA::Octet> (Messaging::SYNC_WITH_SERVER)),
    is_queued_ (false),
    is_dsi_ (false),
    reply_status_ (GIOP::NO_EXCEPTION),
    orb_core_ (orb_core),
    request_id_ (0),
    profile_ (orb_core),
    requesting_principal_ (0),
    dsi_nvlist_align_ (0),
    operation_details_ (&details),
    argument_flag_ (false)
#if TAO_HAS_INTERCEPTORS == 1
  , interceptor_count_ (0)
  , rs_pi_current_ (0)
  , caught_exception_ (0)
  , pi_reply_status_ (-1)
#endif  /* TAO_HAS_INTERCEPTORS == 1 */
  , transport_ (0)
{
  // Have to use a const_cast<>.  *sigh*
  this->profile_.object_key (
    const_cast<TAO::ObjectKey &> (target->_stubobj ()->object_key ()));

  // Shallow copy the request service context list. This way the operation
  // details and server request share the request context.
  IOP::ServiceContextList & dest_request_contexts =
    this->request_service_context_.service_info ();

  IOP::ServiceContextList & src_request_contexts =
    (const_cast <TAO_Operation_Details&> (details)).request_service_info ();

  dest_request_contexts.replace (src_request_contexts.maximum (),
                                 src_request_contexts.length (),
                                 src_request_contexts.get_buffer (),
                                 false /* Do not release. */);

  // Don't shallow copy the reply service context. It is probably empty,
  // when then during the request it is used, the buffer gets allocated and
  // then the operation details don't get the reply service context
}
开发者ID:OspreyHub,项目名称:ATCD,代码行数:55,代码来源:TAO_Server_Request.cpp


示例16: catch

bool
AppHelper::validate_connection (CORBA::Object_ptr obj)
{
  for (CORBA::ULong j = 0; j != 100; ++j)
    {
      try
        {
#if (TAO_HAS_CORBA_MESSAGING == 1)
          CORBA::PolicyList_var unused;
          obj->_validate_connection (unused);
#else
          obj->_is_a ("Not_An_IDL_Type");
#endif /* TAO_HAS_MESSAGING == 1 */
          return true;
        }
      catch (const CORBA::Exception&)
        {
        }
    }

  return false;
}
开发者ID:chenbk85,项目名称:ACE-Middleware,代码行数:22,代码来源:AppHelper.cpp


示例17: BAD_PARAM

CORBA::Boolean
TAO_PG_ObjectGroupManager::valid_type_id (
  PortableGroup::ObjectGroup_ptr object_group,
  TAO_PG_ObjectGroup_Map_Entry * group_entry,
  CORBA::Object_ptr member)
{
  // @todo Strategize this -- e.g. strict type checking.

  if (CORBA::is_nil (member))
    throw CORBA::BAD_PARAM ();

  // Before we can use this code, i.e. the reverse lock, the
  // TAO_PG_ObjectGroup_Entry should be made so that it is reference
  // counted.  This is necessary since releasing the lock would
  // allow other threads to destroy/unbind the object group entry.
  // Another alternative is to simply attempt to reacquire the
  // object group map entry once the lock is reacquired, which is
  // easier to implement.

  // Copy the type_id before releasing the lock to avoid a race
  // condition.
  CORBA::String_var type_id =
    CORBA::string_dup (group_entry->type_id.in ());

  CORBA::Boolean right_type_id = 0;
  {
    // Release the lock during the type_id check.  No need to block
    // other threads during the invocation.
    ACE_Reverse_Lock<TAO_SYNCH_MUTEX> reverse_lock (this->lock_);

    ACE_GUARD_RETURN (ACE_Reverse_Lock<TAO_SYNCH_MUTEX>,
                      reverse_guard,
                      reverse_lock,
                      right_type_id);

    // Make sure an Object of the correct type was created.  It is
    // possible that an object of the wrong type was created if the
    // type_id parameter does not match the type of object the
    // GenericFactory creates.
    right_type_id =
      member->_is_a (type_id.in ());
  }

  // Make sure the group entry still exists.  It may have been
  // destroyed by another thread. (Call throws if problem.)
  static_cast<void> (this->get_group_entry (object_group));

  return right_type_id;
}
开发者ID:OspreyHub,项目名称:ATCD,代码行数:49,代码来源:PG_ObjectGroupManager.cpp


示例18:

// Expensive comparison of objref data, to see if two objrefs
// certainly point at the same object. (It's quite OK for this to
// return FALSE, and yet have the two objrefs really point to the same
// object.)
//
// NOTE that this must NOT go across the network!
// @@ Two object references are the same if any two profiles are the
//    same! This function is only test the profile in use!!!
CORBA::Boolean
TAO_Stub::is_equivalent (CORBA::Object_ptr other_obj)
{
  if (CORBA::is_nil (other_obj))
    return false;

  TAO_Profile * const other_profile = other_obj->_stubobj ()->profile_in_use_;
  TAO_Profile * const this_profile = this->profile_in_use_;

  if (other_profile == 0 || this_profile == 0)
    return false;

  // Compare the profiles
  return this_profile->is_equivalent (other_profile);
}
开发者ID:OspreyHub,项目名称:ATCD,代码行数:23,代码来源:Stub.cpp


示例19: add_member_to_iogr

PortableGroup::ObjectGroup_ptr
TAO::FT_PG_Object_Group_Storable::add_member_to_iogr (CORBA::Object_ptr member)
{
  // If this is the first member added to the group and it's type_id does
  // not match the member, then the object group should assume the same
  // type id as the first member.  We will need to replace the object
  // reference with an empty reference of the specified type id.

  if (CORBA::is_nil (member))
    {// A null object reference is not an acceptable member of the group.
      ORBSVCS_ERROR ((LM_ERROR,
                  ACE_TEXT ("(%P|%t) ERROR: Unable to add null member ")
                  ACE_TEXT ("to object group with id: %s\n"),
                  this->tagged_component_.object_group_id));
      return CORBA::Object::_nil ();
    }

  const char* member_type_id = member->_stubobj ()->type_id.in ();

  if ((this->members_.current_size () == 0) &&
      (ACE_OS::strcmp (this->type_id_, member_type_id) != 0) )
    {
      try {
        this->type_id_ = member_type_id;
        this->reference_ = manipulator_.create_object_group_using_id (
           this->type_id_,
           this->tagged_component_.group_domain_id,
           this->tagged_component_.object_group_id);
      }
      catch (const CORBA::Exception&)
        {
          ORBSVCS_ERROR ((LM_ERROR,
                      ACE_TEXT ("(%P|%t) ERROR: Unable to add member ")
                      ACE_TEXT ("to object group with id: %s for object ")
                      ACE_TEXT ("of type: %s\n"),
                      this->tagged_component_.object_group_id,
                      member_type_id));
          return CORBA::Object::_nil ();
        }
    }

  return PG_Object_Group::add_member_to_iogr (member);
}
开发者ID:OspreyHub,项目名称:ATCD,代码行数:43,代码来源:FT_PG_Object_Group_Storable.cpp


示例20:

CORBA::Short
Activity::get_server_priority (CORBA::Object_ptr server)
{
  // Get the Priority Model Policy from the stub.
  CORBA::Policy_var policy =
    server->_get_policy (RTCORBA::PRIORITY_MODEL_POLICY_TYPE);

  // Narrow down to correct type.
  RTCORBA::PriorityModelPolicy_var priority_policy =
    RTCORBA::PriorityModelPolicy::_narrow (policy.in ());

  // Make sure that we have the SERVER_DECLARED priority model.
  RTCORBA::PriorityModel priority_model =
    priority_policy->priority_model ();
  if (priority_model != RTCORBA::SERVER_DECLARED)
    return -1;

  // Return the server priority.
  return priority_policy->server_priority ();
}
开发者ID:INMarkus,项目名称:ATCD,代码行数:20,代码来源:Activity.cpp



注:本文中的corba::Object_ptr类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ corba::Object_var类代码示例发布时间:2022-05-31
下一篇:
C++ corba::ORB_var类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap