mcx::cmd_line

mcx::cmd_line

Classes

Name
struct mcx::cmd_line::Component
class mcx::cmd_line::Config
struct mcx::cmd_line::Realtime
struct mcx::cmd_line::Task

Types

Name
enum class Field { Required, Optional}
enum class Container { Any, Single, Array}
enum class DataType { Any, Boolean, Number, String, Object}
enum uint32_t SystemMode { ALL_MODES, SIMULATION, PRODUCTION}
using mcx::comm::ConnectionData Server
using std::tuple< std::string, Field, Container, DataType > FieldDesc

Functions

Name
std::string path(const std::string & path)
std::string filename(const std::string & path)
Config parse(int argc, char ** argv, std::vector< Component > components)
std::string trim(std::string str)
nlohmann::json find(const nlohmann::json & object, const std::string & path)
bool sameDataType(const nlohmann::json & field, DataType data_type)
template <typename T >
T
get(const nlohmann::json & object, const FieldDesc & opt, const std::string & path, const T & default_value ={})
constexpr std::string_view getSystemMode(SystemMode system_mode)

Types Documentation

enum Field

Enumerator Value Description
Required
Optional

enum Container

Enumerator Value Description
Any
Single
Array

enum DataType

Enumerator Value Description
Any
Boolean
Number
String
Object

enum SystemMode

Enumerator Value Description
ALL_MODES
SIMULATION
PRODUCTION

using Server

using mcx::cmd_line::Server = typedef mcx::comm::ConnectionData;

using FieldDesc

using mcx::cmd_line::FieldDesc = typedef std::tuple<std::string, Field, Container, DataType>;

Functions Documentation

function path

std::string path(
    const std::string & path
)

function filename

std::string filename(
    const std::string & path
)

function parse

Config parse(
    int argc,
    char ** argv,
    std::vector< Component > components
)

function trim

std::string trim(
    std::string str
)

function find

nlohmann::json find(
    const nlohmann::json & object,
    const std::string & path
)

function sameDataType

bool sameDataType(
    const nlohmann::json & field,
    DataType data_type
)

function get

template <typename T >
T get(
    const nlohmann::json & object,
    const FieldDesc & opt,
    const std::string & path,
    const T & default_value ={}
)

function getSystemMode

constexpr std::string_view getSystemMode(
    SystemMode system_mode
)

Updated on 2022-04-05 at 16:21:26 +0200