summaryrefslogtreecommitdiff
path: root/TAO/tao/Parser_Registry.h
blob: 1244458a2510df1a5e85a087ea3d81133aaa407f (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
77
78
79
80
// This may look like C, but it's really -*- C++ -*-
// $Id$

// ============================================================================
//
// = LIBRARY
//     TAO
//
// = AUTHOR
//     Priyanka Gontla <pgontla@uci.edu>
//     Carlos O'Ryan <coryan@uci.edu>
//
// ============================================================================

#ifndef TAO_PARSER_REGISTRY_H
#define TAO_PARSER_REGISTRY_H

#include "ace/pre.h"

#include "tao/corbafwd.h"

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

// Forward declarations.
class TAO_ORB_Core;

class TAO_IOR_Parser;

class TAO_Export TAO_Parser_Registry
{
  // = TITLE
  //   Maintain the collection of known IOR format parsers
  //
  // = DESCRIPTION
  //   The ORB dynamically loads a collection of IOR parsers (check
  //   the IOR_Parser class).  The collection is kept in this class
  //   for easy lookup and use.
  //
public:
  // = Initialization and termination methods.
  TAO_Parser_Registry (void);
  // Default constructor.

  ~TAO_Parser_Registry (void);
  // Dstructor.

  int open (TAO_ORB_Core *orb_core);
  // Initialize the parser registry with the list of known protocols.
  // Invoked by the ORB during startup.

  TAO_IOR_Parser *match_parser (const char *ior_string);
  // Find the parser that can parse <ior_string>
  // The lookup is based on the prefix in the string

  // = Iterator.
  typedef TAO_IOR_Parser** Parser_Iterator;
  Parser_Iterator begin (void) const;
  Parser_Iterator end (void) const;

private:
  // The parser registry should not be copied.
  ACE_UNIMPLEMENTED_FUNC (TAO_Parser_Registry (const TAO_Parser_Registry&))
  ACE_UNIMPLEMENTED_FUNC (void operator= (const TAO_Parser_Registry&))

private:
  TAO_IOR_Parser **parsers_;
  // List of parsers

  size_t size_;
  // Number of parsers
};

#if defined(__ACE_INLINE__)
#include "tao/Parser_Registry.i"
#endif /* __ACE_INLINE__ */

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