Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

TAO_Parser_Registry Class Reference

Maintain the collection of known IOR format parsers. More...

#include <Parser_Registry.h>

Collaboration diagram for TAO_Parser_Registry:

Collaboration graph
[legend]
List of all members.

Public Types

typedef TAO_IOR_Parser ** Parser_Iterator

Public Methods

 TAO_Parser_Registry (void)
 Default constructor. More...

 ~TAO_Parser_Registry (void)
 Dstructor. More...

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

TAO_IOR_Parsermatch_parser (const char *ior_string)
 Find the parser that can parse <ior_string> The lookup is based on the prefix in the string. More...

Parser_Iterator begin (void) const
Parser_Iterator end (void) const

Private Methods

 TAO_Parser_Registry (const TAO_Parser_Registry &)
void operator= (const TAO_Parser_Registry &)

Private Attributes

TAO_IOR_Parser ** parsers_
 List of parsers. More...

size_t size_
 Number of parsers. More...


Detailed Description

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.

Definition at line 40 of file Parser_Registry.h.


Member Typedef Documentation

typedef TAO_IOR_Parser** TAO_Parser_Registry::Parser_Iterator
 

Definition at line 59 of file Parser_Registry.h.


Constructor & Destructor Documentation

TAO_Parser_Registry::TAO_Parser_Registry void   
 

Default constructor.

Definition at line 18 of file Parser_Registry.cpp.

00019   : parsers_ (0),
00020     size_ (0)
00021 {
00022 }

TAO_Parser_Registry::~TAO_Parser_Registry void   
 

Dstructor.

Definition at line 24 of file Parser_Registry.cpp.

References parsers_.

00025 {
00026   delete [] this->parsers_;
00027 }

TAO_Parser_Registry::TAO_Parser_Registry const TAO_Parser_Registry &    [private]
 


Member Function Documentation

ACE_INLINE TAO_Parser_Registry::Parser_Iterator TAO_Parser_Registry::begin void    const
 

Definition at line 4 of file Parser_Registry.i.

References parsers_.

Referenced by match_parser.

00005 {
00006   return this->parsers_;
00007 }

ACE_INLINE TAO_Parser_Registry::Parser_Iterator TAO_Parser_Registry::end void    const
 

Definition at line 10 of file Parser_Registry.i.

References parsers_, and size_.

Referenced by match_parser.

00011 {
00012   return this->parsers_ + this->size_;
00013 }

TAO_IOR_Parser * TAO_Parser_Registry::match_parser const char *    ior_string
 

Find the parser that can parse <ior_string> The lookup is based on the prefix in the string.

Definition at line 57 of file Parser_Registry.cpp.

References begin, and end.

Referenced by CORBA_ORB::string_to_object.

00058 {
00059   for (Parser_Iterator i = this->begin (); i != this->end (); ++i)
00060     {
00061       if ((*i)->match_prefix (ior_string))
00062         {
00063           return *i;
00064         }
00065     }
00066   return 0;
00067 }

int TAO_Parser_Registry::open TAO_ORB_Core   orb_core
 

Initialize the parser registry with the list of known protocols. Invoked by the ORB during startup.

Definition at line 30 of file Parser_Registry.cpp.

References TAO_Resource_Factory::get_parser_names, ACE_Dynamic_Service::instance, names, parsers_, TAO_ORB_Core::resource_factory, and size_.

00031 {
00032   char **names;
00033   int number_of_names = 0;
00034 
00035   orb_core->resource_factory ()->get_parser_names (names,
00036                                                    number_of_names);
00037 
00038   if (number_of_names == 0)
00039     return -1;
00040 
00041   this->size_ = number_of_names;
00042   this->parsers_ = new TAO_IOR_Parser*[this->size_];
00043 
00044   for (size_t i = 0; i != this->size_; ++i)
00045     {
00046       this->parsers_[i] =
00047         ACE_Dynamic_Service<TAO_IOR_Parser>::instance (names [i]);
00048 
00049       if (this->parsers_[i] == 0)
00050         return -1;
00051     }
00052 
00053   return 0;
00054 }

void TAO_Parser_Registry::operator= const TAO_Parser_Registry &    [private]
 


Member Data Documentation

TAO_IOR_Parser** TAO_Parser_Registry::parsers_ [private]
 

List of parsers.

Definition at line 70 of file Parser_Registry.h.

Referenced by begin, end, open, and ~TAO_Parser_Registry.

size_t TAO_Parser_Registry::size_ [private]
 

Number of parsers.

Definition at line 73 of file Parser_Registry.h.

Referenced by end, and open.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 15:33:02 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002