Skip to content

Commit

Permalink
style: update constructor initializer formatting for improved readabi…
Browse files Browse the repository at this point in the history
…lity
  • Loading branch information
pageldev committed Jan 19, 2025
1 parent 2e57950 commit a215270
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ BreakInheritanceList: AfterColon
BreakStringLiterals: true
ColumnLimit: 150
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
Expand Down
10 changes: 9 additions & 1 deletion src/Geometries/ParamPoly3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,15 @@ ParamPoly3::ParamPoly3(double s0,
double dV,
bool pRange_normalized) :
RoadGeometry(s0, x0, y0, hdg0, length, GeometryType_ParamPoly3),
aU(aU), bU(bU), cU(cU), dU(dU), aV(aV), bV(bV), cV(cV), dV(dV), pRange_normalized(pRange_normalized)
aU(aU),
bU(bU),
cU(cU),
dU(dU),
aV(aV),
bV(bV),
cV(cV),
dV(dV),
pRange_normalized(pRange_normalized)
{
if (!pRange_normalized)
{
Expand Down
33 changes: 28 additions & 5 deletions src/RoadMark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,16 @@ RoadMarksLine::RoadMarksLine(std::string road_id,
std::string name,
std::string rule) :
road_id(road_id),
lanesection_s0(lanesection_s0), lane_id(lane_id), group_s0(group_s0), width(width), length(length), space(space), t_offset(t_offset),
s_offset(s_offset), name(name), rule(rule)
lanesection_s0(lanesection_s0),
lane_id(lane_id),
group_s0(group_s0),
width(width),
length(length),
space(space),
t_offset(t_offset),
s_offset(s_offset),
name(name),
rule(rule)
{
}

Expand All @@ -31,8 +39,16 @@ RoadMarkGroup::RoadMarkGroup(std::string road_id,
std::string material,
std::string lane_change) :
road_id(road_id),
lanesection_s0(lanesection_s0), lane_id(lane_id), width(width), height(height), s_offset(s_offset), type(type), weight(weight), color(color),
material(material), lane_change(lane_change)
lanesection_s0(lanesection_s0),
lane_id(lane_id),
width(width),
height(height),
s_offset(s_offset),
type(type),
weight(weight),
color(color),
material(material),
lane_change(lane_change)
{
}

Expand All @@ -46,7 +62,14 @@ RoadMark::RoadMark(std::string road_id,
double width,
std::string type) :
road_id(road_id),
lanesection_s0(lanesection_s0), lane_id(lane_id), group_s0(group_s0), s_start(s_start), s_end(s_end), t_offset(t_offset), width(width), type(type)
lanesection_s0(lanesection_s0),
lane_id(lane_id),
group_s0(group_s0),
s_start(s_start),
s_end(s_end),
t_offset(t_offset),
width(width),
type(type)
{
}

Expand Down
31 changes: 27 additions & 4 deletions src/RoadObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,16 @@ RoadObjectRepeat::RoadObjectRepeat(double s0,
double z_offset_start,
double z_offset_end) :
s0(s0),
length(length), distance(distance), t_start(t_start), t_end(t_end), width_start(width_start), width_end(width_end), height_start(height_start),
height_end(height_end), z_offset_start(z_offset_start), z_offset_end(z_offset_end)
length(length),
distance(distance),
t_start(t_start),
t_end(t_end),
width_start(width_start),
width_end(width_end),
height_start(height_start),
height_end(height_end),
z_offset_start(z_offset_start),
z_offset_end(z_offset_end)
{
}

Expand Down Expand Up @@ -51,8 +59,23 @@ RoadObject::RoadObject(std::string road_id,
std::string subtype,
bool is_dynamic) :
road_id(road_id),
id(id), type(type), name(name), orientation(orientation), subtype(subtype), s0(s0), t0(t0), z0(z0), length(length), valid_length(valid_length),
width(width), radius(radius), height(height), hdg(hdg), pitch(pitch), roll(roll), is_dynamic(is_dynamic)
id(id),
type(type),
name(name),
orientation(orientation),
subtype(subtype),
s0(s0),
t0(t0),
z0(z0),
length(length),
valid_length(valid_length),
width(width),
radius(radius),
height(height),
hdg(hdg),
pitch(pitch),
roll(roll),
is_dynamic(is_dynamic)
{
}

Expand Down
20 changes: 18 additions & 2 deletions src/RoadSignal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,24 @@ RoadSignal::RoadSignal(std::string road_id,
std::string unit,
std::string text) :
road_id(road_id),
id(id), name(name), s0(s0), t0(t0), is_dynamic(is_dynamic), zOffset(zOffset), value(value), height(height), width(width), hOffset(hOffset),
pitch(pitch), roll(roll), orientation(orientation), country(country), type(type), subtype(subtype), unit(unit), text(text)
id(id),
name(name),
s0(s0),
t0(t0),
is_dynamic(is_dynamic),
zOffset(zOffset),
value(value),
height(height),
width(width),
hOffset(hOffset),
pitch(pitch),
roll(roll),
orientation(orientation),
country(country),
type(type),
subtype(subtype),
unit(unit),
text(text)
{
}

Expand Down

0 comments on commit a215270

Please sign in to comment.