-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from rogy-AquaLab/placement
Placement
- Loading branch information
Showing
6 changed files
with
193 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#ifndef POWER_MAP_PLACEMENT_HPP | ||
#define POWER_MAP_PLACEMENT_HPP | ||
|
||
#include <optional> | ||
#include <string> | ||
|
||
namespace power_map { | ||
|
||
enum class Placement : char { | ||
LeftFront, | ||
RightFront, | ||
LeftBack, | ||
RightBack, | ||
}; | ||
|
||
auto placement_from_str(const std::string& value) -> std::optional<Placement>; | ||
|
||
} | ||
|
||
#endif // POWER_MAP_PLACEMENT_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include "power_map/placement.hpp" | ||
|
||
auto power_map::placement_from_str(const std::string& value) -> std::optional<Placement> { | ||
if (value == "left-front") { | ||
return Placement::LeftFront; | ||
} | ||
if (value == "right-front") { | ||
return Placement::RightFront; | ||
} | ||
if (value == "left-back") { | ||
return Placement::LeftBack; | ||
} | ||
if (value == "right-back") { | ||
return Placement::RightBack; | ||
} | ||
return std::nullopt; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters