summaryrefslogtreecommitdiff
path: root/TAO/tao/Service_Context_Handler_Registry.h
blob: ec900f09c1963aaff3e827e2888daca7a849c612 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// -*- C++ -*-

// ===================================================================
/**
 *  @file   Service_Context_Handler_Registry.h
 *
 *  $Id$
 *
 *  @author Johnny Willemsen  <jwillemsen@remedy.nl>
 */
// ===================================================================

#ifndef TAO_SERVICE_CONTEXT_HANDLER_REGISTRY_H
#define TAO_SERVICE_CONTEXT_HANDLER_REGISTRY_H

#include /**/ "ace/pre.h"

#include "tao/IOPC.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include "ace/Array_Map.h"

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

class TAO_Transport;
class TAO_Service_Context_Handler;
class TAO_Operation_Details;
class TAO_Target_Specification;
class TAO_Stub;

class TAO_Export TAO_Service_Context_Registry
{
  public:
    /// Destructor

    ~TAO_Service_Context_Registry (void);

    /**
     * Bind a new entry in the registry
     */
    int bind (IOP::ServiceId id, TAO_Service_Context_Handler* handler);

    /**
     * Retrieve the entry related to @a id
     */
    TAO_Service_Context_Handler* operator[] (IOP::ServiceId id);

    int process_service_contexts (IOP::ServiceContextList &sc, TAO_Transport& transport);

    int generate_service_context (
      TAO_Stub *stub,
      TAO_Transport& transport,
      TAO_Operation_Details &opdetails,
      TAO_Target_Specification &spec,
      TAO_OutputCDR &msg);

  private:
    typedef ACE_Array_Map<IOP::ServiceId,
                          TAO_Service_Context_Handler*> Table;
    typedef Table::key_type   key_type;
    typedef Table::data_type  data_type;
    typedef Table::value_type value_type;
    typedef Table::size_type  size_type;
    typedef value_type *      iterator;

    Table registry_;
};

TAO_END_VERSIONED_NAMESPACE_DECL

#include /**/ "ace/post.h"

#endif  /* TAO_SERVICE_CONTEXT_HANDLER_REGISTRY_H */