Gromacs  2024.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions
gmx::AbstractSimpleHelpTopic Class Referenceabstract

#include <gromacs/onlinehelp/helptopic.h>

+ Inheritance diagram for gmx::AbstractSimpleHelpTopic:
+ Collaboration diagram for gmx::AbstractSimpleHelpTopic:

Description

Abstract base class for help topics that have simple text and no subtopics.

This class implements subtopic-related methods from IHelpTopic such that there are no subtopics. writeHelp() is also implemented such that it uses HelpTopicContext::writeTextBlock() to write out the text returned by a new virtual method helpText().

See Also
SimpleHelpTopic

Public Member Functions

const char * name () const override=0
 Returns the name of the topic. More...
 
const char * title () const override=0
 Returns a title for the topic. More...
 
bool hasSubTopics () const override
 Returns whether the topic has any subtopics.
 
const IHelpTopicfindSubTopic (const char *name) const override
 Finds a subtopic by name. More...
 
void writeHelp (const HelpWriterContext &context) const override
 Prints the help text for this topic. More...
 

Protected Member Functions

virtual std::string helpText () const =0
 Returns the help text for this topic. More...
 

Member Function Documentation

const IHelpTopic * gmx::AbstractSimpleHelpTopic::findSubTopic ( const char *  name) const
overridevirtual

Finds a subtopic by name.

Parameters
[in]nameName of subtopic to find.
Returns
Pointer to the found subtopic, or NULL if matching topic is not found.

Implements gmx::IHelpTopic.

virtual std::string gmx::AbstractSimpleHelpTopic::helpText ( ) const
protectedpure virtual

Returns the help text for this topic.

writeHelp() calls this method to obtain the actual text to format for the topic. Markup substitution etc. is done automatically by writeHelp().

Implemented in gmx::SimpleHelpTopic< HelpText >.

const char* gmx::AbstractSimpleHelpTopic::name ( ) const
overridepure virtual

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::IHelpTopic.

Implemented in gmx::SimpleHelpTopic< HelpText >.

const char* gmx::AbstractSimpleHelpTopic::title ( ) const
overridepure virtual

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::IHelpTopic.

Implemented in gmx::SimpleHelpTopic< HelpText >.

void gmx::AbstractSimpleHelpTopic::writeHelp ( const HelpWriterContext context) const
overridevirtual

Prints the help text for this topic.

Parameters
[in]contextContext object for writing the help.
Exceptions
std::bad_allocif out of memory.
FileIOErroron any I/O error.

Implements gmx::IHelpTopic.


The documentation for this class was generated from the following files: