PG_Group_Factory.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  * @file  PG_Group_Factory.h
00006  *
00007  * $Id: PG_Group_Factory.h 77001 2007-02-12 07:54:49Z johnnyw $
00008  *
00009  * @author Dale Wilson <wilson_d@ociweb.com>
00010  */
00011 //=============================================================================
00012 
00013 #ifndef TAO_PG_GROUP_FACTORY_H
00014 #define TAO_PG_GROUP_FACTORY_H
00015 
00016 #include /**/ "ace/pre.h"
00017 
00018 #include "orbsvcs/PortableGroup/portablegroup_export.h"
00019 
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 #pragma once
00022 #endif /* ACE_LACKS_PRAGMA_ONCE */
00023 
00024 #include "orbsvcs/PortableGroup/PG_Object_Group_Manipulator.h"
00025 
00026 #include "orbsvcs/PortableGroupC.h"
00027 
00028 #include "tao/PortableServer/PortableServer.h"
00029 
00030 #include "ace/ACE.h"
00031 #include "ace/Hash_Map_Manager.h"
00032 
00033 
00034 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00035 
00036 //////////////////
00037 // Forward reference
00038 namespace TAO
00039 {
00040   class PG_Property_Set;
00041 } // namespace TAO_PG
00042 
00043 namespace TAO
00044 {
00045   /////////////////////
00046   // forward references
00047   class PG_Object_Group;
00048 
00049   /**
00050    * class PG_Group_Factory
00051    */
00052   class TAO_PortableGroup_Export PG_Group_Factory
00053   {
00054     ////////////////////////////////////////////////////////////
00055     // typedef private implementation classes
00056     typedef ACE_Hash_Map_Manager_Ex<
00057         PortableGroup::ObjectGroupId,
00058         ::TAO::PG_Object_Group *,
00059         ACE_Hash<ACE_UINT64>,
00060         ACE_Equal_To<ACE_UINT64>,
00061          TAO_SYNCH_MUTEX> Group_Map;
00062 
00063     typedef ACE_Hash_Map_Entry <PortableGroup::ObjectGroupId, ::TAO::PG_Object_Group *> Group_Map_Entry;
00064 
00065     typedef ACE_Hash_Map_Iterator_Ex <
00066       PortableGroup::ObjectGroupId,
00067       ::TAO::PG_Object_Group *,
00068       ACE_Hash<ACE_UINT64>,
00069       ACE_Equal_To<ACE_UINT64>,
00070        TAO_SYNCH_MUTEX> Group_Map_Iterator;
00071 
00072   public:
00073 
00074     /// Constructor.
00075     PG_Group_Factory ();
00076 
00077     /// Destructor.
00078     ~PG_Group_Factory ();
00079 
00080     void init (
00081       CORBA::ORB_ptr orb,
00082       PortableServer::POA_ptr poa,
00083       PortableGroup::FactoryRegistry_ptr factory_registry);
00084 
00085 
00086     TAO::PG_Object_Group * create_group (
00087         const char * type_id,
00088         const PortableGroup::Criteria & the_criteria,
00089         TAO::PG_Property_Set * typeid_properties);
00090 
00091 
00092     void delete_group (PortableGroup::ObjectGroup_ptr object_group);
00093 
00094 
00095     void delete_group (PortableGroup::ObjectGroupId group_id);
00096 
00097     PortableGroup::ObjectGroups *
00098     groups_at_location (
00099         const PortableGroup::Location & the_location);
00100 
00101 
00102 
00103     /**
00104      * insert existing group.  Take ownership
00105      * note: uses group id extracted from group object
00106      * @return bool true if insertion successful
00107      */
00108     int insert_group ( ::TAO::PG_Object_Group * group);
00109 
00110     /**
00111      * insert group.  Take ownership
00112      * @return bool true if insertion successful
00113      */
00114     int insert_group (PortableGroup::ObjectGroupId group_id, ::TAO::PG_Object_Group * group);
00115 
00116     /**
00117      * find group
00118      * @return bool true if found
00119      */
00120     int find_group (PortableGroup::ObjectGroupId group_id, ::TAO::PG_Object_Group *& group) const;
00121 
00122     /**
00123      * find group
00124      * note: uses group id extracted from object_group
00125      * @return bool true if found
00126      */
00127     int find_group (PortableGroup::ObjectGroup_ptr object_group, ::TAO::PG_Object_Group *& group) const;
00128 
00129     /**
00130      * remove group from map and delete it.
00131      * @return bool true if found
00132      */
00133     int destroy_group (PortableGroup::ObjectGroupId object_group_id);
00134 
00135     /**
00136      * remove group from map and delete it.
00137      * note: uses group id extracted from object_group
00138      * @return bool true if found
00139      */
00140     int destroy_group (PortableGroup::ObjectGroup_ptr object_group);
00141 
00142   private:
00143 
00144   private:
00145 
00146     CORBA::ORB_var orb_;
00147 
00148     /// Reference to the POA used to create object group references.
00149     PortableServer::POA_var poa_;
00150 
00151     /// The factory registry for replica factories
00152     PortableGroup::FactoryRegistry_var factory_registry_;
00153 
00154     ::TAO::PG_Object_Group_Manipulator manipulator_;
00155 
00156     const char * domain_id_;
00157 
00158     Group_Map group_map_;
00159 
00160 
00161   };
00162 } // namespace TAO
00163 
00164 TAO_END_VERSIONED_NAMESPACE_DECL
00165 
00166 #include /**/ "ace/post.h"
00167 
00168 #endif  /* TAO_PG_GROUP_FACTORY_H */

Generated on Tue Feb 2 17:49:50 2010 for TAO_PortableGroup by  doxygen 1.4.7