PG_Object_Group_Manipulator.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  * @file PG_Object_Group_Manipulator.h
00006  *
00007  * $Id: PG_Object_Group_Manipulator.h 76589 2007-01-25 18:04:11Z elliott_c $
00008  *
00009  * @author Dale Wilson <wilson_d@ociweb.com>
00010  */
00011 //=============================================================================
00012 
00013 
00014 #ifndef TAO_PG_OBJECT_GROUP_MANIPULATOR_H
00015 #define TAO_PG_OBJECT_GROUP_MANIPULATOR_H
00016 
00017 #include /**/ "ace/pre.h"
00018 
00019 #include "orbsvcs/PortableGroup/portablegroup_export.h"
00020 
00021 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00022 #pragma once
00023 #endif /* ACE_LACKS_PRAGMA_ONCE */
00024 
00025 #include "orbsvcs/PortableGroupS.h"
00026 
00027 #include "tao/IORManipulation/IORManip_Loader.h"
00028 
00029 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00030 
00031 namespace TAO
00032 {
00033 
00034   /**
00035    * @class TAO::PG_Object_Group_Manipulator
00036    *
00037    * @brief PortableGroup::ObjectGroupManager implementation.
00038    *
00039    * The ObjectGroupManager provides the interface necessary to
00040    * facilitate application-controlled object group membership.
00041    */
00042   class TAO_PortableGroup_Export PG_Object_Group_Manipulator
00043   {
00044   public:
00045 
00046     /// Constructor.
00047     PG_Object_Group_Manipulator ();
00048 
00049     /// Destructor.
00050     ~PG_Object_Group_Manipulator ();
00051 
00052     /**
00053      * Initializes the group creator.
00054      */
00055     void init (CORBA::ORB_ptr orb,
00056                PortableServer::POA_ptr poa);
00057 
00058     /**
00059      * Create an empty object group.
00060      */
00061     PortableGroup::ObjectGroup_ptr create_object_group (
00062       const char * type_id,
00063       const char * domain_id,
00064       PortableGroup::ObjectGroupId & group_id);
00065 
00066     PortableGroup::ObjectGroup_ptr remove_profiles (
00067       PortableGroup::ObjectGroup_ptr group,
00068       PortableGroup::ObjectGroup_ptr profile) const;
00069 
00070     PortableGroup::ObjectGroup_ptr merge_iors (
00071       TAO_IOP::TAO_IOR_Manipulation::IORList & iors) const;
00072 
00073     int set_primary (
00074       TAO_IOP::TAO_IOR_Property * prop,
00075       PortableGroup::ObjectGroup_ptr reference,
00076       CORBA::Object_ptr new_primary) const;
00077 
00078   void dump_membership (const char * label,
00079                         PortableGroup::ObjectGroup_ptr member) const;
00080 
00081   private:
00082 
00083     /**
00084      * Allocate an ogid for a new object group
00085      */
00086     void allocate_ogid (PortableGroup::ObjectGroupId & ogid);
00087 
00088     /**
00089      * convert numeric OGID to Sequence<Octet> oid
00090      */
00091     PortableServer::ObjectId *
00092       convert_ogid_to_oid (PortableGroup::ObjectGroupId ogid) const;
00093 
00094   private:
00095 
00096     /// The orb
00097     CORBA::ORB_var orb_;
00098 
00099     /// Reference to the POA that created the object group references.
00100     PortableServer::POA_var poa_;
00101 
00102     /// The ORBs IORManipulation object
00103     TAO_IOP::TAO_IOR_Manipulation_var iorm_;
00104 
00105     /// Lock used to synchronize access to next_ogid_.
00106     TAO_SYNCH_MUTEX lock_ogid_;
00107 
00108     /// Next ogid to be allocated.
00109     PortableGroup::ObjectGroupId next_ogid_;
00110 
00111   };
00112 } //namespace TAO
00113 
00114 TAO_END_VERSIONED_NAMESPACE_DECL
00115 
00116 #include /**/ "ace/post.h"
00117 
00118 #endif  /* TAO::PG_OBJECT_GROUP_CREATOR_H */

Generated on Sun Jan 27 16:22:30 2008 for TAO_PortableGroup by doxygen 1.3.6