opynsim
Unofficial C++ Documentation
Loading...
Searching...
No Matches
scaling_step_validation_message.h
Go to the documentation of this file.
1#pragma once
2
4
6
7#include <optional>
8#include <string>
9#include <utility>
10
11namespace opyn
12{
13 // A message produced by a `ScalingStep`'s validation check.
15 public:
16
17 // Constructs a validation message that's related to the value(s) held in
18 // a property with name `propertyName` on the `ScalingStep`.
20 std::string propertyName,
22 std::string message) :
23
24 m_MaybePropertyName{std::move(propertyName)},
25 m_State{state},
26 m_Message{std::move(message)}
27 {}
28
29 // Constructs a validation message that's in some (general) way related to
30 // the `ScalingStep` that produced it.
33 std::string message) :
34
35 m_State{state},
36 m_Message{std::move(message)}
37 {}
38
39 std::optional<osc::CStringView> tryGetPropertyName() const
40 {
41 return not m_MaybePropertyName.empty() ? std::optional{m_MaybePropertyName} : std::nullopt;
42 }
43 ScalingStepValidationState getState() const { return m_State; }
44 osc::CStringView getMessage() const { return m_Message; }
45
46 private:
47 std::string m_MaybePropertyName;
49 std::string m_Message;
50 };
51}
Definition scaling_step_validation_message.h:14
ScalingStepValidationState getState() const
Definition scaling_step_validation_message.h:43
osc::CStringView getMessage() const
Definition scaling_step_validation_message.h:44
ScalingStepValidationMessage(std::string propertyName, ScalingStepValidationState state, std::string message)
Definition scaling_step_validation_message.h:19
ScalingStepValidationMessage(ScalingStepValidationState state, std::string message)
Definition scaling_step_validation_message.h:31
std::optional< osc::CStringView > tryGetPropertyName() const
Definition scaling_step_validation_message.h:39
Definition c_string_view.h:12
Definition component_registry.h:14
ScalingStepValidationState
Definition scaling_step_validation_state.h:6