UIOP_Lite_Factory.cpp

Go to the documentation of this file.
00001 #include "tao/Strategies/UIOP_Lite_Factory.h"
00002 
00003 #if TAO_HAS_UIOP == 1
00004 
00005 #include "tao/Strategies/UIOP_Acceptor.h"
00006 #include "tao/Strategies/UIOP_Connector.h"
00007 
00008 #include "tao/ORB_Constants.h"
00009 
00010 #include "ace/Dynamic_Service.h"
00011 #include "ace/OS_NS_strings.h"
00012 
00013 
00014 ACE_RCSID (Strategies,
00015            UIOP_Lite_Factory,
00016            "UIOP_Lite_Factory.cpp,v 1.6 2006/03/10 07:19:19 jtc Exp")
00017 
00018 
00019 static const char prefix_[] = "uiop";
00020 
00021 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00022 
00023 TAO_UIOP_Lite_Protocol_Factory::TAO_UIOP_Lite_Protocol_Factory (void)
00024   :  TAO_Protocol_Factory (TAO_TAG_UIOP_PROFILE),
00025      major_ (TAO_DEF_GIOP_MAJOR),
00026      minor_ (TAO_DEF_GIOP_MINOR)
00027 {
00028 }
00029 
00030 TAO_UIOP_Lite_Protocol_Factory::~TAO_UIOP_Lite_Protocol_Factory (void)
00031 {
00032 }
00033 
00034 int
00035 TAO_UIOP_Lite_Protocol_Factory::match_prefix (const ACE_CString &prefix)
00036 {
00037   // Check for the proper prefix for this protocol.
00038   return (ACE_OS::strcasecmp (prefix.c_str (), ::prefix_) == 0);
00039 }
00040 
00041 const char *
00042 TAO_UIOP_Lite_Protocol_Factory::prefix (void) const
00043 {
00044   return ::prefix_;
00045 }
00046 
00047 char
00048 TAO_UIOP_Lite_Protocol_Factory::options_delimiter (void) const
00049 {
00050   return '|';
00051 }
00052 
00053 TAO_Acceptor *
00054 TAO_UIOP_Lite_Protocol_Factory::make_acceptor (void)
00055 {
00056   TAO_Acceptor *acceptor = 0;
00057 
00058   // We are Lite factory
00059   CORBA::Boolean lite_factory = 1;
00060   ACE_NEW_RETURN (acceptor,
00061                   TAO_UIOP_Acceptor (lite_factory),
00062                   0);
00063 
00064   return acceptor;
00065 }
00066 
00067 int
00068 TAO_UIOP_Lite_Protocol_Factory::init (int /* argc */,
00069                                       ACE_TCHAR* /* argv */ [])
00070 {
00071   return 0;
00072 }
00073 
00074 TAO_Connector *
00075 TAO_UIOP_Lite_Protocol_Factory::make_connector (void)
00076 {
00077   TAO_Connector *connector = 0;
00078 
00079   // We are a lite factory
00080   CORBA::Boolean lite_factory = 1;
00081   ACE_NEW_RETURN (connector,
00082                   TAO_UIOP_Connector (lite_factory),
00083                   0);
00084 
00085   return connector;
00086 }
00087 
00088 int
00089 TAO_UIOP_Lite_Protocol_Factory::requires_explicit_endpoint (void) const
00090 {
00091   return 1;
00092 }
00093 
00094 TAO_END_VERSIONED_NAMESPACE_DECL
00095 
00096 ACE_STATIC_SVC_DEFINE (TAO_UIOP_Lite_Protocol_Factory,
00097                        ACE_TEXT ("UIOP_Lite_Factory"),
00098                        ACE_SVC_OBJ_T,
00099                        &ACE_SVC_NAME (TAO_UIOP_Lite_Protocol_Factory),
00100                        ACE_Service_Type::DELETE_THIS |
00101                           ACE_Service_Type::DELETE_OBJ,
00102                        0)
00103 
00104 ACE_FACTORY_DEFINE (TAO_Strategies, TAO_UIOP_Lite_Protocol_Factory)
00105 
00106 
00107 #endif  /* TAO_HAS_UIOP == 1 */

Generated on Thu Nov 9 13:39:31 2006 for TAO_Strategies by doxygen 1.3.6