本文整理汇总了C++中portableserver::ObjectId::length方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectId::length方法的具体用法?C++ ObjectId::length怎么用?C++ ObjectId::length使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类portableserver::ObjectId
的用法示例。
在下文中一共展示了ObjectId::length方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: return
bool operator== (const PortableServer::ObjectId& lhs, const PortableServer::ObjectId& rhs)
{
if (lhs.length() != rhs.length()) {
return false;
}
return (memcmp(lhs.get_buffer(), rhs.get_buffer(), lhs.length()) == 0);
}
示例2:
bool
compare_object_ids (const PortableServer::ObjectId& id1, const PortableServer::ObjectId& id2)
{
if (id1.length() != id2.length())
{
return false;
}
for (unsigned int i = 0; i < id1.length(); i++)
{
if (id1[i] != id2[i])
{
return false;
}
}
return true;
}
示例3:
int
TAO_No_Hint_Strategy::recover_key (const PortableServer::ObjectId &system_id,
PortableServer::ObjectId &user_id)
{
// Smartly copy all the data; <user_id does not own the data>.
user_id.replace (system_id.maximum (),
system_id.length (),
const_cast<CORBA::Octet *> (system_id.get_buffer ()),
0);
return 0;
}
示例4:
int
TAO_Preserve_Original_Key_Adapter::encode (const PortableServer::ObjectId &original_key,
const ACE_Active_Map_Manager_Key &active_key,
PortableServer::ObjectId &modified_key)
{
// Size of active key.
size_t const active_key_size = active_key.size ();
// Resize to accommodate both the original data and the new active key.
modified_key.length (static_cast <CORBA::ULong> (active_key_size)
+ original_key.length ());
// Copy active key data into user key.
active_key.encode (modified_key.get_buffer ());
// Copy the original key after the active key.
ACE_OS::memcpy (modified_key.get_buffer () + active_key_size,
original_key.get_buffer (),
original_key.length ());
// Success.
return 0;
}
示例5: activate
FTRT::AMI_UpdateableHandler_ptr UpdateableHandler::activate(
Update_Manager* mgr, int id,
PortableServer::ObjectId& object_id)
{
object_id.length(sizeof(mgr) + sizeof(id));
ACE_OS::memcpy(object_id.get_buffer(), &mgr, sizeof(mgr));
ACE_OS::memcpy(object_id.get_buffer() + sizeof(mgr), &id, sizeof(id));
strategy_->poa()->activate_object_with_id(object_id,
this);
CORBA::Object_var object = strategy_->poa()->id_to_reference(
object_id);
return FTRT::AMI_UpdateableHandler::_narrow(object.in());
}
示例6: idstr
int
TAO_Multiple_Id_Strategy::bind_using_user_id (
PortableServer::Servant servant,
const PortableServer::ObjectId &user_id,
CORBA::Short priority,
TAO_Active_Object_Map_Entry *&entry)
{
int result =
this->active_object_map_->user_id_map_->find (user_id, entry);
if (result == 0)
{
if (servant != 0)
{
entry->servant_ = servant;
}
}
else
{
ACE_NEW_RETURN (entry,
TAO_Active_Object_Map_Entry,
-1);
entry->user_id_ = user_id;
entry->servant_ = servant;
entry->priority_ = priority;
result =
this->active_object_map_->id_hint_strategy_->bind (*entry);
if (result == 0)
{
result =
this->active_object_map_->user_id_map_->bind (entry->user_id_,
entry);
if (result != 0)
{
this->active_object_map_->id_hint_strategy_->unbind (*entry);
delete entry;
}
else
{
#if defined (TAO_HAS_MONITOR_POINTS) && (TAO_HAS_MONITOR_POINTS == 1)
this->active_object_map_->monitor_->receive (
this->active_object_map_->user_id_map_->current_size ());
#endif /* TAO_HAS_MONITOR_POINTS==1 */
}
}
else
{
delete entry;
}
}
#if (TAO_HAS_MINIMUM_CORBA == 0)
if (result == 0 && TAO_debug_level > 7)
{
CORBA::String_var idstr (PortableServer::ObjectId_to_string (user_id));
CORBA::String_var repository_id (
servant ? servant->_repository_id () : 0);
ACE_CString hex_idstr;
hexstring (hex_idstr, idstr.in (), user_id.length ());
TAOLIB_DEBUG ((LM_DEBUG,
"TAO (%P|%t) - TAO_Multiple_Id_Strategy::"
"bind_using_user_id: type=%C, id=%C\n",
repository_id.in (),
hex_idstr.c_str()
));
}
#endif
return result;
}
示例7: hash_pjw
u_long
TAO_ObjectId_Hash::operator () (const PortableServer::ObjectId &id) const
{
return ACE::hash_pjw ((const char *) id.get_buffer (),
id.length ());
}
示例8: TransactionDepthTooHigh
void
AMI_Primary_Replication_Strategy::replicate_request(
const FTRT::State& state,
RollbackOperation rollback,
const FtRtecEventChannelAdmin::ObjectId& oid)
{
ACE_Auto_Event event;
Update_Manager* manager = 0;
bool success = false;
FTRT::TransactionDepth transaction_depth =
Request_Context_Repository().get_transaction_depth();
const FtRtecEventChannelAdmin::EventChannelList& backups =
GroupInfoPublisher::instance()->backups();
size_t num_backups = backups.length();
if ((size_t)transaction_depth > num_backups) {
TAO_FTRTEC::Log(3, ACE_TEXT("Throwing FTRT::TransactionDepthTooHigh\n"));
throw FTRT::TransactionDepthTooHigh();
}
ACE_NEW_THROW_EX(manager,
Update_Manager(event, backups.length(), transaction_depth-1, success),
CORBA::NO_MEMORY());
Request_Context_Repository().set_transaction_depth(0);
for (size_t i = 0; i < num_backups; ++i) {
PortableServer::ObjectId oid;
try{
FTRT::AMI_UpdateableHandler_ptr handler = handler_.activate(manager, i, oid);
FtRtecEventChannelAdmin::EventChannel_ptr obj = backups[i];
// send set_update request to all the backup replicas
obj->sendc_set_update(handler, state);
}
catch (const CORBA::Exception& ex){
ex._tao_print_exception (
"AMI_Primary_Replication_Strategy::replicate_request : ");
manager->handle_exception(i);
if (oid.length())
poa_->deactivate_object(oid);
}
}
// wait until the first transaction_depth replicas replied.
event.wait();
if (!success) { // replication failed, transaction depth too high
for (size_t i =0; i < num_backups; ++i) {
try{
FtRtecEventChannelAdmin::EventChannel_ptr ec = backups[i];
(ec->*rollback)(oid);
}
catch (...){
}
}
TAO_FTRTEC::Log(3, ACE_TEXT("Throwing FTRT::TransactionDepthTooHigh\n"));
throw FTRT::TransactionDepthTooHigh();
}
}