ROSE  0.11.96.11
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);

Factories

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

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 util/Sawyer/CommandLine.h.

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

Here is the call graph for this function:
Sawyer::CommandLine::SwitchAction::Ptr
SharedPointer< SwitchAction > Ptr
Reference counting pointer for this class.
Definition: util/Sawyer/CommandLine.h:1615
Sawyer::CommandLine::userAction
UserAction< Functor >::Ptr userAction(const Functor &functor)
Factory for switch action.
Definition: util/Sawyer/CommandLine.h:1871