| 79 | } |
| 80 | |
| 81 | std::tuple<bool, EfTime> |
| 82 | Exec_Runtime::SetTime(const EfTimeInputNode &timeNode, const EfTime &time) |
| 83 | { |
| 84 | const VdfOutput &timeOutput = *timeNode.GetOutput(); |
| 85 | const VdfMask timeMask = VdfMask::AllOnes(1); |
| 86 | |
| 87 | // Retrieve the old time vector from the executor data manager. |
| 88 | // |
| 89 | // If there isn't already a time value stored in the executor data manager, |
| 90 | // perform first time initialization and return. In this case, we don't |
| 91 | // consider time as having changed. |
| 92 | const VdfVector *const oldTimeVector = _executor->GetOutputValue( |
| 93 | timeOutput, timeMask); |
| 94 | if (!oldTimeVector) { |
| 95 | _executor->SetOutputValue( |
| 96 | timeOutput, VdfTypedVector<EfTime>(time), timeMask); |
| 97 | return {false, EfTime()}; |
| 98 | } |
| 99 | |
| 100 | // Get the old time value from the vector. If there is no change in time, |
| 101 | // we can return without setting the new time value. |
| 102 | const EfTime oldTime = oldTimeVector->GetReadAccessor<EfTime>()[0]; |
| 103 | if (oldTime == time) { |
| 104 | return {false, oldTime}; |
| 105 | } |
| 106 | |
| 107 | // Set the new time value and return. |
| 108 | _executor->SetOutputValue( |
| 109 | timeOutput, VdfTypedVector<EfTime>(time), timeMask); |
| 110 | return {true, oldTime}; |
| 111 | } |
| 112 | |
| 113 | void |
| 114 | Exec_Runtime::InvalidateTopologicalState() |
no test coverage detected