summaryrefslogtreecommitdiff
path: root/TAO/tao/CDR.h
diff options
context:
space:
mode:
authordai_y <dai_y@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-12-04 23:21:00 +0000
committerdai_y <dai_y@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-12-04 23:21:00 +0000
commiteb2510ae52e2647a294c1ab2e642bb9987bfb502 (patch)
tree0e50dd3dcea768952d89e75de7b3ead46ab825c6 /TAO/tao/CDR.h
parente791ad22ad1446fa08de128b665bdb5a53cca96e (diff)
downloadATCD-eb2510ae52e2647a294c1ab2e642bb9987bfb502.tar.gz
Fri Dec 4 23:18:26 UTC 2009 Yan Dai <dai_y@ociweb.com>
Diffstat (limited to 'TAO/tao/CDR.h')
-rw-r--r--TAO/tao/CDR.h82
1 files changed, 82 insertions, 0 deletions
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<ACE_CString, char*, ACE_Null_Mutex> Repo_Id_Map;
+ typedef Repo_Id_Map Codebase_URL_Map;
+ typedef ACE_Hash_Map_Manager<void*, char*, ACE_Null_Mutex> Value_Map;
+
+ typedef TAO_Intrusive_Ref_Count_Object<Repo_Id_Map, ACE_Null_Mutex> RC_Repo_Id_Map;
+ typedef TAO_Intrusive_Ref_Count_Object<Codebase_URL_Map, ACE_Null_Mutex> RC_Codebase_URL_Map;
+ typedef TAO_Intrusive_Ref_Count_Object<Value_Map, ACE_Null_Mutex> RC_Value_Map;
+
+ typedef TAO_Intrusive_Ref_Count_Handle<RC_Repo_Id_Map> Repo_Id_Map_Handle;
+ typedef TAO_Intrusive_Ref_Count_Handle<RC_Codebase_URL_Map> Codebase_URL_Map_Handle;
+ typedef TAO_Intrusive_Ref_Count_Handle<RC_Value_Map> 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<void*, ACE_CString, ACE_Null_Mutex> Repo_Id_Map;
+ typedef Repo_Id_Map Codebase_URL_Map;
+ typedef ACE_Hash_Map_Manager<void*, void*, ACE_Null_Mutex> Value_Map;
+
+ typedef TAO_Intrusive_Ref_Count_Object<Repo_Id_Map, ACE_Null_Mutex> RC_Repo_Id_Map;
+ typedef TAO_Intrusive_Ref_Count_Object<Codebase_URL_Map, ACE_Null_Mutex> RC_Codebase_URL_Map;
+ typedef TAO_Intrusive_Ref_Count_Object<Value_Map, ACE_Null_Mutex> RC_Value_Map;
+
+ typedef TAO_Intrusive_Ref_Count_Handle<RC_Repo_Id_Map> Repo_Id_Map_Handle;
+ typedef TAO_Intrusive_Ref_Count_Handle<RC_Codebase_URL_Map> Codebase_URL_Map_Handle;
+ typedef TAO_Intrusive_Ref_Count_Handle<RC_Value_Map> 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