00001 #ifndef _IT_BUS_PDK_CONTEXT_H_
00002 #define _IT_BUS_PDK_CONTEXT_H_
00003
00004
00005
00006 #include <it_bus/types.h>
00007 #include <it_bus/any_type.h>
00008 #include <it_bus/qname.h>
00009 #include <it_bus_pdk/context_base.h>
00010 #include <it_bus_pdk/context_attrs/binding_context.h>
00011
00012 namespace IT_Bus
00013 {
00014 class ContextCurrent;
00015
00016 class Context;
00017
00018 class ContextContainer;
00019
00027 class IT_BUS_API ContextRegistry
00028 {
00029 public:
00030
00031 virtual ~ContextRegistry();
00032
00033
00039 enum ContextType
00040 {
00041 TYPE,
00042 ELEMENT
00043 };
00044
00050 virtual ContextCurrent&
00051 get_current() = 0;
00052
00068 virtual Boolean
00069 register_context(
00070 const QName& context_name,
00071 const QName& context_type,
00072 ContextType type = TYPE,
00073 Boolean is_header = false
00074 ) = 0;
00075
00076
00077
00078
00079
00080
00081
00082
00098 virtual Boolean
00099 register_context(
00100 const QName& context_name,
00101 const QName& context_type,
00102 const QName& message_name,
00103 const String& part_name
00104 ) = 0;
00105
00106
00107
00108
00109
00110
00111
00112
00128 virtual Boolean
00129 register_context_as_element(
00130 const QName& context_name,
00131 const QName& element_name,
00132 const QName& message_name,
00133 const String& part_name
00134 ) = 0;
00135
00136
00137
00138
00139
00140
00141
00142
00143
00155 virtual Boolean
00156 register_context(
00157 const QName& context_name,
00158 const QName& context_type,
00159 const unsigned long context_id
00160 ) = 0;
00161
00162
00171 virtual Boolean
00172 register_context_data(
00173 const QName& context_name
00174 ) = 0;
00175
00181 virtual Boolean
00182 is_registered(
00183 const QName& context_name
00184 ) = 0;
00185
00192 virtual ContextContainer *
00193 get_configuration_context(
00194 const QName & service_name,
00195 const String & port_name,
00196 bool create_if_not_found = false
00197 ) = 0;
00198
00199 };
00200
00204 class IT_BUS_API ContextContainer
00205 {
00206 public:
00207
00208 virtual ~ContextContainer();
00209
00240 virtual AnyType*
00241 get_context(
00242 const QName& context_name,
00243 bool create_if_not_found = false
00244 ) = 0;
00245
00254 virtual const AnyType*
00255 get_context(
00256 const QName& context_name
00257 ) const = 0;
00258
00267 virtual Boolean
00268 add_context(
00269 const QName& context_name,
00270 AnyType& context
00271 ) = 0;
00272
00279 virtual Context*
00280 get_context_data(
00281 const QName& context_name
00282 ) = 0;
00283
00290 virtual const Context*
00291 get_context_data(
00292 const QName& context_name
00293 ) const = 0;
00294
00304 virtual BindingContext*
00305 get_binding_context(
00306 const QName& context_name,
00307 const QName& binding_context,
00308 bool create_if_not_found = false
00309 ) = 0;
00310
00318 virtual const BindingContext*
00319 get_binding_context(
00320 const QName& context_name,
00321 const QName& binding_context
00322 ) const = 0;
00323
00334 virtual Boolean
00335 add_context(
00336 const QName& context_name,
00337 Context& context
00338 ) = 0;
00339
00346 virtual Boolean
00347 remove_context(
00348 const QName& context_name
00349 ) = 0;
00350
00358 virtual bool
00359 contains(
00360 const QName& context_name
00361 ) = 0;
00362 };
00363
00367 class IT_BUS_API ContextCurrent
00368 {
00369 public:
00370
00371 virtual ~ContextCurrent();
00372
00379 virtual ContextContainer*
00380 request_contexts() = 0;
00381
00388 virtual ContextContainer*
00389 reply_contexts() = 0;
00390 };
00391 }
00392
00393 #endif