File tree Expand file tree Collapse file tree 5 files changed +190
-149
lines changed
Expand file tree Collapse file tree 5 files changed +190
-149
lines changed Original file line number Diff line number Diff line change 88
99namespace opentime { namespace OPENTIME_VERSION {
1010
11+ // / @brief This struct represents the return status of a function.
1112struct ErrorStatus
1213{
14+ // / @brief This enumeration represents the possible outcomes.
1315 enum Outcome
1416 {
1517 OK = 0 ,
@@ -21,34 +23,41 @@ struct ErrorStatus
2123 INVALID_RATE_FOR_DROP_FRAME_TIMECODE,
2224 };
2325
26+ // / @brief Construct a new status with no error.
2427 ErrorStatus ()
2528 : outcome{ OK }
2629 {}
2730
31+ // / @brief Construct a new status with the given outcome.
2832 ErrorStatus (Outcome in_outcome)
2933 : outcome{ in_outcome }
3034 , details{ outcome_to_string (in_outcome) }
3135 {}
3236
37+ // / @brief Construct a new status with the given outcome and details.
3338 ErrorStatus (Outcome in_outcome, std::string const & in_details)
3439 : outcome{ in_outcome }
3540 , details{ in_details }
3641 {}
3742
38- Outcome outcome;
43+ // / @brief The outcome of the function.
44+ Outcome outcome;
45+
46+ // / @brief A human readable string that provides details about the outcome.
3947 std::string details;
4048
49+ // /! @brief Return a human readable string for the given outcome.
4150 static std::string outcome_to_string (Outcome);
4251};
4352
44- // Check whether the given ErrorStatus is an error.
53+ // /! @brief Check whether the given ErrorStatus is an error.
4554constexpr bool
4655is_error (const ErrorStatus& es) noexcept
4756{
4857 return ErrorStatus::Outcome::OK != es.outcome ;
4958}
5059
51- // Check whether the given ErrorStatus is non-null and an error.
60+ // /! @brief Check whether the given ErrorStatus is non-null and an error.
5261constexpr bool
5362is_error (const ErrorStatus* es) noexcept
5463{
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ class RationalTime
9393 return value_rescaled_to (rt._rate );
9494 }
9595
96- // / @brief Returns whether time is almost equal to another time.
96+ // / @brief Returns whether this time is almost equal to another time.
9797 // /
9898 // / @param other The other time for comparison.
9999 // / @param delta The tolerance used for the comparison.
@@ -103,10 +103,10 @@ class RationalTime
103103 return fabs (value_rescaled_to (other._rate ) - other._value ) <= delta;
104104 }
105105
106- // / @brief Returns whether the value and rate are equal to another time.
106+ // / @brief Returns whether this value and rate are exactly equal to another time.
107107 // /
108- // / This is different from the operator "==" that rescales the time before
109- // / comparison.
108+ // / Note that this is different from the equality operator that rescales the time
109+ // / before comparison.
110110 constexpr bool strictly_equal (RationalTime other) const noexcept
111111 {
112112 return _value == other._value && _rate == other._rate ;
Original file line number Diff line number Diff line change 1010
1111namespace opentime { namespace OPENTIME_VERSION {
1212
13+ // / @brief This provides printf style functionality for std::string.
1314template <typename ... Args>
1415std::string
1516string_printf (char const * format, Args... args)
You can’t perform that action at this time.
0 commit comments