本文整理汇总了C++中TAO_InputCDR::good_bit方法的典型用法代码示例。如果您正苦于以下问题:C++ TAO_InputCDR::good_bit方法的具体用法?C++ TAO_InputCDR::good_bit怎么用?C++ TAO_InputCDR::good_bit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TAO_InputCDR
的用法示例。
在下文中一共展示了TAO_InputCDR::good_bit方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cdr
/*static*/ CORBA::Boolean
PG_Utils::get_tagged_component (
PortableGroup::ObjectGroup *&ior,
PortableGroup::TagGroupTaggedComponent &tg)
{
if (ior->_stubobj () == 0)
return 0;
TAO_MProfile &mprofile =
ior->_stubobj ()->base_profiles ();
// Looking for a tagged component with a TAG_FT_GROUP flag.
IOP::TaggedComponent tc;
tc.tag = IOP::TAG_FT_GROUP;
CORBA::ULong count =
mprofile.profile_count ();
for (CORBA::ULong i = 0;
i < count;
i++)
{
// Get the Tagged Components
const TAO_Tagged_Components &pfile_tagged =
mprofile.get_profile (i)->tagged_components ();
// Look for the primary
if (pfile_tagged.get_component (tc) == 1)
{
TAO_InputCDR cdr (reinterpret_cast<const char*> (tc.component_data.get_buffer ()),
tc.component_data.length ());
CORBA::Boolean byte_order;
cdr >> ACE_InputCDR::to_boolean (byte_order);
if (!cdr.good_bit ())
return 0;
cdr.reset_byte_order (static_cast<int> (byte_order));
cdr >> tg;
if (cdr.good_bit ())
return 1;
}
}
示例2: sizeof
CORBA::Boolean
CORBA::ValueBase::_tao_unmarshal_value_indirection_pre (TAO_InputCDR &strm,
TAO_InputCDR &indirected_strm)
{
CORBA::Long offset = 0;
if (!strm.read_long (offset) || offset >= 0)
{
return false;
}
size_t const buffer_size = -(offset) + sizeof (CORBA::Long);
// Cribbed from tc_demarshal_indirection in Typecode_CDR_Extraction.cpp
indirected_strm = TAO_InputCDR (strm.rd_ptr () + offset - sizeof (CORBA::Long),
buffer_size,
strm.byte_order ());
indirected_strm.set_repo_id_map (strm.get_repo_id_map ());
indirected_strm.set_codebase_url_map (strm.get_codebase_url_map ());
indirected_strm.set_value_map (strm.get_value_map ());
return indirected_strm.good_bit ();
}
示例3: cdr
void ReplicaController::
listener ()
{
try
{
for (char buffer[1024];;)
{
size_t n = group_->recv (buffer, sizeof (buffer));
ACE_HEX_DUMP ((LM_DEBUG, buffer, n));
TAO_InputCDR cdr (buffer, n);
CORBA::OctetSeq object_id;
PortableInterceptor::AdapterName adapter_name;
CORBA::String_var client_id;
CORBA::Long retention_id;
CORBA::OctetSeq reply;
CORBA::Any state;
cdr >> object_id;
cdr >> adapter_name;
cdr >> client_id.out ();
cdr >> retention_id;
cdr >> reply;
cdr >> state;
if (!cdr.good_bit ())
{
ACE_DEBUG ((LM_DEBUG, "CDR failed\n"));
//@@ what to do?
}
ACE_DEBUG ((LM_DEBUG,
"Received log for %s with rid %i\n",
client_id.in (),
retention_id));
RecordId rid (client_id.in (), retention_id);
CORBA::OctetSeq_var tmp (new CORBA::OctetSeq (reply));
log_.insert (rid, tmp);
// Update state.
CORBA::TypeCode_var tc = state.type ();
if (tc->kind () != CORBA::tk_null)
{
PortableServer::POA_var poa = resolve_poa (adapter_name);
PortableServer::ServantBase_var servant =
poa->id_to_servant (object_id);
Checkpointable* target =
dynamic_cast<Checkpointable*> (servant.in ());
if (target) target->set_state (state);
}
}
}
catch (ACE_TMCast::Group::Failed const&)
{
ACE_DEBUG ((LM_DEBUG,
"Group failure. Perhaps, I am alone in the group.\n"));
}
catch (ACE_TMCast::Group::InsufficienSpace const&)
{
ACE_DEBUG ((LM_DEBUG, "Group::InsufficienSpace\n"));
}
orb_->shutdown (0);
}