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

DLL_Parser.cpp

Go to the documentation of this file.
00001 #include "tao_pch.h"
00002 // $Id: DLL_Parser.cpp,v 1.1.1.2.2.1 2003/03/14 16:05:12 chad Exp $
00003 
00004 #include "DLL_Parser.h"
00005 #include "Object_Loader.h"
00006 #include "tao/Object.h"
00007 #include "tao/Exception.h"
00008 #include "tao/Environment.h"
00009 #include "ace/Dynamic_Service.h"
00010 
00011 #if !defined(__ACE_INLINE__)
00012 #include "DLL_Parser.i"
00013 #endif /* __ACE_INLINE__ */
00014 
00015 ACE_RCSID(tao, DLL_Parser, "$Id: DLL_Parser.cpp,v 1.1.1.2.2.1 2003/03/14 16:05:12 chad Exp $")
00016 
00017 TAO_DLL_Parser::~TAO_DLL_Parser (void)
00018 {
00019 }
00020 
00021 static const char dll_prefix[] = "DLL:";
00022 
00023 int
00024 TAO_DLL_Parser::match_prefix (const char *ior_string) const
00025 {
00026   return (ACE_OS::strncmp (ior_string,
00027                            ::dll_prefix,
00028                            sizeof (::dll_prefix) - 1) == 0);
00029 }
00030 
00031 CORBA::Object_ptr
00032 TAO_DLL_Parser::parse_string (const char *ior,
00033                               CORBA::ORB_ptr orb
00034                               ACE_ENV_ARG_DECL)
00035   ACE_THROW_SPEC ((CORBA::SystemException))
00036 {
00037   // Skip the prefix, we know it is there because this method in only
00038   // called if <match_prefix> returns 1.
00039   const char *name =
00040     ior + sizeof (::dll_prefix) - 1;
00041 
00042   TAO_Object_Loader *loader =
00043     ACE_Dynamic_Service<TAO_Object_Loader>::instance (name);
00044 
00045   if (loader == 0)
00046     {
00047       ACE_THROW_RETURN
00048         (CORBA::INV_OBJREF
00049          (CORBA_SystemException::_tao_minor_code (
00050             TAO_DEFAULT_MINOR_CODE,
00051             EINVAL),
00052           CORBA::COMPLETED_NO),
00053          CORBA::Object::_nil ());
00054     }
00055 
00056   return loader->create_object (orb, 0, 0 ACE_ENV_ARG_PARAMETER);
00057 }
00058 
00059 ACE_STATIC_SVC_DEFINE (TAO_DLL_Parser,
00060                        ACE_TEXT ("DLL_Parser"),
00061                        ACE_SVC_OBJ_T,
00062                        &ACE_SVC_NAME (TAO_DLL_Parser),
00063                        ACE_Service_Type::DELETE_THIS |
00064                                   ACE_Service_Type::DELETE_OBJ,
00065                        0)
00066 
00067 
00068 ACE_FACTORY_DEFINE (TAO, TAO_DLL_Parser)
00069 
00070 #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
00071 
00072 #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
00073 
00074 #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */

Generated on Mon Jun 16 13:48:14 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002