Austin Schuh | 20b2b08 | 2019-09-11 20:42:56 -0700 | [diff] [blame] | 1 | #include "aos/ipc_lib/index.h" |
| 2 | |
Austin Schuh | 20b2b08 | 2019-09-11 20:42:56 -0700 | [diff] [blame] | 3 | #include <sstream> |
Austin Schuh | 60e7794 | 2022-05-16 17:48:24 -0700 | [diff] [blame] | 4 | #include <string> |
Austin Schuh | 20b2b08 | 2019-09-11 20:42:56 -0700 | [diff] [blame] | 5 | |
Stephan Pleines | f63bde8 | 2024-01-13 15:59:33 -0800 | [diff] [blame] | 6 | namespace aos::ipc_lib { |
Austin Schuh | 20b2b08 | 2019-09-11 20:42:56 -0700 | [diff] [blame] | 7 | |
| 8 | ::std::string QueueIndex::DebugString() const { |
| 9 | if (valid()) { |
| 10 | ::std::stringstream s; |
| 11 | s << "QueueIndex(" << index_ << "/0x" << ::std::hex << index_ << ::std::dec |
| 12 | << ", count=" << count_ << ")"; |
| 13 | return s.str(); |
| 14 | } else { |
| 15 | return "QueueIndex::Invalid()"; |
| 16 | } |
| 17 | } |
| 18 | |
| 19 | ::std::string Index::DebugString() const { |
| 20 | if (valid()) { |
| 21 | ::std::stringstream s; |
| 22 | s << "Index(queue_index=" << queue_index() << "/0x" << ::std::hex |
| 23 | << queue_index() << ::std::dec << ", message_index=" << message_index() |
| 24 | << ")"; |
| 25 | return s.str(); |
| 26 | } else { |
| 27 | return "QueueIndex::Invalid()"; |
| 28 | } |
| 29 | } |
| 30 | |
Stephan Pleines | f63bde8 | 2024-01-13 15:59:33 -0800 | [diff] [blame] | 31 | } // namespace aos::ipc_lib |