slic/include
diff -u -r1.2 -r1.3
--- CommandLineProcessor.hh 1 Dec 2006 23:15:07 -0000 1.2
+++ CommandLineProcessor.hh 2 Dec 2006 00:27:14 -0000 1.3
@@ -72,19 +72,33 @@
void process(int argc, char** argv);
/**
- * Print the usage statement.
+ * Print out the options table.
*/
- void printUsage(std::ostream& os) const;
+ void printOptions(std::ostream&) const;
/**
* Print the version information.
*/
- void printVersion(std::ostream& os) const;
+ inline void printVersion(std::ostream& os) const;
/**
- * Register the list of valid command line options.
+ * Get the queue of Geant4 macro commands created from
+ * the command line arguments.
*/
- void registerOptions();
+ CommandQueue* getCommandQueue();
+
+ /**
+ * Print the usage statement.
+ */
+ inline void printUsage(std::ostream& os) const;
+
+ private:
+
+ /**
+ * Process all the command line arguments in correct
+ * order to create the queue of Geant4 commands.
+ */
+ void processOptions();
/**
* Abort the application before Geant4 starts,
@@ -93,56 +107,42 @@
* are invalid, as getopt will handle this and
* call exit() itself.
*/
- void abort();
+ inline void abort();
/**
* Process a command line switch by adding
* the corresponding Geant4 macro command to
* the CommandQueue.
*/
- void processOption(const std::string&);
+ inline void processOption(const std::string&);
/**
* Add a command line option describing a
* command line switch, its full name,
* description, geant4 command, etc.
*/
- void addOption(CommandLineOption*);
-
- /**
- * Get the queue of Geant4 macro commands created from
- * the command line arguments.
- */
- CommandQueue* getCommandQueue();
-
+ inline void addOption(CommandLineOption*);
+
/**
* Find an option specification by its single letter designation (with no '-').
*/
- CommandLineOption* getCommandLineOption(const std::string& opt);
+ inline CommandLineOption* getCommandLineOption(const std::string& opt);
/**
- * Returns true if the option was found in the command line arguments.
+ * Automatically create the getopt options string from OptionsList
+ * and set the m_getoptOptions variable to this value.
*/
- bool haveOption(const std::string& opt);
+ inline void createOptionsString();
/**
- * Print out the options table.
- */
- void printOptions(std::ostream&) const;
-
- private:
-
- /**
- * Process all the command line arguments in correct
- * order to create the queue of Geant4 commands.
+ * Register the list of valid command line options.
*/
- void processOptions();
+ inline void registerOptions();
/**
- * Automatically create the getopt options string from OptionsList
- * and set the m_getoptOptions variable to this value.
+ * Returns true if the option was found in the command line arguments.
*/
- void createOptionsString();
+ inline bool haveOption(const std::string& opt);
private:
@@ -160,6 +160,7 @@
int m_interactive_flag;
int m_version_flag;
+ // The getopt options string, which is created automatically.
std::string m_getoptOptions;
};
}
slic/src
diff -u -r1.2 -r1.3
--- CommandLineProcessor.cc 1 Dec 2006 23:15:07 -0000 1.2
+++ CommandLineProcessor.cc 2 Dec 2006 00:27:14 -0000 1.3
@@ -1,4 +1,4 @@
-// $Id: CommandLineProcessor.cc,v 1.2 2006/12/01 23:15:07 jeremy Exp $
+// $Id: CommandLineProcessor.cc,v 1.3 2006/12/02 00:27:14 jeremy Exp $
#include "CommandLineProcessor.hh"
@@ -54,7 +54,7 @@
{0, 0, 0, 0}
};
- static char* optstr = m_getoptOptions.c_str();
+ const char* optstr = m_getoptOptions.c_str();
while (1) {