- Remove extraneous members that were just storing temporary values.
- OutOfBand_e parameters don't need to be const as they are scalars.
- Switch from a map with CMIUtilString values to using a mapping function. This uses a switch statement which will generate a warning if a new result class is added.
- Make BuildAsyncRecord a static function rather than a private member function so that we can construct the result text correctly and avoid having extra stuff in the header.
Details
Diff Detail
Event Timeline
I'd prefer to declare all static functions as private static methods.
tools/lldb-mi/MICmnMIOutOfBandRecord.cpp | ||
---|---|---|
16 | CMICmnMIOutOfBandRecord::MapOutOfBandToText | |
56 | CMICmnMIOutOfBandRecord::MapOutOfBandToToken | |
102 | And please follow to the style: static CMIUtilString BuildAsyncRecord(CMICmnMIOutOfBandRecord::OutOfBand_e veType) | |
102 | CMICmnMIOutOfBandRecord::BuildAsyncRecord |
tools/lldb-mi/MICmnMIOutOfBandRecord.cpp | ||
---|---|---|
16 | The style in LLDB itself appears to be to using static file-scope functions when appropriate. I did the same thing in my previous patch which simplified CMICmnMIResultRecord. Making this a static function might lead to people prefixing the invocation with the class name, which would be needlessly verbose. Making it a private member function might also lead to, as it has done to date, to people using member variables for strange reasons rather than passing parameters. Hopefully, there's no need for the internal implementation details of this class to bleed out into the header file. | |
56 | As above. | |
102 | As above. |
CMICmnMIOutOfBandRecord::MapOutOfBandToText