[Positioning] owlps-positioning is almost usable

Add Positioning creation in owlps-positioning, so the program is usable,
configuration is checked in Positioning, Input and Output, and objects
are created and run normally.

UserInterface: Minor modification, config_file_name is not initialised
in constructor anymore, it is now a default value of the configuration
entry "config-file".
This commit is contained in:
Matteo Cypriani 2010-03-08 11:38:25 +01:00
parent 454579d9b7
commit 7bd6f8b261
3 changed files with 8 additions and 7 deletions

View File

@ -1,4 +1,6 @@
#include "userinterface.hh"
#include "stock.hh"
#include "positioning.hh"
int main(int argc, char **argv)
@ -6,5 +8,8 @@ int main(int argc, char **argv)
UserInterface *ui = new UserInterface(argc, argv) ;
delete ui ; // We don't need it any more
Positioning positioning ;
Stock::clear() ;
return 0 ;
}

View File

@ -31,7 +31,6 @@ UserInterface::UserInterface(const int argc, char **argv)
assert(argv) ;
cli_argument_values = argv ;
cli_argument_count = argc ;
config_file_name = DEFAULT_CONFIG_FILE_NAME ;
try
{
@ -73,7 +72,8 @@ void UserInterface::fill_cli_options()
{
cli_options->add_options()
("help,h", "Print help")
("config-file,f", po::value<string>(),
("config-file,f", po::value<string>()
->default_value(DEFAULT_CONFIG_FILE_NAME),
"Alternative configuration file")
; // End of options
}
@ -122,10 +122,6 @@ void UserInterface::parse_options()
parse_command_line() ;
print_usage_and_exit_if_requested() ;
// Was the config file name specified on the command line?
if (Configuration::is_configured("config-file"))
config_file_name = Configuration::string_value("config-file") ;
parse_file() ;
po::notify(Configuration::getw_configuration()) ;
@ -153,6 +149,7 @@ void UserInterface::print_usage_and_exit_if_requested() const
void UserInterface::parse_file() const
{
string config_file_name = Configuration::string_value("config-file") ;
ifstream config_file(config_file_name.c_str()) ;
if (! config_file)

View File

@ -8,7 +8,6 @@
class UserInterface
{
protected:
std::string config_file_name ;
int cli_argument_count ;
char **cli_argument_values ;
boost::program_options::options_description *cli_options ;