当前位置: 首页>>代码示例>>C++>>正文


C++ Object_ptr::_is_a方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4:

VALUE
rCORBA_Object_is_a(VALUE self, VALUE type_id)
{
  CORBA::Object_ptr obj;
  VALUE ret = Qnil;

  obj = r2tao_Object_r2t (self);
  Check_Type(type_id, T_STRING);

  R2TAO_TRY
  {
    int f = obj->_is_a (RSTRING(type_id)->ptr);
    //::printf ("rCORBA_Object_is_a: %s -> %d\n", RSTRING(type_id)->ptr, f);
    ret = f ? Qtrue: Qfalse;
  }
  R2TAO_CATCH;

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

示例5: 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


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