FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
ElementCountCheck.h
1#pragma once
4
5#include <fhsim/simobject/ISimObjectCreator.h>
6
7#include <string>
8
9namespace trawl_mooring
10{
19inline void RequireElementCount(ISimObjectCreator* const creator, const std::string& parameter, const int count)
20{
21 if (count < 1) {
22 creator->ReportParameterError(parameter, "must be at least 1, was " + std::to_string(count) + ".");
23 }
24}
25
32inline bool IsPortSide(ISimObjectCreator* const creator, const std::string& value)
33{
34 if (value != "Port" && value != "Starboard") {
35 creator->ReportParameterError("PortOrStarboard", "must be \"Port\" or \"Starboard\" (exactly, with capital first letter), was \"" + value + "\".");
36 }
37 return value == "Port";
38}
39} // namespace trawl_mooring