本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}