Skip to content

Use scoped typedefs inside CmdSpec #136

@SimonCROS

Description

@SimonCROS

typedef std::vector< std::pair< e_param, CmdParam * > > paramMap;
class CmdSpec {
public:
/* CONSTRUCTORS */
~CmdSpec();

In this snippet, paramMap is defined, but only used inside CmdSpec (and CmdSpec::CmdBuilder which is nested).

Typedef declaration can be moved inside CmdSpec as public, to avoid declaring too many types at global scope.

class CmdSpec {
  public:
	typedef std::vector< std::pair< ParamType, CmdParam * > > param_map;
	typedef void (*cmd_executor)(CmdSpec &cmd);

Typedefs can be accessed with CmdSpec::param_map and CmdSpec::cmd_executor, and inside CmdSpec methods and nested types without prefix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions