summaryrefslogtreecommitdiff
path: root/TAO/tao/Parser_Registry.h
blob: 91c355f9bf0fafcc9f5b65be0dcd86ce31e0e360 (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
81
82
83
84
85
86
87
88
89
90
// This may look like C, but it's really -*- C++ -*-

//=============================================================================
/**
 *  @file    Parser_Registry.h
 *
 *  @author  Priyanka Gontla <pgontla@uci.edu>
 *  @author  Carlos O'Ryan <coryan@uci.edu>
 */
//=============================================================================


#ifndef TAO_PARSER_REGISTRY_H
#define TAO_PARSER_REGISTRY_H

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

#include /**/ "tao/TAO_Export.h"

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

#include /**/ "tao/Versioned_Namespace.h"

#include "ace/os_include/os_stddef.h"


TAO_BEGIN_VERSIONED_NAMESPACE_DECL

// Forward declarations.
class TAO_ORB_Core;
class TAO_IOR_Parser;

/**
 * @class TAO_Parser_Registry
 *
 * @brief Maintain the collection of known IOR format parsers
 *
 * 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.
 */
class TAO_Export TAO_Parser_Registry
{
public:
  /// Default constructor.
  TAO_Parser_Registry ();

  /// Dstructor.
  ~TAO_Parser_Registry ();

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

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

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

private:

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

private:

  /// List of parsers
  TAO_IOR_Parser **parsers_;

  /// Number of parsers
  size_t size_;

};

TAO_END_VERSIONED_NAMESPACE_DECL

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

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

#endif /* TAO_PARSER_REGISTRY_H */