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

Options Class Reference

Maintains the global options. More...

#include <Options.h>

Collaboration diagram for Options:

Collaboration graph
[legend]
List of all members.

Public Methods

 Options ()
 Default Constructor. More...

 ~Options ()
 Destructor. More...

int init (int argc, char *argv[])
 Parse the command-line arguments and initialize the options. More...

int service (void) const
 Service Mode. More...

unsigned int debug (void) const
 Debug level for the Implementation Repository. More...

FILE * output_file (void) const
 Returns the file where the IOR should be stored. More...

Repository_Configurationconfig (void) const
 Returns the configuration object. More...

char * repository_mode (void)
char * file_name (void) const
 Returns the file addr. More...

const char * convert_str (ImplementationRepository::ActivationMode mode)
 Converts the activation mode to a const char *. Needed to put the activation mode into the XML file or print it out. More...

ImplementationRepository::ActivationMode convert_mode (const char *mode)
const ACE_Time_Valuestartup_timeout (void) const
 Returns the timeout value for program starting. More...

const ACE_Time_Valueping_interval (void) const
 Returns the timeout value for program starting. More...

CORBA::ORB_ptr orb (void) const
 Returns a pointer to the ORB. More...

int multicast (void) const
 Will we listen for multicast location requests? More...

int readonly (void) const
 Do we allow modifications to the servers? More...


Private Methods

int parse_args (int &argc, char *argv[])
 Parses and pulls out arguments for the ImR. More...

void print_usage (void) const
 Print the usage information. More...

int initialize_file_persistence (const char *filename)
 Initialize file persistence. More...

int initialize_registry_persistence (void)
 Initialize Registry persistence. More...

int initialize_non_persistence (void)
 Initialize default heap for no persistence. More...

int initialize_xml_persistence (const char *file_name)
 Initialize XML file persistence. More...

int run_service_command (const char *command)
 Run a service command. More...

int load_registry_options (ACE_ARGV &orb_options)
 Loads ORB options from the registry. More...


Private Attributes

Repository_Configurationrepo_config_
 The persistent configuration object. More...

char repo_mode_
 Mode of the Server Repository: if XML (x) or non-XML (n). More...

char * file_name_
 The persistent file option. More...

unsigned int debug_
 Debug level. More...

FILE * ior_output_file_
 File where the IOR of the server object is stored. More...

int multicast_
 Will we listen for multicast location requests? More...

CORBA::ORB_var orb_
 The ORB for the Implementation Repository. More...

ACE_Time_Value ping_interval_
 The amount of time between successive "are you started yet?" pings. More...

int service_
 Are we running as a service? More...

ACE_Time_Value startup_timeout_
 The amount of time to wait for a server to response after starting it. More...

int readonly_
 Can the server_repository be modified? More...


Detailed Description

Maintains the global options.

This is where all the settings for TAO's Implementation Repository is stored.


Constructor & Destructor Documentation

Options::Options  
 

Default Constructor.

Assigns default values to all the member variables.

Options::~Options  
 

Destructor.

Just deletes this->repo_config_.


Member Function Documentation

Repository_Configuration * Options::config void    const
 

Returns the configuration object.

Returns:
The ACE_Configuration object that is used to store data.

ImplementationRepository::ActivationMode Options::convert_mode const char *    mode
 

const char * Options::convert_str ImplementationRepository::ActivationMode    mode
 

Converts the activation mode to a const char *. Needed to put the activation mode into the XML file or print it out.

unsigned int Options::debug void    const
 

Debug level for the Implementation Repository.

Return values:
0  Quiet
1  Trace messages
2  Detailed messages

char * Options::file_name void    const
 

Returns the file addr.

int Options::init int    argc,
char *    argv[]
 

Parse the command-line arguments and initialize the options.

Return values:
0  Success
-1  Error parsing args
1  Success but we should exit.

int Options::initialize_file_persistence const char *    filename [private]
 

Initialize file persistence.

Here we assign an ACE_Configuration_Heap object using

Parameters:
filename  as the file.
Return values:
0  Success
-1  Failure

int Options::initialize_non_persistence void    [private]
 

Initialize default heap for no persistence.

Initializes this->repo_config_ to an opened ACE_Configuration_Heap.

Return values:
0  Success
-1  Failure

int Options::initialize_registry_persistence void    [private]
 

Initialize Registry persistence.

Assigns a ACE_Configuration_Win32Registry to this->repo_config_. On non-Win32 systems, just returns an error.

Todo:
Where in the registry should this be stored?
Return values:
0  Success
-1  Failure

int Options::initialize_xml_persistence const char *    file_name [private]
 

Initialize XML file persistence.

int Options::load_registry_options ACE_ARGV   orb_options [private]
 

Loads ORB options from the registry.

The location we store options in is HKEY_LOCAL_MACHINE: SYSTEM\CurrentControlSet\Services\TAOImplRepo\Parameters

The only key currently supported is ORBOptions

Todo:
Is there a better way to handle the hKey? (as in a auto_ptr)

int Options::multicast void    const
 

Will we listen for multicast location requests?

Return values:
0  Do not listen for multicast location requests.
1  Do Listen.

CORBA::ORB_ptr Options::orb void    const
 

Returns a pointer to the ORB.

Returns:
A pointer to the ORB.

FILE * Options::output_file void    const
 

Returns the file where the IOR should be stored.

Returns:
The file where the IOR will be stored.

int Options::parse_args int &    argc,
char *    argv[]
[private]
 

Parses and pulls out arguments for the ImR.

Return values:
0  Success
-1  Error parsing args
1  Success but we should exit.

const ACE_Time_Value & Options::ping_interval void    const
 

Returns the timeout value for program starting.

Returns:
The amount of time to wait between pings

void Options::print_usage void    const [private]
 

Print the usage information.

int Options::readonly void    const
 

Do we allow modifications to the servers?

Return values:
0  Normal operation.
1  Do not let server info be modified.

char * Options::repository_mode void   
 

int Options::run_service_command const char *    command [private]
 

Run a service command.

Right now these include 'install' and 'remove'. Others, such as 'start' and 'stop' can be added, but the 'net' program in Windows already handles these commands.

Todo:
Finish implementing Options::run_service_command

Update to unicode

int Options::service void    const
 

Service Mode.

Return values:
0  Run as standalone service
1  Run as a service (only on NT right now)

const ACE_Time_Value & Options::startup_timeout void    const
 

Returns the timeout value for program starting.

Returns:
The amount of time to wait for a server to start.


Member Data Documentation

unsigned int Options::debug_ [private]
 

Debug level.

char* Options::file_name_ [private]
 

The persistent file option.

FILE* Options::ior_output_file_ [private]
 

File where the IOR of the server object is stored.

int Options::multicast_ [private]
 

Will we listen for multicast location requests?

CORBA::ORB_var Options::orb_ [private]
 

The ORB for the Implementation Repository.

ACE_Time_Value Options::ping_interval_ [private]
 

The amount of time between successive "are you started yet?" pings.

int Options::readonly_ [private]
 

Can the server_repository be modified?

Repository_Configuration* Options::repo_config_ [private]
 

The persistent configuration object.

char Options::repo_mode_ [private]
 

Mode of the Server Repository: if XML (x) or non-XML (n).

int Options::service_ [private]
 

Are we running as a service?

ACE_Time_Value Options::startup_timeout_ [private]
 

The amount of time to wait for a server to response after starting it.


The documentation for this class was generated from the following files:
Generated on Thu Oct 10 21:35:34 2002 for TAO_Implementation_Repository by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001