|
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.
irc/server/headers/builder/command-validation/CmdSpec.hpp
Lines 42 to 47 in 22ee811
In this snippet,
paramMapis defined, but only used inside CmdSpec (andCmdSpec::CmdBuilderwhich is nested).Typedef declaration can be moved inside
CmdSpecas public, to avoid declaring too many types at global scope.Typedefs can be accessed with CmdSpec::param_map and CmdSpec::cmd_executor, and inside CmdSpec methods and nested types without prefix.