ROSE 0.11.145.192
Command line action factories

Description

Factories for creating instances of Sawyer::CommandLine::SwitchAction subclasses.

A factory function is a more terse and convenient way of calling the instance allocating constructors for the various subclasses of SwitchAction, and they sometimes alleviate the user from having to supply template arguments. They take the same arguments as the instance method(s) and have the same name as the class they return, except their initial letter is lower-case. These two calls are equivalent:

SwitchAction::Ptr action1 = UserAction::instance<MyFunctor>(myFunctor);
SwitchAction::Ptr action2 = userAction(myFunctor);
SharedPointer< SwitchAction > Ptr
Reference counting pointer for this class.
UserAction< Functor >::Ptr userAction(const Functor &functor)
Factory for switch action.

Factories

Collaboration diagram for Command line action factories:
ShowVersion::Ptr Sawyer::CommandLine::showVersion (const std::string &versionString)
 Factory for switch action.
 
ShowVersionAndExit::Ptr Sawyer::CommandLine::showVersionAndExit (const std::string &versionString, int exitStatus)
 Factory for switch action.
 
ShowHelp::Ptr Sawyer::CommandLine::showHelp ()
 Factory for switch action.
 
ShowHelpAndExit::Ptr Sawyer::CommandLine::showHelpAndExit (int exitStatus)
 Factory for switch action.
 
ConfigureDiagnostics::Ptr Sawyer::CommandLine::configureDiagnostics (const std::string &, Message::Facilities &, bool exitOnHelp=true)
 Factory for switch action.
 
ConfigureDiagnosticsQuiet::Ptr Sawyer::CommandLine::configureDiagnosticsQuiet (Message::Facilities &)
 Factory for switch action.
 
template<class Functor >
UserAction< Functor >::Ptr Sawyer::CommandLine::userAction (const Functor &functor)
 Factory for switch action.
 

Function Documentation

◆ showVersion()

ShowVersion::Ptr Sawyer::CommandLine::showVersion ( const std::string &  versionString)

Factory for switch action.

A factory function is a more terse and convenient way of calling the instance allocating constructors for SwitchAction subclasses and often alleviates the user from having to specify template arguments.

See also

◆ showVersionAndExit()

ShowVersionAndExit::Ptr Sawyer::CommandLine::showVersionAndExit ( const std::string &  versionString,
int  exitStatus 
)

Factory for switch action.

A factory function is a more terse and convenient way of calling the instance allocating constructors for SwitchAction subclasses and often alleviates the user from having to specify template arguments.

See also

◆ showHelp()

ShowHelp::Ptr Sawyer::CommandLine::showHelp ( )

Factory for switch action.

A factory function is a more terse and convenient way of calling the instance allocating constructors for SwitchAction subclasses and often alleviates the user from having to specify template arguments.

See also

◆ showHelpAndExit()

ShowHelpAndExit::Ptr Sawyer::CommandLine::showHelpAndExit ( int  exitStatus)

Factory for switch action.

A factory function is a more terse and convenient way of calling the instance allocating constructors for SwitchAction subclasses and often alleviates the user from having to specify template arguments.

See also

◆ configureDiagnostics()

ConfigureDiagnostics::Ptr Sawyer::CommandLine::configureDiagnostics ( const std::string &  ,
Message::Facilities ,
bool  exitOnHelp = true 
)

Factory for switch action.

A factory function is a more terse and convenient way of calling the instance allocating constructors for SwitchAction subclasses and often alleviates the user from having to specify template arguments.

See also

◆ configureDiagnosticsQuiet()

ConfigureDiagnosticsQuiet::Ptr Sawyer::CommandLine::configureDiagnosticsQuiet ( Message::Facilities )

Factory for switch action.

A factory function is a more terse and convenient way of calling the instance allocating constructors for SwitchAction subclasses and often alleviates the user from having to specify template arguments.

See also

◆ userAction()

template<class Functor >
UserAction< Functor >::Ptr Sawyer::CommandLine::userAction ( const Functor &  functor)

Factory for switch action.

A factory function is a more terse and convenient way of calling the instance allocating constructors for SwitchAction subclasses and often alleviates the user from having to specify template arguments.

See also

Definition at line 1871 of file Sawyer/CommandLine.h.

References Sawyer::CommandLine::UserAction< Functor >::instance().