00001 // -*- C++ -*- 00002 00003 // =================================================================== 00004 /** 00005 * @file Service_Context_Handler_Registry.h 00006 * 00007 * $Id: Service_Context_Handler_Registry.h 84860 2009-03-17 10:17:38Z johnnyw $ 00008 * 00009 * @author Johnny Willemsen <jwillemsen@remedy.nl> 00010 */ 00011 // =================================================================== 00012 00013 #ifndef TAO_SERVICE_CONTEXT_HANDLER_REGISTRY_H 00014 #define TAO_SERVICE_CONTEXT_HANDLER_REGISTRY_H 00015 00016 #include /**/ "ace/pre.h" 00017 00018 #include "tao/IOPC.h" 00019 00020 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00021 # pragma once 00022 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00023 00024 #include "ace/Array_Map.h" 00025 00026 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00027 00028 class TAO_Transport; 00029 class TAO_Service_Context_Handler; 00030 class TAO_Operation_Details; 00031 class TAO_Target_Specification; 00032 class TAO_Stub; 00033 00034 class TAO_Export TAO_Service_Context_Registry 00035 { 00036 public: 00037 /// Destructor 00038 00039 ~TAO_Service_Context_Registry (void); 00040 00041 /** 00042 * Bind a new entry in the registry 00043 */ 00044 int bind (IOP::ServiceId id, TAO_Service_Context_Handler* handler); 00045 00046 /** 00047 * Retrieve the entry related to @a id 00048 */ 00049 TAO_Service_Context_Handler* operator[] (IOP::ServiceId id); 00050 00051 int process_service_contexts (IOP::ServiceContextList &sc, TAO_Transport& transport); 00052 00053 int generate_service_context ( 00054 TAO_Stub *stub, 00055 TAO_Transport& transport, 00056 TAO_Operation_Details &opdetails, 00057 TAO_Target_Specification &spec, 00058 TAO_OutputCDR &msg); 00059 00060 private: 00061 typedef ACE_Array_Map<IOP::ServiceId, 00062 TAO_Service_Context_Handler*> Table; 00063 typedef Table::key_type key_type; 00064 typedef Table::data_type data_type; 00065 typedef Table::value_type value_type; 00066 typedef Table::size_type size_type; 00067 typedef value_type * iterator; 00068 00069 Table registry_; 00070 }; 00071 00072 TAO_END_VERSIONED_NAMESPACE_DECL 00073 00074 #include /**/ "ace/post.h" 00075 00076 #endif /* TAO_SERVICE_CONTEXT_HANDLER_REGISTRY_H */