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  * PG_Object_Group_Manipulator.h,v 1.9 2006/03/14 06:14:34 jtc Exp
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                ACE_ENV_ARG_DECL);
00058 
00059     /**
00060      * Create an empty object group.
00061      */
00062     PortableGroup::ObjectGroup_ptr create_object_group (
00063       const char * type_id,
00064       const char * domain_id,
00065       PortableGroup::ObjectGroupId & group_id
00066       ACE_ENV_ARG_DECL);
00067 
00068     PortableGroup::ObjectGroup_ptr remove_profiles (
00069       PortableGroup::ObjectGroup_ptr group,
00070       PortableGroup::ObjectGroup_ptr profile
00071       ACE_ENV_ARG_DECL) const;
00072 
00073     PortableGroup::ObjectGroup_ptr merge_iors (
00074       TAO_IOP::TAO_IOR_Manipulation::IORList & iors
00075       ACE_ENV_ARG_DECL) const;
00076 
00077     int set_primary (
00078       TAO_IOP::TAO_IOR_Property * prop,
00079       PortableGroup::ObjectGroup_ptr reference,
00080       CORBA::Object_ptr new_primary
00081       ACE_ENV_ARG_DECL) const;
00082 
00083   void dump_membership (const char * label,
00084                         PortableGroup::ObjectGroup_ptr member) const;
00085 
00086   private:
00087 
00088     /**
00089      * Allocate an ogid for a new object group
00090      */
00091     void allocate_ogid (PortableGroup::ObjectGroupId & ogid);
00092 
00093     /**
00094      * convert numeric OGID to Sequence<Octet> oid
00095      */
00096     PortableServer::ObjectId *
00097       convert_ogid_to_oid (PortableGroup::ObjectGroupId ogid) const;
00098 
00099   private:
00100 
00101     /// The orb
00102     CORBA::ORB_var orb_;
00103 
00104     /// Reference to the POA that created the object group references.
00105     PortableServer::POA_var poa_;
00106 
00107     /// The ORBs IORManipulation object
00108     TAO_IOP::TAO_IOR_Manipulation_var iorm_;
00109 
00110     /// Lock used to synchronize access to next_ogid_.
00111     TAO_SYNCH_MUTEX lock_ogid_;
00112 
00113     /// Next ogid to be allocated.
00114     PortableGroup::ObjectGroupId next_ogid_;
00115 
00116   };
00117 } //namespace TAO
00118 
00119 TAO_END_VERSIONED_NAMESPACE_DECL
00120 
00121 #include /**/ "ace/post.h"
00122 
00123 #endif  /* TAO::PG_OBJECT_GROUP_CREATOR_H */

Generated on Thu Nov 9 14:03:33 2006 for TAO_PortableGroup by doxygen 1.3.6