#include <SHMIOP_Factory.h>
Inheritance diagram for TAO_SHMIOP_Protocol_Factory:
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_TCHAR * | mmap_file_prefix (void) |
Get mmap file prefix. | |
Protocol factory methods | |
virtual TAO_Acceptor * | make_acceptor (void) |
virtual TAO_Connector * | make_connector (void) |
virtual int | requires_explicit_endpoint (void) const |
Private Attributes | |
ACE_TCHAR * | mmap_prefix_ |
Specify the prefix (full path) for mmap files. | |
ACE_OFF_T | min_bytes_ |
Minimum bytes of the mmap files. |
|
Constructor.
Definition at line 24 of file SHMIOP_Factory.cpp. References TAO_TAG_SHMEM_PROFILE.
00025 : TAO_Protocol_Factory (TAO_TAG_SHMEM_PROFILE), 00026 mmap_prefix_ (0), 00027 min_bytes_ (10*1024) // @@ Nanbor, remove this magic number!! 00028 { 00029 } |
|
Destructor.
Definition at line 31 of file SHMIOP_Factory.cpp.
00032 { 00033 delete [] this->mmap_prefix_; 00034 } |
|
Dynamic linking hook.
Implements TAO_Protocol_Factory. Definition at line 71 of file SHMIOP_Factory.cpp. References ACE_Arg_Shifter, ACE_TCHAR, ACE_TEXT, ACE_OS::atoi(), ACE_Argv_Type_Converter::get_argc(), ACE_Argv_Type_Converter::get_TCHAR_argv(), min_bytes_, 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 } |
|
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 } |
|
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 } |
|
Verify prefix is a match.
Implements TAO_Protocol_Factory. Definition at line 37 of file SHMIOP_Factory.cpp. References ACE_OS::strcasecmp().
00038 { 00039 // Check for the proper prefix for this protocol. 00040 return (ACE_OS::strcasecmp (prefix.c_str (), ::prefix_) == 0); 00041 } |
|
Get mmap file prefix.
|
|
Set mmap file prefix.
|
|
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 } |
|
Returns the prefix used by the protocol.
Implements TAO_Protocol_Factory. Definition at line 44 of file SHMIOP_Factory.cpp.
00045 { 00046 return ::prefix_; 00047 } |
|
Implements TAO_Protocol_Factory. Definition at line 114 of file SHMIOP_Factory.cpp.
00115 {
00116 return 1;
00117 }
|
|
Minimum bytes of the mmap files.
Definition at line 82 of file SHMIOP_Factory.h. Referenced by init(). |
|
Specify the prefix (full path) for mmap files.
Definition at line 79 of file SHMIOP_Factory.h. |