TAO_Unique_Id_Strategy Class Reference

Unique id strategy. More...

#include <Active_Object_Map.h>

Inheritance diagram for TAO_Unique_Id_Strategy:

Inheritance graph
[legend]
Collaboration diagram for TAO_Unique_Id_Strategy:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual int is_servant_in_map (PortableServer::Servant servant, bool &deactivated)
 Must be used with UNIQUE_ID policy.

virtual int unbind_using_user_id (const PortableServer::ObjectId &user_id)
virtual int find_user_id_using_servant (PortableServer::Servant servant, PortableServer::ObjectId_out user_id)
virtual int find_system_id_using_servant (PortableServer::Servant servant, PortableServer::ObjectId_out system_id, CORBA::Short &priority)
virtual int bind_using_user_id (PortableServer::Servant servant, const PortableServer::ObjectId &user_id, CORBA::Short priority, TAO_Active_Object_Map_Entry *&entry)
virtual CORBA::Boolean remaining_activations (PortableServer::Servant servant)

Detailed Description

Unique id strategy.

Strategy for the UNIQUE_ID policy.

Definition at line 295 of file Active_Object_Map.h.


Member Function Documentation

int TAO_Unique_Id_Strategy::bind_using_user_id PortableServer::Servant  servant,
const PortableServer::ObjectId user_id,
CORBA::Short  priority,
TAO_Active_Object_Map_Entry *&  entry
[virtual]
 

Can be used with any policy. With the SYSTEM_ID policy, is actually .

Implements TAO_Id_Uniqueness_Strategy.

Definition at line 396 of file Active_Object_Map.cpp.

References ACE_NEW_RETURN, TAO_Id_Hint_Strategy::bind(), TAO_Active_Object_Map::id_hint_strategy_, TAO_Active_Object_Map_Entry::priority_, TAO_Active_Object_Map_Entry::servant_, TAO_Active_Object_Map::servant_map_, TAO_Id_Hint_Strategy::unbind(), TAO_Active_Object_Map_Entry::user_id_, and TAO_Active_Object_Map::user_id_map_.

00400 {
00401   int result = this->active_object_map_->user_id_map_->find (user_id, entry);
00402   if (result == 0)
00403     {
00404       if (servant != 0)
00405         {
00406           entry->servant_ = servant;
00407 
00408           result = this->active_object_map_->servant_map_->bind (entry->servant_,
00409                                                                  entry);
00410         }
00411     }
00412   else
00413     {
00414       ACE_NEW_RETURN (entry,
00415                       TAO_Active_Object_Map_Entry,
00416                       -1);
00417       entry->user_id_ = user_id;
00418       entry->servant_ = servant;
00419       entry->priority_ = priority;
00420 
00421       result = this->active_object_map_->id_hint_strategy_->bind (*entry);
00422 
00423       if (result == 0)
00424         {
00425           result = this->active_object_map_->user_id_map_->bind (entry->user_id_,
00426                                                                  entry);
00427           if (result == 0)
00428             {
00429               if (servant != 0)
00430                 result = this->active_object_map_->servant_map_->bind (entry->servant_,
00431                                                                        entry);
00432               if (result != 0)
00433                 {
00434                   this->active_object_map_->user_id_map_->unbind (entry->user_id_);
00435                   this->active_object_map_->id_hint_strategy_->unbind (*entry);
00436                   delete entry;
00437                 }
00438             }
00439           else
00440             {
00441               this->active_object_map_->id_hint_strategy_->unbind (*entry);
00442               delete entry;
00443             }
00444         }
00445       else
00446         delete entry;
00447     }
00448 
00449   return result;
00450 }

int TAO_Unique_Id_Strategy::find_system_id_using_servant PortableServer::Servant  servant,
PortableServer::ObjectId_out  system_id,
CORBA::Short priority
[virtual]
 

Must be used with UNIQUE_ID policy. With the SYSTEM_ID policy, is actually .

Implements TAO_Id_Uniqueness_Strategy.

Definition at line 493 of file Active_Object_Map.cpp.

References TAO_Active_Object_Map_Entry::deactivated_, TAO_Active_Object_Map::id_hint_strategy_, TAO_Active_Object_Map_Entry::priority_, TAO_Active_Object_Map::servant_map_, and TAO_Id_Hint_Strategy::system_id().

00496 {
00497   TAO_Active_Object_Map_Entry *entry = 0;
00498   int result = this->active_object_map_->servant_map_->find (servant,
00499                                                              entry);
00500   if (result == 0)
00501     {
00502       if (entry->deactivated_)
00503         result = -1;
00504       else
00505         {
00506           result = this->active_object_map_->id_hint_strategy_->system_id (system_id,
00507                                                                            *entry);
00508           if (result == 0)
00509             priority = entry->priority_;
00510         }
00511     }
00512 
00513   return result;
00514 }

int TAO_Unique_Id_Strategy::find_user_id_using_servant PortableServer::Servant  servant,
PortableServer::ObjectId_out  user_id
[virtual]
 

Must be used with UNIQUE_ID policy. With the SYSTEM_ID policy, is actually .

Implements TAO_Id_Uniqueness_Strategy.

Definition at line 474 of file Active_Object_Map.cpp.

References ACE_NEW_RETURN, TAO_Active_Object_Map_Entry::deactivated_, TAO_Active_Object_Map::servant_map_, and TAO_Active_Object_Map_Entry::user_id_.

00476 {
00477   TAO_Active_Object_Map_Entry *entry = 0;
00478   int result = this->active_object_map_->servant_map_->find (servant, entry);
00479   if (result == 0)
00480     {
00481       if (entry->deactivated_)
00482         result = -1;
00483       else
00484         ACE_NEW_RETURN (user_id,
00485                         PortableServer::ObjectId (entry->user_id_),
00486                         -1);
00487     }
00488 
00489   return result;
00490 }

int TAO_Unique_Id_Strategy::is_servant_in_map PortableServer::Servant  servant,
bool &  deactivated
[virtual]
 

Must be used with UNIQUE_ID policy.

Implements TAO_Id_Uniqueness_Strategy.

Definition at line 373 of file Active_Object_Map.cpp.

References TAO_Active_Object_Map_Entry::deactivated_, and TAO_Active_Object_Map::servant_map_.

00375 {
00376   TAO_Active_Object_Map_Entry *entry = 0;
00377   int result = this->active_object_map_->servant_map_->find (servant,
00378                                                              entry);
00379   if (result == 0)
00380     {
00381       result = 1;
00382       if (entry->deactivated_)
00383         {
00384           deactivated = true;
00385         }
00386     }
00387   else
00388     {
00389       result = 0;
00390     }
00391 
00392   return result;
00393 }

CORBA::Boolean TAO_Unique_Id_Strategy::remaining_activations PortableServer::Servant  servant  )  [virtual]
 

Are there any remaining activations of in the active object map? Can be used with any policy.

Implements TAO_Id_Uniqueness_Strategy.

Definition at line 517 of file Active_Object_Map.cpp.

00518 {
00519   ACE_UNUSED_ARG (servant);
00520 
00521   // Since servant are always unique here, return false.
00522   return 0;
00523 }

int TAO_Unique_Id_Strategy::unbind_using_user_id const PortableServer::ObjectId user_id  )  [virtual]
 

Can be used with any policy. With the SYSTEM_ID policy, is actually .

Implements TAO_Id_Uniqueness_Strategy.

Definition at line 453 of file Active_Object_Map.cpp.

References TAO_Active_Object_Map::id_hint_strategy_, TAO_Active_Object_Map_Entry::servant_, TAO_Active_Object_Map::servant_map_, TAO_Id_Hint_Strategy::unbind(), and TAO_Active_Object_Map::user_id_map_.

00454 {
00455   TAO_Active_Object_Map_Entry *entry = 0;
00456   int result = this->active_object_map_->user_id_map_->unbind (user_id,
00457                                                                entry);
00458   if (result == 0)
00459     {
00460       if (entry->servant_ != 0)
00461         result = this->active_object_map_->servant_map_->unbind (entry->servant_);
00462 
00463       if (result == 0)
00464         result =
00465           this->active_object_map_->id_hint_strategy_->unbind (*entry);
00466 
00467       if (result == 0)
00468         delete entry;
00469     }
00470   return result;
00471 }


The documentation for this class was generated from the following files:
Generated on Sun Jan 27 13:27:51 2008 for TAO_PortableServer by doxygen 1.3.6