Skip to content

Commit

Permalink
Merge pull request #320 from quasar-team/Quasar_documentation_fixup
Browse files Browse the repository at this point in the history
Quasar documentation fixup
  • Loading branch information
parasxos authored Jan 23, 2024
2 parents 64ee331 + eec7e09 commit 19e7c36
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 30 deletions.
29 changes: 11 additions & 18 deletions Documentation/source/UserDefinedCommandLineParameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Adding the command line options

As is often the case in quasar, user specific implementation code is
included in the server by overriding methods. The virtual method to
override is ````
override is

::

Expand Down Expand Up @@ -65,7 +65,7 @@ documentation:
- some_string: A named string value

So, we want to be able to start the server process wit a command line
like: ````
like:

::

Expand All @@ -75,50 +75,43 @@ like: ````
In this case add them to class QuasarServer.
| Also add the virtual method override (also to class QuasarServer) Now
the class definition pseudo code looks like...
| ````
::

class QuasarServer : ...etc...
{
...etc...
virtual void appendCustomCommandLineOptions(boost::program_options::options_description& commandLineOptions,
boost::program_options::positional_options_description& positionalOptionsDescription

); ... etc ... bool m_someSwitch; std::string m_someString; }
boost::program_options::positional_options_description& positionalOptionsDescription);
... etc ... bool m_someSwitch; std::string m_someString; }``

Now add the implementation of the method
'appendCustomCommandLineOptions', for example ````
'appendCustomCommandLineOptions', for example

::

void QuasarServer::appendCustomCommandLineOptions(boost::program_options::options_description& commandLineOptions, boost::program_options::positional_options_description& positionalOptionsDescription

) { commandLineOptions.add_options() ("some_switch",
boost::program_options::bool_switch(&m_someSwitch)->default_value(false),
"User documentation of some_switch") ("some_string",
boost::program_options::value(&m_someString)->default_value("anyDefaultValue"),
"User documentation of some_string"); }
void QuasarServer::appendCustomCommandLineOptions(boost::program_options::options_description& commandLineOptions, boost::program_options::positional_options_description& positionalOptionsDescription) {
commandLineOptions.add_options() ("some_switch", boost::program_options::bool_switch(&m_someSwitch)->default_value(false), "User documentation of some_switch") ("some_string", boost::program_options::value(&m_someString)->default_value("anyDefaultValue"), "User documentation of some_string"); }

Now, starting the server process with a command line above will result
in values ````
in values

::

QuasarServer::m_someSwitch = true
QuasarServer::m_someString "hello, world!"

Furthermore, starting the server process with a command line like ````
Furthermore, starting the server process with a command line like

::

./myServerExecutable -help

will print the help documentation described above, at the command line,
for example: ````
for example:

::

...etc...
--some_switch User documentation of some_switch
--some_string arg User documentation of some_string
--some_string arg User documentation of some_string
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ Key Functions

The start of of the configuration decoration hook is to override method
*overridableConfigure*. The virtual method is defined in class
*BaseQuasarServer*, and should be overridden in class *QuasarServer.
*
*BaseQuasarServer*, and should be overridden in class *QuasarServer*.

::

Expand Down Expand Up @@ -126,8 +125,6 @@ The start of of the configuration decoration hook is to override method

::

::

Example Code
~~~~~~~~~~~~

Expand Down Expand Up @@ -234,13 +231,10 @@ Function decorateConfiguration()
content order data. For some applications (e.g. clear()) we provide
functions in the DecorationUtils, e.g.
.. container::

.. container::
::

Configuration::DecorationUtils::clear(theConfig,
theConfig.ConfiguredClass(),
Configuration::Configuration::ConfiguredClass_id);
Configuration::DecorationUtils::clear(theConfig, theConfig.ConfiguredClass(),
Configuration::Configuration::ConfiguredClass_id);

|
Expand Down Expand Up @@ -283,14 +277,14 @@ called with the correct arguments; namely with the developer's
implementation of ConfigXmlDecoratorFunction as the 3rd argument. As is
often the case in quasar, injecting user specifc code involves
overriding a virtual function. In this case, the virtual function to
override is: ````
override is:

::

bool BaseQuasarServer::overridableConfigure(const std::string& fileName, AddressSpace::ASNodeManager *nm);

A typical developer override of this function would be along the lines
of the following pseudo code ````
of the following pseudo code

::

Expand Down

0 comments on commit 19e7c36

Please sign in to comment.