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