Exemplo n.º 1
0
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);
}
Exemplo n.º 2
0
int
TAO_Ignore_Original_Key_Adapter::decode (const PortableServer::ObjectId &modified_key,
                                         ACE_Active_Map_Manager_Key &active_key)
{
  // Read off value of index and generation.
  active_key.decode (modified_key.get_buffer ());

  // Success.
  return 0;
}
Exemplo n.º 3
0
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;
}
Exemplo n.º 4
0
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;
}
Exemplo n.º 5
0
int
TAO_Ignore_Original_Key_Adapter::decode (const PortableServer::ObjectId &modified_key,
                                         PortableServer::ObjectId &original_key)
{
  // Smartly copy all the data; <original_key does not own the data>.
  original_key.replace (modified_key.maximum (),
                        modified_key.length (),
                        const_cast <CORBA::Octet *>
                                   (modified_key.get_buffer ()),
                        0);

  // Success.
  return 0;
}
Exemplo n.º 6
0
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());
}
Exemplo n.º 7
0
int
TAO_Incremental_Key_Generator::operator() (PortableServer::ObjectId &id)
{
  const size_t cntr_size = sizeof this->counter_;
  // Resize to accommodate the counter.
  id.length (cntr_size);

  // Add new key data.
  ACE_OS::memcpy (id.get_buffer (),
                  &++this->counter_,
                  cntr_size);

  // Success.
  return 0;
}
Exemplo n.º 8
0
int
TAO_Preserve_Original_Key_Adapter::decode (const PortableServer::ObjectId &modified_key,
                                           PortableServer::ObjectId &original_key)
{
  // Size of active key.
  size_t const active_key_size = ACE_Active_Map_Manager_Key::size ();

  // Smartly copy all the data; <original_key does not own the data>.
  original_key.replace (static_cast <CORBA::ULong>
                            (modified_key.maximum () - active_key_size),
                        static_cast <CORBA::ULong>
                            (modified_key.length () - active_key_size),
                        const_cast <CORBA::Octet *>
                            (modified_key.get_buffer ()) + active_key_size,
                        0);

  // Success.
  return 0;
}
Exemplo n.º 9
0
u_long
TAO_ObjectId_Hash::operator () (const PortableServer::ObjectId &id) const
{
  return ACE::hash_pjw ((const char *) id.get_buffer (),
                        id.length ());
}