profilemanager.h
More...
#include <profilemanager.h>
|
| ProfileManager (std::string config=std::string("~/.config/hopfskipjump.xml")) |
| Create a profile manager to save and restore properties of DetectorBanks. More...
|
|
| ~ProfileManager () |
| Destroy this profile manager, rewriting the configuration file if any new profiles have been added.
|
|
rapidxml::xml_node * | exists (const std::string &name) const |
| Determine whether the name profile exists in the database. More...
|
|
void | saveProfile (const std::string &name, const std::string &profile) |
| Save a serialised profile under a given name, possibly overwriting an existing profile. More...
|
|
std::string | getProfile (const std::string &name) const |
| Get an XML representation of a profile which can be used by fromXML() More...
|
|
|
static const char | protocol [] |
| Protocol version in use by this release. More...
|
|
|
void | deep_copy_names_values (rapidxml::xml_node<> &in, rapidxml::xml_node<> &out, rapidxml::xml_document<> &mem) |
| Recursively clone a node and its values. More...
|
|
|
std::string | configPath |
| Path of the configuration file.
|
|
rapidxml::file * | configXML |
| Known configurations.
|
|
rapidxml::xml_document | profiles |
| XML doc of known configurations.
|
|
bool | profilesModified |
| Document tree has been modified.
|
|
profilemanager.h
The ProfileManager class is responsible for reading and writing the XML-serialised description of a DetectorBank
Definition at line 16 of file profilemanager.h.
◆ ProfileManager()
ProfileManager::ProfileManager |
( |
std::string |
config = std::string("~/.config/hopfskipjump.xml") | ) |
|
Create a profile manager to save and restore properties of DetectorBanks.
- Parameters
-
config | Path XML file where configurations are stored. |
◆ deep_copy_names_values()
void ProfileManager::deep_copy_names_values |
( |
rapidxml::xml_node<> & |
in, |
|
|
rapidxml::xml_node<> & |
out, |
|
|
rapidxml::xml_document<> & |
mem |
|
) |
| |
|
protected |
Recursively clone a node and its values.
- Parameters
-
in | Source node |
out | Target node |
mem | Document supplying the memory |
◆ exists()
rapidxml::xml_node* ProfileManager::exists |
( |
const std::string & |
name | ) |
const |
Determine whether the name profile exists in the database.
- Parameters
-
name | Name of the profile to find |
- Returns
- The address of xml profile description or null if absent.
◆ getProfile()
std::string ProfileManager::getProfile |
( |
const std::string & |
name | ) |
const |
Get an XML representation of a profile which can be used by fromXML()
- Parameters
-
- Returns
- A string of XML describing the profile
- Exceptions
-
std::string | Profile 'name' not found. |
◆ saveProfile()
void ProfileManager::saveProfile |
( |
const std::string & |
name, |
|
|
const std::string & |
profile |
|
) |
| |
Save a serialised profile under a given name, possibly overwriting an existing profile.
- Parameters
-
name | Name of the profile to create |
profile | Text describing the new profile |
- Exceptions
-
std::string | The XML root node of the profile to save wasn't <profile> |
◆ protocol
const char ProfileManager::protocol[] |
|
static |
Protocol version in use by this release.
The protocol version must agree with any file which the DetectorBank attemts to load.
Definition at line 34 of file profilemanager.h.
The documentation for this class was generated from the following file: