Parser_Registry.h

Go to the documentation of this file.
00001 // This may look like C, but it's really -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    Parser_Registry.h
00006  *
00007  *  Parser_Registry.h,v 1.9 2005/11/02 11:03:26 ossama Exp
00008  *
00009  *  @author  Priyanka Gontla <pgontla@uci.edu>
00010  *  @author  Carlos O'Ryan <coryan@uci.edu>
00011  */
00012 //=============================================================================
00013 
00014 
00015 #ifndef TAO_PARSER_REGISTRY_H
00016 #define TAO_PARSER_REGISTRY_H
00017 
00018 #include /**/ "ace/pre.h"
00019 
00020 #include "tao/TAO_Export.h"
00021 
00022 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00023 # pragma once
00024 #endif /* ACE_LACKS_PRAGMA_ONCE */
00025 
00026 #include "tao/Versioned_Namespace.h"
00027 
00028 #include "ace/os_include/os_stddef.h"
00029 
00030 
00031 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00032 
00033 // Forward declarations.
00034 class TAO_ORB_Core;
00035 class TAO_IOR_Parser;
00036 
00037 /**
00038  * @class TAO_Parser_Registry
00039  *
00040  * @brief Maintain the collection of known IOR format parsers
00041  *
00042  * The ORB dynamically loads a collection of IOR parsers (check
00043  * the IOR_Parser class).  The collection is kept in this class
00044  * for easy lookup and use.
00045  */
00046 class TAO_Export TAO_Parser_Registry
00047 {
00048 public:
00049   // = Initialization and termination methods.
00050   /// Default constructor.
00051   TAO_Parser_Registry (void);
00052 
00053   /// Dstructor.
00054   ~TAO_Parser_Registry (void);
00055 
00056   /// Initialize the parser registry with the list of known protocols.
00057   /// Invoked by the ORB during startup.
00058   int open (TAO_ORB_Core *orb_core);
00059 
00060   /// Find the parser that can parse @a ior_string
00061   /// The lookup is based on the prefix in the string
00062   TAO_IOR_Parser *match_parser (const char *ior_string);
00063 
00064   // = Iterator.
00065   typedef TAO_IOR_Parser** Parser_Iterator;
00066   Parser_Iterator begin (void) const;
00067   Parser_Iterator end (void) const;
00068 
00069 private:
00070 
00071   // The parser registry should not be copied.
00072   TAO_Parser_Registry (const TAO_Parser_Registry&);
00073   void operator= (const TAO_Parser_Registry&);
00074 
00075 private:
00076 
00077   /// List of parsers
00078   TAO_IOR_Parser **parsers_;
00079 
00080   /// Number of parsers
00081   size_t size_;
00082 
00083 };
00084 
00085 TAO_END_VERSIONED_NAMESPACE_DECL
00086 
00087 #if defined(__ACE_INLINE__)
00088 #include "tao/Parser_Registry.i"
00089 #endif /* __ACE_INLINE__ */
00090 
00091 #include /**/ "ace/post.h"
00092 
00093 #endif /* TAO_PARSER_REGISTRY_H */

Generated on Thu Nov 9 11:54:19 2006 for TAO by doxygen 1.3.6