class mrpt::apps::BaseAppInitializableCLI

Overview

Virtual interface for applications that initialize from CLI parameters.

#include <mrpt/apps_cli/BaseAppInitializableCLI.h>

class BaseAppInitializableCLI
{
public:
    // construction

    BaseAppInitializableCLI();

    // methods

    std::optional<int> checkUsage(int argc, const char** argv) const;

    std::optional<int> checkUsage(
        int argc,
        char** argv
        ) const;
};

// direct descendants

class ICP_SLAM_App_Base;
class KFSLAMApp;
class MonteCarloLocalization_Base;
class RBPF_SLAM_App_Base;

Methods

std::optional<int> checkUsage(int argc, const char** argv) const

To be called from main() before initialize() : if the arguments contain “-h” or “–help”, prints the usage to stdout and returns 0; if the number of arguments is wrong, prints the usage to stderr and returns 1.

The returned value is the program exit code. Otherwise, returns std::nullopt and the program should go on.