TAO_SHMIOP_Protocol_Factory Class Reference

#include <SHMIOP_Factory.h>

Inheritance diagram for TAO_SHMIOP_Protocol_Factory:

Inheritance graph
[legend]
Collaboration diagram for TAO_SHMIOP_Protocol_Factory:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_SHMIOP_Protocol_Factory (void)
 Constructor.
virtual ~TAO_SHMIOP_Protocol_Factory (void)
 Destructor.
virtual int init (int argc, ACE_TCHAR *argv[])
 Dynamic linking hook.
virtual int match_prefix (const ACE_CString &prefix)
 Verify prefix is a match.
virtual const char * prefix (void) const
 Returns the prefix used by the protocol.
virtual char options_delimiter (void) const
void mmap_file_prefix (const ACE_TCHAR *prefix)
 Set mmap file prefix.
const ACE_TCHARmmap_file_prefix (void)
 Get mmap file prefix.
Protocol factory methods
Check Protocol_Factory.h for a description of these methods.

virtual TAO_Acceptormake_acceptor (void)
virtual TAO_Connectormake_connector (void)
virtual int requires_explicit_endpoint (void) const

Private Attributes

ACE_TCHARmmap_prefix_
 Specify the prefix (full path) for mmap files.
ACE_OFF_T min_bytes_
 Minimum bytes of the mmap files.

Detailed Description

Definition at line 36 of file SHMIOP_Factory.h.


Constructor & Destructor Documentation

TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_SHMIOP_Protocol_Factory::TAO_SHMIOP_Protocol_Factory ( void   ) 

Constructor.

Definition at line 24 of file SHMIOP_Factory.cpp.

00025   : TAO_Protocol_Factory (TAO_TAG_SHMEM_PROFILE),
00026     mmap_prefix_ (0),
00027     min_bytes_ (10*1024)        // @@ Nanbor, remove this magic number!!
00028 {
00029 }

TAO_SHMIOP_Protocol_Factory::~TAO_SHMIOP_Protocol_Factory ( void   )  [virtual]

Destructor.

Definition at line 31 of file SHMIOP_Factory.cpp.

References mmap_prefix_.

00032 {
00033   delete [] this->mmap_prefix_;
00034 }


Member Function Documentation

int TAO_SHMIOP_Protocol_Factory::init ( int  argc,
ACE_TCHAR argv[] 
) [virtual]

Dynamic linking hook.

Implements TAO_Protocol_Factory.

Definition at line 71 of file SHMIOP_Factory.cpp.

References ACE_TEXT, ACE_OS::atoi(), ACE_Argv_Type_Converter::get_argc(), ACE_Argv_Type_Converter::get_TCHAR_argv(), min_bytes_, mmap_prefix_, and ACE::strnew().

00073 {
00074   // Copy command line parameter not to use original as well as type conversion.
00075   ACE_Argv_Type_Converter command_line(argc, argv);
00076 
00077   ACE_Arg_Shifter arg_shifter (command_line.get_argc(), command_line.get_TCHAR_argv());
00078 
00079   while (arg_shifter.is_anything_left ())
00080     {
00081       const ACE_TCHAR *current_arg = 0;
00082 
00083       if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-MMAPFileSize"))))
00084         {
00085           this->min_bytes_ = ACE_OS::atoi (current_arg);
00086           arg_shifter.consume_arg ();
00087         }
00088       else if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-MMAPFilePrefix"))))
00089         {
00090           this->mmap_prefix_ = ACE::strnew (current_arg);
00091           arg_shifter.consume_arg ();
00092         }
00093       else
00094         // Any arguments that don't match are ignored so that the
00095         // caller can still use them.
00096         arg_shifter.ignore_arg ();
00097     }
00098 
00099   return 0;
00100 }

TAO_Acceptor * TAO_SHMIOP_Protocol_Factory::make_acceptor ( void   )  [virtual]

Implements TAO_Protocol_Factory.

Definition at line 56 of file SHMIOP_Factory.cpp.

References ACE_NEW_RETURN, and TAO_SHMIOP_Acceptor::set_mmap_options().

00057 {
00058   TAO_SHMIOP_Acceptor *acceptor = 0;
00059 
00060   ACE_NEW_RETURN (acceptor,
00061                   TAO_SHMIOP_Acceptor,
00062                   0);
00063 
00064   acceptor->set_mmap_options (this->mmap_prefix_,
00065                               this->min_bytes_);
00066 
00067   return acceptor;
00068 }

TAO_Connector * TAO_SHMIOP_Protocol_Factory::make_connector ( void   )  [virtual]

Implements TAO_Protocol_Factory.

Definition at line 103 of file SHMIOP_Factory.cpp.

References ACE_NEW_RETURN.

00104 {
00105   TAO_Connector *connector = 0;
00106 
00107   ACE_NEW_RETURN (connector,
00108                   TAO_SHMIOP_Connector,
00109                   0);
00110   return connector;
00111 }

int TAO_SHMIOP_Protocol_Factory::match_prefix ( const ACE_CString prefix  )  [virtual]

Verify prefix is a match.

Implements TAO_Protocol_Factory.

Definition at line 37 of file SHMIOP_Factory.cpp.

References prefix(), prefix_, and ACE_OS::strcasecmp().

00038 {
00039   // Check for the proper prefix for this protocol.
00040   return (ACE_OS::strcasecmp (prefix.c_str (), ::prefix_) == 0);
00041 }

const ACE_TCHAR* TAO_SHMIOP_Protocol_Factory::mmap_file_prefix ( void   ) 

Get mmap file prefix.

void TAO_SHMIOP_Protocol_Factory::mmap_file_prefix ( const ACE_TCHAR prefix  ) 

Set mmap file prefix.

char TAO_SHMIOP_Protocol_Factory::options_delimiter ( void   )  const [virtual]

Return the character used to mark where an endpoint ends and where its options begin.

Implements TAO_Protocol_Factory.

Definition at line 50 of file SHMIOP_Factory.cpp.

00051 {
00052   return '/';
00053 }

const char * TAO_SHMIOP_Protocol_Factory::prefix ( void   )  const [virtual]

Returns the prefix used by the protocol.

Implements TAO_Protocol_Factory.

Definition at line 44 of file SHMIOP_Factory.cpp.

References prefix_.

Referenced by match_prefix().

00045 {
00046   return ::prefix_;
00047 }

int TAO_SHMIOP_Protocol_Factory::requires_explicit_endpoint ( void   )  const [virtual]

Implements TAO_Protocol_Factory.

Definition at line 114 of file SHMIOP_Factory.cpp.

00115 {
00116   return 1;
00117 }


Member Data Documentation

ACE_OFF_T TAO_SHMIOP_Protocol_Factory::min_bytes_ [private]

Minimum bytes of the mmap files.

Definition at line 82 of file SHMIOP_Factory.h.

Referenced by init().

ACE_TCHAR* TAO_SHMIOP_Protocol_Factory::mmap_prefix_ [private]

Specify the prefix (full path) for mmap files.

Definition at line 79 of file SHMIOP_Factory.h.

Referenced by init(), and ~TAO_SHMIOP_Protocol_Factory().


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:47:34 2010 for TAO_Strategies by  doxygen 1.4.7