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

TAO_ORB_Parameters Class Reference

Parameters that are specific to the ORB. These parameters can be for the client, the server, or for both. = NOTE Some of the functions have inline definitions in the class header below. Please do not move them back to the .i file. cygnus-2.7.2-960126, distributed with Tornado 1.0.1, can't deal with returing a const reference here. It raises an internal compiler error at ace/Svc_Handler.cpp:46, of all places. More...

#include <params.h>

Collaboration diagram for TAO_ORB_Parameters:

Collaboration graph
[legend]
List of all members.

Public Methods

 TAO_ORB_Parameters (void)
 Constructor. More...

 ~TAO_ORB_Parameters (void)
 Destructor. More...

int endpoints (ACE_CString &endpoints)
 Specifies the endpoints on which this server is willing to listen for requests. More...

TAO_EndpointSetendpoints (void)
void add_endpoint (ACE_CString &endpoint)
CORBA::UShort service_port (TAO_MCAST_SERVICEID service_id) const
 Set/Get the port of services locatable through multicast. More...

void service_port (TAO_MCAST_SERVICEID service_id, CORBA::UShort port)
const char * mcast_discovery_endpoint (void) const
 Get/Set address:port for Multicast Discovery Protocol for the Naming Service. More...

void mcast_discovery_endpoint (const char *mde)
int sock_rcvbuf_size (void) const
 Set/Get the size to be used for a socket's receive buffer. More...

void sock_rcvbuf_size (int)
int sock_sndbuf_size (void) const
 Set/Get the size to be used for a socket's send buffer. More...

void sock_sndbuf_size (int)
int nodelay (void) const
 Set/Get the status of whether to use TCP_NODELAY or not. More...

void nodelay (int)
int cdr_memcpy_tradeoff (void) const
void cdr_memcpy_tradeoff (int)
int use_dotted_decimal_addresses (void) const
 The ORB will use the dotted decimal notation for addresses. By default we use the full ascii names. More...

void use_dotted_decimal_addresses (int)
char * default_init_ref (void) const
 Set/Get the Init Reference of an arbitrary ObjectID. More...

void default_init_ref (const char *default_init_ref)
int std_profile_components (void) const
 Disable the OMG standard profile components, useful for homogenous environments. More...

void std_profile_components (int x)
int ace_sched_policy (void) const
 Scheduling policy. More...

void ace_sched_policy (int x)
long sched_policy (void) const
 Scheduling policy flag. More...

void sched_policy (long x)
long scope_policy (void) const
 Scheduling scope flag. More...

void scope_policy (long x)
long thread_creation_flags (void) const
 Thread creation flags. More...

int single_read_optimization (void) const
 Single read optimization. More...

void single_read_optimization (int x)
int shared_profile (void) const
void shared_profile (int x)

Private Methods

int parse_endpoints (ACE_CString &endpoints, TAO_EndpointSet &endpoints_list)

Private Attributes

TAO_EndpointSet endpoints_list_
 List of endpoints this server is willing to accept requests on. More...

CORBA::UShort service_port_ [TAO_NO_OF_MCAST_SERVICES]
 Port numbers of the configured services. More...

CORBA::String_var mcast_discovery_endpoint_
 address:port for Multicast Discovery Protocol for the Naming Service. More...

ACE_CString default_init_ref_
 List of comma separated prefixes from ORBDefaultInitRef. More...

int sock_rcvbuf_size_
 Size to be used for a socket's receive buffer. More...

int sock_sndbuf_size_
 Size to be used for a socket's send buffer. More...

int nodelay_
 1 if we're using TCP_NODELAY and 0 otherwise. More...

int cdr_memcpy_tradeoff_
 Control the strategy for copying vs. appeding octet sequences in CDR streams. More...

int use_lite_protocol_
 For selecting a liteweight version of the GIOP protocol. More...

int use_dotted_decimal_addresses_
 For selecting a address notation. More...

int std_profile_components_
 If true then the standard OMG components are not generated. More...

int ace_sched_policy_
 Scheduling policy. More...

long sched_policy_
 Scheduling policy flag. More...

long scope_policy_
 Scheduling scope flag. More...

int single_read_optimization_
 Single read optimization. More...

int shared_profile_
 Shared Profile - Use the same profile for multiple endpoints. More...


Detailed Description

Parameters that are specific to the ORB. These parameters can be for the client, the server, or for both. = NOTE Some of the functions have inline definitions in the class header below. Please do not move them back to the .i file. cygnus-2.7.2-960126, distributed with Tornado 1.0.1, can't deal with returing a const reference here. It raises an internal compiler error at ace/Svc_Handler.cpp:46, of all places.

Definition at line 69 of file params.h.


Constructor & Destructor Documentation

TAO_ORB_Parameters::TAO_ORB_Parameters void   
 

Constructor.

Definition at line 15 of file params.cpp.

References ACE_DEFAULT_CDR_MEMCPY_TRADEOFF, ACE_DEFAULT_MAX_SOCKET_BUFSIZ, ACE_SCHED_OTHER, service_port_, and TAO_NO_OF_MCAST_SERVICES.

00016   : endpoints_list_ (),
00017     mcast_discovery_endpoint_ (),
00018     default_init_ref_ ("mcast://:::"),
00019     sock_rcvbuf_size_ (ACE_DEFAULT_MAX_SOCKET_BUFSIZ),
00020     sock_sndbuf_size_ (ACE_DEFAULT_MAX_SOCKET_BUFSIZ),
00021     nodelay_ (1),
00022     cdr_memcpy_tradeoff_ (ACE_DEFAULT_CDR_MEMCPY_TRADEOFF),
00023     use_lite_protocol_ (0),
00024     use_dotted_decimal_addresses_ (0),
00025     std_profile_components_ (1),
00026     ace_sched_policy_ (ACE_SCHED_OTHER),
00027     sched_policy_ (THR_SCHED_DEFAULT),
00028     scope_policy_ (THR_SCOPE_PROCESS),
00029     single_read_optimization_ (1),
00030     shared_profile_ (1)
00031 {
00032   for (int i = 0; i <= TAO_NO_OF_MCAST_SERVICES; ++i)
00033     this->service_port_[i] = 0;
00034 }

TAO_ORB_Parameters::~TAO_ORB_Parameters void   
 

Destructor.

Definition at line 36 of file params.cpp.

00037 {
00038 }


Member Function Documentation

ACE_INLINE void TAO_ORB_Parameters::ace_sched_policy int    x
 

Definition at line 157 of file params.i.

References ace_sched_policy_.

00158 {
00159   this->ace_sched_policy_ = x;
00160 }

ACE_INLINE int TAO_ORB_Parameters::ace_sched_policy void    const
 

Scheduling policy.

Scheduling policy specified by the user through the -ORBSchedPolicy option. This value is typically used by functions like ACE_OS::thr_setprio() and ACE_Sched_Params::priority_min(). Legal values are ACE_SCHED_RR, ACE_SCHED_FIFO, and ACE_SCHED_OTHER.

Definition at line 151 of file params.i.

References ace_sched_policy_.

00152 {
00153   return this->ace_sched_policy_;
00154 }

ACE_INLINE void TAO_ORB_Parameters::add_endpoint ACE_CString   endpoint
 

Definition at line 16 of file params.i.

References ACE_CString, endpoints, and ACE_Unbounded_Queue< ACE_CString >::enqueue_tail.

00017 {
00018   this->endpoints ().enqueue_tail (endpoint);
00019 }

ACE_INLINE void TAO_ORB_Parameters::cdr_memcpy_tradeoff int   
 

Definition at line 56 of file params.i.

References cdr_memcpy_tradeoff_.

00057 {
00058   this->cdr_memcpy_tradeoff_ = x;
00059 }

ACE_INLINE int TAO_ORB_Parameters::cdr_memcpy_tradeoff void    const
 

Octet sequences are marshalled without doing any copies, we simply append a block to the CDR message block chain. When the octet sequence is small enough and there is room in the current message block it is more efficient just to copy the buffer.

Definition at line 50 of file params.i.

References cdr_memcpy_tradeoff_.

Referenced by TAO_IIOP_Profile::create_tagged_profile, TAO_IIOP_Profile::encode, CORBA_ORB::object_to_string, and TAO_ServerRequest::tao_send_reply_exception.

00051 {
00052   return this->cdr_memcpy_tradeoff_;
00053 }

ACE_INLINE void TAO_ORB_Parameters::default_init_ref const char *    default_init_ref
 

Definition at line 115 of file params.i.

References default_init_ref, and default_init_ref_.

00116 {
00117   this->default_init_ref_ = default_init_ref;
00118 }

ACE_INLINE char * TAO_ORB_Parameters::default_init_ref void    const
 

Set/Get the Init Reference of an arbitrary ObjectID.

Definition at line 121 of file params.i.

References CORBA::string_dup.

Referenced by default_init_ref, and TAO_ORB_Core::resolve_rir.

00122 {
00123   return CORBA::string_dup (this->default_init_ref_.c_str ());
00124 }

ACE_INLINE TAO_EndpointSet & TAO_ORB_Parameters::endpoints void   
 

Definition at line 4 of file params.i.

References endpoints_list_.

Referenced by add_endpoint.

00005 {
00006   return this->endpoints_list_;
00007 }

ACE_INLINE int TAO_ORB_Parameters::endpoints ACE_CString   endpoints
 

Specifies the endpoints on which this server is willing to listen for requests.

Definition at line 10 of file params.i.

References ACE_CString, endpoints, and parse_endpoints.

Referenced by endpoints, parse_endpoints, and TAO_ORB_Core::set_endpoint_helper.

00011 {
00012   return this->parse_endpoints (endpoints, this->endpoints ());
00013 }

ACE_INLINE void TAO_ORB_Parameters::mcast_discovery_endpoint const char *    mde
 

Definition at line 103 of file params.i.

References mcast_discovery_endpoint_, and CORBA::string_dup.

00104 {
00105   this->mcast_discovery_endpoint_ = CORBA::string_dup (mde);
00106 }

ACE_INLINE const char * TAO_ORB_Parameters::mcast_discovery_endpoint void    const
 

Get/Set address:port for Multicast Discovery Protocol for the Naming Service.

Definition at line 109 of file params.i.

References mcast_discovery_endpoint_.

00110 {
00111   return this->mcast_discovery_endpoint_.in ();
00112 }

ACE_INLINE void TAO_ORB_Parameters::nodelay int   
 

Definition at line 145 of file params.i.

References nodelay_.

00146 {
00147   this->nodelay_ = x;
00148 }

ACE_INLINE int TAO_ORB_Parameters::nodelay void    const
 

Set/Get the status of whether to use TCP_NODELAY or not.

Definition at line 139 of file params.i.

References nodelay_.

Referenced by TAO_IIOP_Connector::init_tcp_properties, and TAO_IIOP_Acceptor::init_tcp_properties.

00140 {
00141   return this->nodelay_;
00142 }

int TAO_ORB_Parameters::parse_endpoints ACE_CString   endpoints,
TAO_EndpointSet   endpoints_list
[private]
 

Definition at line 41 of file params.cpp.

References ACE_CString, endpoints, and ACE_Unbounded_Queue< ACE_CString >::enqueue_tail.

Referenced by endpoints.

00043 {
00044   // Parse the string into seperate endpoints, where `endpoints' is of
00045   // the form:
00046   //
00047   //    protocol1://V,v@addr1,...,addrN;protocol2://addr1,...,W.w@addrN;...
00048   //
00049   // A single endpoint, instead of several, can be added just as well.
00050 
00051   int status = 0;
00052   // Return code:  0 = success,  -1 = failure
00053 
00054   const char endpoints_delimiter = ';';
00055 
00056   size_t length = endpoints.length ();
00057 
00058   if (endpoints[0] == endpoints_delimiter ||
00059       endpoints[length - 1] == endpoints_delimiter)
00060     {
00061       return -1;
00062       // Failure: endpoints string has an empty endpoint at the
00063       // beginning or the end of the string
00064       // (e.g. ";uiop://foo;iiop://1.3@bar")
00065     }
00066 
00067   if (length > 0)
00068     {
00069       int endpoints_count = 1;
00070 
00071       for (size_t j = 0; j != length; ++j)
00072         {
00073           if (endpoints[j] == endpoints_delimiter)
00074             endpoints_count++;
00075         }
00076 
00077       int begin = 0;
00078       int end = endpoints.find (endpoints_delimiter);
00079 
00080       for (int i = 0; i < endpoints_count; ++i)
00081         {
00082           if (end == 0)
00083             {
00084               // Handle case where two consecutive endpoints `;;'
00085               // delimiters are found within the endpoints set.
00086               //
00087               // Is it enough to just skip over it or should we return an
00088               // error?
00089               continue;
00090             }
00091 
00092           ACE_CString endpt = endpoints.substring (begin, end);
00093           // The substring call will work even if `end' is equal to
00094           // ACE_CString::npos since that will just extract the substring
00095           // from the offset `begin' to the end of the string.
00096 
00097           // Check for a valid URL style endpoint set
00098           int check_offset = endpt.find ("://");
00099 
00100           if (check_offset > 0 &&
00101               check_offset != endpt.npos)
00102             {
00103               endpoints_list.enqueue_tail (endpt);
00104               // Insert endpoint into list
00105             }
00106           else
00107             status = -1;  // Error: invalid URL style endpoint set
00108 
00109           begin += end + 1;
00110           end = endpoints.find (endpoints_delimiter, begin);
00111         }
00112     }
00113   else
00114     {
00115       status = -1;
00116       // Failure:  Empty string
00117     }
00118 
00119   return status;
00120 }

ACE_INLINE void TAO_ORB_Parameters::sched_policy long    x
 

Definition at line 169 of file params.i.

References sched_policy_.

00170 {
00171   this->sched_policy_ = x;
00172 }

ACE_INLINE long TAO_ORB_Parameters::sched_policy void    const
 

Scheduling policy flag.

Scheduling policy specified by the user through the -ORBSchedPolicy option. This value is typically used by ACE thread creation functions. Legal values are THR_SCHED_RR, THR_SCHED_FIFO, and THR_SCHED_DEFAULT.

Definition at line 163 of file params.i.

References sched_policy_.

Referenced by thread_creation_flags.

00164 {
00165   return this->sched_policy_;
00166 }

ACE_INLINE void TAO_ORB_Parameters::scope_policy long    x
 

Definition at line 181 of file params.i.

References scope_policy_.

00182 {
00183   this->scope_policy_ = x;
00184 }

ACE_INLINE long TAO_ORB_Parameters::scope_policy void    const
 

Scheduling scope flag.

Scheduling policy specified by the user through the -ORBScopePolicy option. This value is typically used by ACE thread creation functions. Legal values are THR_SCOPE_SYSTEM and THR_SCOPE_PROCESS.

Definition at line 175 of file params.i.

References scope_policy_.

Referenced by thread_creation_flags.

00176 {
00177   return this->scope_policy_;
00178 }

ACE_INLINE void TAO_ORB_Parameters::service_port TAO_MCAST_SERVICEID    service_id,
CORBA::UShort    port
 

Definition at line 90 of file params.i.

References service_port_, and TAO_MCAST_SERVICEID.

00092 {
00093   this->service_port_[service_id] = port;
00094 }

ACE_INLINE CORBA::UShort TAO_ORB_Parameters::service_port TAO_MCAST_SERVICEID    service_id const
 

Set/Get the port of services locatable through multicast.

Definition at line 97 of file params.i.

References service_port_, and TAO_MCAST_SERVICEID.

00098 {
00099   return this->service_port_[service_id];
00100 }

ACE_INLINE void TAO_ORB_Parameters::shared_profile int    x
 

Definition at line 213 of file params.i.

References shared_profile_.

00214 {
00215   this->shared_profile_ = x;
00216 }

ACE_INLINE int TAO_ORB_Parameters::shared_profile void    const
 

Definition at line 207 of file params.i.

References shared_profile_.

00208 {
00209   return this->shared_profile_;
00210 }

ACE_INLINE void TAO_ORB_Parameters::single_read_optimization int    x
 

Definition at line 201 of file params.i.

References single_read_optimization_.

00202 {
00203   this->single_read_optimization_ = x;
00204 }

ACE_INLINE int TAO_ORB_Parameters::single_read_optimization void    const
 

Single read optimization.

Definition at line 195 of file params.i.

References single_read_optimization_.

Referenced by TAO_Transport::handle_input_i.

00196 {
00197   return this->single_read_optimization_;
00198 }

ACE_INLINE void TAO_ORB_Parameters::sock_rcvbuf_size int   
 

Definition at line 28 of file params.i.

References ACE_DEFAULT_MAX_SOCKET_BUFSIZ, and sock_rcvbuf_size_.

00029 {
00030   sock_rcvbuf_size_ = s <= ACE_DEFAULT_MAX_SOCKET_BUFSIZ
00031     ? s
00032     : ACE_DEFAULT_MAX_SOCKET_BUFSIZ;
00033 }

ACE_INLINE int TAO_ORB_Parameters::sock_rcvbuf_size void    const
 

Set/Get the size to be used for a socket's receive buffer.

Definition at line 22 of file params.i.

References sock_rcvbuf_size_.

Referenced by TAO_IIOP_Connector::init_tcp_properties, and TAO_IIOP_Acceptor::init_tcp_properties.

00023 {
00024   return sock_rcvbuf_size_;
00025 }

ACE_INLINE void TAO_ORB_Parameters::sock_sndbuf_size int   
 

Definition at line 42 of file params.i.

References ACE_DEFAULT_MAX_SOCKET_BUFSIZ, and sock_sndbuf_size_.

00043 {
00044   sock_sndbuf_size_ = s <= ACE_DEFAULT_MAX_SOCKET_BUFSIZ
00045     ? s
00046     : ACE_DEFAULT_MAX_SOCKET_BUFSIZ;
00047 }

ACE_INLINE int TAO_ORB_Parameters::sock_sndbuf_size void    const
 

Set/Get the size to be used for a socket's send buffer.

Definition at line 36 of file params.i.

References sock_sndbuf_size_.

Referenced by TAO_IIOP_Connector::init_tcp_properties, and TAO_IIOP_Acceptor::init_tcp_properties.

00037 {
00038   return sock_sndbuf_size_;
00039 }

ACE_INLINE void TAO_ORB_Parameters::std_profile_components int    x
 

Definition at line 133 of file params.i.

References std_profile_components_.

00134 {
00135   this->std_profile_components_ = x;
00136 }

ACE_INLINE int TAO_ORB_Parameters::std_profile_components void    const
 

Disable the OMG standard profile components, useful for homogenous environments.

Definition at line 127 of file params.i.

References std_profile_components_.

Referenced by TAO_IIOP_Acceptor::create_new_profile, TAO_IIOP_Acceptor::create_shared_profile, and TAO_Profile::verify_orb_configuration.

00128 {
00129   return this->std_profile_components_;
00130 }

ACE_INLINE long TAO_ORB_Parameters::thread_creation_flags void    const
 

Thread creation flags.

Shorthand for OR'ing together the scope_policy and sched_policy.

Definition at line 187 of file params.i.

References sched_policy, and scope_policy.

00188 {
00189   return
00190     this->scope_policy () |
00191     this->sched_policy ();
00192 }

ACE_INLINE void TAO_ORB_Parameters::use_dotted_decimal_addresses int   
 

Definition at line 83 of file params.i.

References use_dotted_decimal_addresses_.

00084 {
00085   this->use_dotted_decimal_addresses_ = x;
00086 }

ACE_INLINE int TAO_ORB_Parameters::use_dotted_decimal_addresses void    const
 

The ORB will use the dotted decimal notation for addresses. By default we use the full ascii names.

Definition at line 77 of file params.i.

References use_dotted_decimal_addresses_.

Referenced by TAO_IIOP_Acceptor::hostname.

00078 {
00079   return this->use_dotted_decimal_addresses_;
00080 }


Member Data Documentation

int TAO_ORB_Parameters::ace_sched_policy_ [private]
 

Scheduling policy.

Scheduling policy specified by the user through the -ORBSchedPolicy option. This value is typically used by functions like ACE_OS::thr_setprio() and ACE_Sched_Params::priority_min(). Legal values are ACE_SCHED_RR, ACE_SCHED_FIFO, and ACE_SCHED_OTHER.

Definition at line 252 of file params.h.

Referenced by ace_sched_policy.

int TAO_ORB_Parameters::cdr_memcpy_tradeoff_ [private]
 

Control the strategy for copying vs. appeding octet sequences in CDR streams.

Definition at line 233 of file params.h.

Referenced by cdr_memcpy_tradeoff.

ACE_CString TAO_ORB_Parameters::default_init_ref_ [private]
 

List of comma separated prefixes from ORBDefaultInitRef.

Definition at line 220 of file params.h.

Referenced by default_init_ref.

TAO_EndpointSet TAO_ORB_Parameters::endpoints_list_ [private]
 

List of endpoints this server is willing to accept requests on.

Definition at line 210 of file params.h.

Referenced by endpoints.

CORBA::String_var TAO_ORB_Parameters::mcast_discovery_endpoint_ [private]
 

address:port for Multicast Discovery Protocol for the Naming Service.

Definition at line 217 of file params.h.

Referenced by mcast_discovery_endpoint.

int TAO_ORB_Parameters::nodelay_ [private]
 

1 if we're using TCP_NODELAY and 0 otherwise.

Definition at line 229 of file params.h.

Referenced by nodelay.

long TAO_ORB_Parameters::sched_policy_ [private]
 

Scheduling policy flag.

Scheduling policy specified by the user through the -ORBSchedPolicy option. This value is typically used by ACE thread creation functions. Legal values are THR_SCHED_RR, THR_SCHED_FIFO, and THR_SCHED_DEFAULT.

Definition at line 261 of file params.h.

Referenced by sched_policy.

long TAO_ORB_Parameters::scope_policy_ [private]
 

Scheduling scope flag.

Scheduling policy specified by the user through the -ORBScopePolicy option. This value is typically used by ACE thread creation functions. Legal values are THR_SCOPE_SYSTEM and THR_SCOPE_PROCESS.

Definition at line 270 of file params.h.

Referenced by scope_policy.

CORBA::UShort TAO_ORB_Parameters::service_port_[TAO_NO_OF_MCAST_SERVICES] [private]
 

Port numbers of the configured services.

Definition at line 213 of file params.h.

Referenced by service_port, and TAO_ORB_Parameters.

int TAO_ORB_Parameters::shared_profile_ [private]
 

Shared Profile - Use the same profile for multiple endpoints.

Definition at line 276 of file params.h.

Referenced by shared_profile.

int TAO_ORB_Parameters::single_read_optimization_ [private]
 

Single read optimization.

Definition at line 273 of file params.h.

Referenced by single_read_optimization.

int TAO_ORB_Parameters::sock_rcvbuf_size_ [private]
 

Size to be used for a socket's receive buffer.

Definition at line 223 of file params.h.

Referenced by sock_rcvbuf_size.

int TAO_ORB_Parameters::sock_sndbuf_size_ [private]
 

Size to be used for a socket's send buffer.

Definition at line 226 of file params.h.

Referenced by sock_sndbuf_size.

int TAO_ORB_Parameters::std_profile_components_ [private]
 

If true then the standard OMG components are not generated.

Definition at line 242 of file params.h.

Referenced by std_profile_components.

int TAO_ORB_Parameters::use_dotted_decimal_addresses_ [private]
 

For selecting a address notation.

Definition at line 239 of file params.h.

Referenced by use_dotted_decimal_addresses.

int TAO_ORB_Parameters::use_lite_protocol_ [private]
 

For selecting a liteweight version of the GIOP protocol.

Definition at line 236 of file params.h.


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