From eb2510ae52e2647a294c1ab2e642bb9987bfb502 Mon Sep 17 00:00:00 2001 From: dai_y Date: Fri, 4 Dec 2009 23:21:00 +0000 Subject: Fri Dec 4 23:18:26 UTC 2009 Yan Dai --- TAO/tao/CDR.h | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) (limited to 'TAO/tao/CDR.h') diff --git a/TAO/tao/CDR.h b/TAO/tao/CDR.h index 8d3125cf334..5b97e998e02 100644 --- a/TAO/tao/CDR.h +++ b/TAO/tao/CDR.h @@ -54,8 +54,13 @@ #include "tao/Basic_Types.h" #include "tao/GIOP_Message_Version.h" #include "tao/Message_Semantics.h" +#include "tao/Intrusive_Ref_Count_Handle_T.h" +#include "tao/Intrusive_Ref_Count_Object_T.h" #include "ace/CDR_Stream.h" +#include "ace/SString.h" +#include "ace/Hash_Map_Manager_T.h" +#include "ace/Null_Mutex.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -86,6 +91,17 @@ class TAO_Export TAO_OutputCDR : public ACE_OutputCDR public: /// For reading from a output CDR stream. friend class TAO_InputCDR; + typedef ACE_Hash_Map_Manager Repo_Id_Map; + typedef Repo_Id_Map Codebase_URL_Map; + typedef ACE_Hash_Map_Manager Value_Map; + + typedef TAO_Intrusive_Ref_Count_Object RC_Repo_Id_Map; + typedef TAO_Intrusive_Ref_Count_Object RC_Codebase_URL_Map; + typedef TAO_Intrusive_Ref_Count_Object RC_Value_Map; + + typedef TAO_Intrusive_Ref_Count_Handle Repo_Id_Map_Handle; + typedef TAO_Intrusive_Ref_Count_Handle Codebase_URL_Map_Handle; + typedef TAO_Intrusive_Ref_Count_Handle Value_Map_Handle; // The default values for the allocators and memcpy_tradeoff // in these constructors are not 0, but are generated by the @@ -199,6 +215,31 @@ public: ACE_Time_Value * timeout (void) const; //@} + /// These methods are used by valuetype indirection support. + /// Accessor to the indirect maps. + Repo_Id_Map_Handle& get_repo_id_map (); +#ifdef TAO_HAS_VALUETYPE_CODEBASE + Codebase_URL_Map_Handle& get_codebase_url_map (); +#endif + Value_Map_Handle& get_value_map (); + + /// Updater of the maps. + /// These updaters are used to make indirect maps in original stream + /// take effect even during marshalling/demarshalling a redirected stream. + void set_repo_id_map (Repo_Id_Map_Handle& map); +#ifdef TAO_HAS_VALUETYPE_CODEBASE + Codebase_URL_Map_Handle& get_codebase_url_map (); + void set_codebase_url_map (Codebase_URL_Map_Handle& map); +#endif + void set_value_map (Value_Map_Handle& map); + + /// If indirect map is not nil and not empty, unbind all entries. + /// Called after marshalling. + void reset_vt_indirect_maps (); + + /// Calculate the offset between pos and current wr_ptr. + int offset (char* pos); + private: // disallow copying... @@ -236,6 +277,13 @@ private: /// Request/reply send timeout. ACE_Time_Value * timeout_; //@} + + /// These maps are used by valuetype indirection support. + Repo_Id_Map_Handle repo_id_map_; +#ifdef TAO_HAS_VALUETYPE_CODEBASE + Codebase_URL_Map_Handle codebase_map_; +#endif + Value_Map_Handle value_map_; }; /** @@ -261,6 +309,18 @@ private: class TAO_Export TAO_InputCDR : public ACE_InputCDR { public: + typedef ACE_Hash_Map_Manager Repo_Id_Map; + typedef Repo_Id_Map Codebase_URL_Map; + typedef ACE_Hash_Map_Manager Value_Map; + + typedef TAO_Intrusive_Ref_Count_Object RC_Repo_Id_Map; + typedef TAO_Intrusive_Ref_Count_Object RC_Codebase_URL_Map; + typedef TAO_Intrusive_Ref_Count_Object RC_Value_Map; + + typedef TAO_Intrusive_Ref_Count_Handle Repo_Id_Map_Handle; + typedef TAO_Intrusive_Ref_Count_Handle Codebase_URL_Map_Handle; + typedef TAO_Intrusive_Ref_Count_Handle Value_Map_Handle; + /** * Create an input stream from an arbitrary buffer, care must be * exercised wrt alignment, because this contructor will *not* work @@ -366,9 +426,31 @@ public: static void throw_stub_exception (int error_num); static void throw_skel_exception (int error_num); + /// These methods are used by valuetype indirection support. + /// Accessor to the indirect maps. + Repo_Id_Map_Handle& get_repo_id_map (); + Codebase_URL_Map_Handle& get_codebase_url_map (); + Value_Map_Handle& get_value_map (); + + /// Updater of the maps. + /// These updaters are used to make indirect maps in original stream + /// take effect even during marshalling/demarshalling a redirected stream. + void set_repo_id_map (Repo_Id_Map_Handle& map); + void set_codebase_url_map (Codebase_URL_Map_Handle& map); + void set_value_map (Value_Map_Handle& map); + + /// If indirect map is not nil and not empty, unbind all entries. + /// Called after demarshalling. + void reset_vt_indirect_maps (); + private: /// The ORB_Core, required to extract object references. TAO_ORB_Core* orb_core_; + + /// These maps are used by valuetype indirection support. + Repo_Id_Map_Handle repo_id_map_; + Codebase_URL_Map_Handle codebase_map_; + Value_Map_Handle value_map_; }; TAO_END_VERSIONED_NAMESPACE_DECL -- cgit v1.2.1