Sadik Armagan | a097d2a | 2021-11-24 15:47:28 +0000 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2021 Arm Ltd and Contributors. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | #pragma once |
| 6 | |
| 7 | #include <sstream> |
| 8 | |
| 9 | namespace armnn |
| 10 | { |
| 11 | |
| 12 | class PredicateResult |
| 13 | { |
| 14 | public: |
| 15 | explicit PredicateResult(bool result) |
| 16 | : m_Result(result) |
| 17 | {} |
| 18 | |
| 19 | PredicateResult(const PredicateResult& predicateResult) |
| 20 | : m_Result(predicateResult.m_Result) |
| 21 | , m_Message(predicateResult.m_Message.str()) |
| 22 | {} |
| 23 | |
| 24 | void SetResult(bool newResult) |
| 25 | { |
| 26 | m_Result = newResult; |
| 27 | } |
| 28 | |
| 29 | std::stringstream& Message() |
| 30 | { |
| 31 | return m_Message; |
| 32 | } |
| 33 | |
| 34 | bool operator!() const |
| 35 | { |
| 36 | return !m_Result; |
| 37 | } |
| 38 | |
| 39 | void operator=(PredicateResult otherPredicateResult) |
| 40 | { |
| 41 | otherPredicateResult.m_Result = m_Result; |
| 42 | } |
| 43 | |
| 44 | bool m_Result; |
| 45 | std::stringstream m_Message; |
| 46 | }; |
| 47 | |
| 48 | } // namespace armnn |