00001 // -*- C++ -*- 00002 00003 // =================================================================== 00004 /** 00005 * @file Service_Context_Handler_Registry.h 00006 * 00007 * $Id: Service_Context_Handler_Registry.h 80861 2008-03-07 13:48:34Z 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/IOP_IORC.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_ServerRequest; 00029 class TAO_Service_Context_Handler; 00030 00031 class TAO_Export TAO_Service_Context_Registry 00032 { 00033 public: 00034 /// Destructor 00035 00036 ~TAO_Service_Context_Registry (void); 00037 00038 /** 00039 * Bind a new entry in the registry 00040 */ 00041 int bind (IOP::ServiceId id, TAO_Service_Context_Handler* handler); 00042 00043 /** 00044 * Retrieve the entry related to @a id 00045 */ 00046 TAO_Service_Context_Handler* operator[] (IOP::ServiceId id); 00047 00048 int process_service_contexts (TAO_ServerRequest& server_request); 00049 00050 private: 00051 typedef ACE_Array_Map<IOP::ServiceId, 00052 TAO_Service_Context_Handler*> Table; 00053 typedef Table::key_type key_type; 00054 typedef Table::data_type data_type; 00055 typedef Table::value_type value_type; 00056 typedef Table::size_type size_type; 00057 typedef value_type * iterator; 00058 00059 Table registry_; 00060 }; 00061 00062 TAO_END_VERSIONED_NAMESPACE_DECL 00063 00064 #include /**/ "ace/post.h" 00065 00066 #endif /* TAO_SERVICE_CONTEXT_HANDLER_REGISTRY_H */