#include <rts/debug.h>
Inherited by DebugIOCon, DebugIOFlat, DebugIONet, and DebugIOOds.
Public Types | |
| enum | StringType { Assert = 0 , Check , Log , Crash , Exception , CmdReply , StructuredCmdReply , Other , MAX } |
| List of possible log string types. More... | |
Public Member Functions | |
| DebugIOInterface (void) | |
| virtual int | Read (char *buf, int maxchar)=0 |
| Retrieves up to the given number of characters from a command input source. | |
| virtual void | Write (StringType type, const char *src, const char *str)=0 |
| Write out some characters differentiated by the log string type. | |
| virtual void | EmergencyFlush (void)=0 |
| Emergency shutdown function. | |
| virtual void | Execute (class Debug &dbg, const char *cmd, bool structuredCmd, unsigned argn, const char *const *argv)=0 |
| I/O class specific command. | |
| virtual void | Delete (void)=0 |
| Destroys the current I/O class instance. | |
Protected Member Functions | |
| virtual | ~DebugIOInterface () |
| I/O class destructor. | |
Debug I/O interface.
A Debug I/O interface implementation must register itself using Debug::AddIOFactory. Typically this is done by using the DEBUG_DECLARE_IO_INTERFACE and DEBUG_IMPLEMENT_IO_INTERFACE macros (recommended, but not mandatory.)
Definition at line 46 of file debug_io.h.
List of possible log string types.
| Enumerator | |
|---|---|
| Assert | DASSERT etc. |
| Check | DCHECK etc. |
| Log | DLOG etc. |
| Crash | DCRASH etc. |
| Exception | Exception. |
| CmdReply | Regular command reply. |
| StructuredCmdReply | Structured command reply, see Structured command reply. |
| Other | some other message |
| MAX | |
Definition at line 66 of file debug_io.h.
|
inlineprotectedvirtual |
I/O class destructor.
The destructor must always be protected. Destruction is done by calling the Delete member function.
Definition at line 59 of file debug_io.h.
|
inlineexplicit |
Definition at line 63 of file debug_io.h.
|
pure virtual |
Destroys the current I/O class instance.
Use this function instead of just delete'ing the instance.
Implemented in DebugIOCon, DebugIOFlat, DebugIONet, and DebugIOOds.
|
pure virtual |
Emergency shutdown function.
This function gets called during an exception and should perform the absolute bare minimum (e.g. just flushing and closing the output file).
Implemented in DebugIOCon, DebugIOFlat, DebugIONet, and DebugIOOds.
|
pure virtual |
I/O class specific command.
All io <class> commands are passed into this function, with the exception of remove which results in simply calling the class destructor.
| dbg | debug instance |
| cmd | command issued |
| structuredCmd | true if structured command reply, false if not |
| argn | number of additional arguments passed in |
| argv | argument list |
Implemented in DebugIOCon, DebugIOFlat, DebugIONet, and DebugIOOds.
|
pure virtual |
Retrieves up to the given number of characters from a command input source.
This source can be e.g. keyboard or a network pipe. This function must not block.
| buf | buffer to place read characters in |
| maxchar | maximum number of characters to return |
Implemented in DebugIOCon, DebugIOFlat, DebugIONet, and DebugIOOds.
|
pure virtual |
Write out some characters differentiated by the log string type.
| type | possible string type | ||||||||||||||||||
| src | string source, may be NULL, content depends on type:
| ||||||||||||||||||
| str | string to output, NUL delimited, if NULL then simply flush output (if applicable) |
Implemented in DebugIOCon, DebugIOFlat, DebugIONet, and DebugIOOds.