source: src/JobMarket/Controller/controller_AddOn.hpp@ 404d2b

Action_Thermostats Add_AtomRandomPerturbation Add_RotateAroundBondAction Add_SelectAtomByNameAction Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_StructOpt_integration_tests Automaking_mpqc_open AutomationFragmentation_failures Candidate_v1.6.0 Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_ChronosMutex Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion GeometryObjects Gui_displays_atomic_force_velocity IndependentFragmentGrids_IntegrationTest JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks RotateToPrincipalAxisSystem_UndoRedo StoppableMakroAction Subpackage_JobMarket Subpackage_levmar Subpackage_mpqc_open Subpackage_vmg ThirdParty_MPQC_rebuilt_buildsystem TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps Ubuntu_1604_changes stable
Last change on this file since 404d2b was 404d2b, checked in by Frederik Heber <heber@…>, 8 years ago

Squashed 'ThirdParty/JobMarket/' content from commit e194722

git-subtree-dir: ThirdParty/JobMarket
git-subtree-split: e19472277e62c493f6c10f1483fe21e64c1039e9

  • Property mode set to 100644
File size: 3.4 KB
Line 
1/*
2 * controller_AddOn.hpp
3 *
4 * Created on: 01.06.2012
5 * Author: heber
6 */
7
8#ifndef CONTROLLER_ADDON_HPP_
9#define CONTROLLER_ADDON_HPP_
10
11// include config.h
12#ifdef HAVE_CONFIG_H
13#include <config.h>
14#endif
15
16
17#include <boost/function.hpp>
18#include <boost/program_options.hpp>
19
20class ControllerCommand;
21class ControllerCommandRegistry;
22class ControllerInfo;
23class ControllerOptions;
24class FragmentController;
25
26struct controller_AddOn;
27
28/** This is the allocator function for the specific controller addon structure.
29 *
30 * The implementation should reside in its own module such that it can be
31 * linked in unison with the \file controller.cpp and the derived implementation
32 * of controller_AddOn to the executable controller.
33 */
34extern "C++" controller_AddOn *getAddOn();
35
36/** This is the structure that contains functions to extend the functionality
37 * of the basic controller with respect to certain jobs and commands.
38 *
39 * Here, we have four types of functions:
40 * -# Allocator: Required to allocate to specific function which contains
41 * extended member variables and parsing functions.
42 * -# Commands: Add more commands to the registry of the controller.
43 * -# Options: Add more command-line options to require additional information
44 * from the user.
45 * -# Parsers: Add parsing function to place parameter from command-line
46 * into internal structure allocated via Allocator.
47 *
48 * The allocated structure is the one which contains all information for the
49 * execution of these commands. Note that some defaults are already parsed
50 * and stored therein by the controller by default.
51 *
52 * \note All these functions are called within the basic controller, hence
53 * all parameters are instances of this basic controller.
54 */
55struct controller_AddOn {
56 /** Function to allocate a derived variant of ControllerOptions which might
57 * be extended by own member variables and parsing functions.
58 *
59 * \return Pointer to allocated instance of ControllerOptions or derived.
60 */
61 virtual ControllerOptions *allocateControllerInfo()=0;
62
63 /** Function to register new commands communicating with a server.
64 *
65 * \param registrator registrator function for the generated ControllerCommand
66 * \param controller access to controller to bind to its functions
67 * \param ControllerInfo All other options of the controller
68 */
69 virtual void addSpecificCommands(
70 boost::function<void (ControllerCommand *)> &registrator,
71 FragmentController &controller,
72 ControllerOptions &ControllerInfo)=0;
73
74 /** Function to add other command line options if more use input is required.
75 *
76 * \param option option_description entity that can be used to add another
77 * boost::program_options as follows:
78 * \code
79 * option("command,c", boost::program_options::, "description");
80 * \endcode
81 */
82 virtual void addSpecificOptions(
83 boost::program_options::options_description_easy_init option)=0;
84
85 /** Function to add a parsing function for placing info from the command line
86 * option into \a ControllerInfo.
87 *
88 * \param ControllerInfo May be reinterpret_cast to true type as has been
89 * allocated in controller_AddOn::allocateControllerInfo.
90 * \param vm map of command line variables
91 * \return 0 - ok, else - some failure code (which leads to program exit)
92 */
93 virtual int addOtherParsings(
94 ControllerOptions &ControllerInfo,
95 boost::program_options::variables_map &vm)=0;
96};
97
98#endif /* CONTROLLER_ADDON_HPP_ */
Note: See TracBrowser for help on using the repository browser.