#include <gromacs/onlinehelp/helptopic.h>
template<class HelpText>
class gmx::CompositeHelpTopic< HelpText >
Template for simple implementation of AbstractCompositeHelpTopic.
- Template Parameters
-
HelpText | Struct that defines the data for the topic. |
Used similarly to SimpleHelpTopic. HelpText
should satisfy the same criteria as for SimpleHelpTopic.
- See Also
- SimpleHelpTopic
Adds a given topic as a subtopic of this topic.
- Parameters
-
- Exceptions
-
std::bad_alloc | if out of memory. |
This topic takes ownership of the object.
- See Also
- registerSubTopic()
const IHelpTopic * gmx::AbstractCompositeHelpTopic::findSubTopic |
( |
const char * |
name | ) |
const |
|
overridevirtualinherited |
Finds a subtopic by name.
- Parameters
-
[in] | name | Name of subtopic to find. |
- Returns
- Pointer to the found subtopic, or NULL if matching topic is not found.
Implements gmx::IHelpTopic.
template<class HelpText >
|
inlineoverrideprotectedvirtual |
template<class HelpText >
Returns the name of the topic.
This should be a single lowercase word, used to identify the topic. It is not used for the root of the help topic tree.
Implements gmx::AbstractCompositeHelpTopic.
template<class Topic >
void gmx::AbstractCompositeHelpTopic::registerSubTopic |
( |
| ) |
|
|
inlineinherited |
Registers a subtopic of a certain type to this topic.
- Template Parameters
-
Topic | Type of topic to register. |
- Exceptions
-
std::bad_alloc | if out of memory. |
Topic
must be default-constructible and implement IHelpTopic.
This method is provided as a convenient alternative to addSubTopic() for cases where each topic is implemented by a different type (which is a common case outside unit tests).
template<class HelpText >
Returns a title for the topic.
May return NULL, in which case the topic is omitted from normal subtopic lists and no title is printed by the methods provided in helptopic.h.
Implements gmx::AbstractCompositeHelpTopic.
void gmx::AbstractCompositeHelpTopic::writeHelp |
( |
const HelpWriterContext & |
context | ) |
const |
|
overridevirtualinherited |
Prints the help text for this topic.
- Parameters
-
[in] | context | Context object for writing the help. |
- Exceptions
-
std::bad_alloc | if out of memory. |
FileIOError | on any I/O error. |
Implements gmx::IHelpTopic.
bool gmx::AbstractCompositeHelpTopic::writeSubTopicList |
( |
const HelpWriterContext & |
context, |
|
|
const std::string & |
title |
|
) |
| const |
|
protectedinherited |
Writes the list of subtopics.
- Parameters
-
[in] | context | Context for writing the help. |
[in] | title | Title for the written list. |
- Returns
- true if anything was printed.
- Exceptions
-
std::bad_alloc | if out of memory. |
FileIOError | on any I/O error. |
Subtopics with empty titles are skipped from the list. If there would be no subtopics in the list, title
is not printed either.
This method is provided for cases where helpText() does not provide the needed flexibility and the derived class needs to override writeHelp(). This method can then be called to print the same subtopic list that is printed by the default writeHelp() implementation.
The documentation for this class was generated from the following file: