Gromacs  2018.8
 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

virtual const char * name () const =0
 Returns the name of the topic. More...
 
virtual const char * title () const =0
 Returns a title for the topic. More...
 
virtual bool hasSubTopics () const
 Returns whether the topic has any subtopics.
 
virtual const IHelpTopicfindSubTopic (const char *name) const
 Finds a subtopic by name. More...
 
virtual void writeHelp (const HelpWriterContext &context) const
 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
virtual

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::anonymous_namespace{selhelp.cpp}::KeywordDetailsHelpTopic, and gmx::SimpleHelpTopic< HelpText >.

virtual const char* gmx::AbstractSimpleHelpTopic::name ( ) const
pure 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::anonymous_namespace{selhelp.cpp}::KeywordDetailsHelpTopic, and gmx::SimpleHelpTopic< HelpText >.

virtual const char* gmx::AbstractSimpleHelpTopic::title ( ) const
pure 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::anonymous_namespace{selhelp.cpp}::KeywordDetailsHelpTopic, and gmx::SimpleHelpTopic< HelpText >.

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

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: