This is a utility class that knows how to read from the process's stdin and hand any received text commands over to the TextCommandReceived() method of the ITextCommandReceiver that is passed to its constructor.
More...
#include <ZGStdinSession.h>
This is a utility class that knows how to read from the process's stdin and hand any received text commands over to the TextCommandReceived() method of the ITextCommandReceiver that is passed to its constructor.
(The ITextCommandReceiver would typically be your ZGPeerSession object, but it's possible to use this class with any ITextCommandReceiver-derived object as its target.
Definition at line 52 of file ZGStdinSession.h.
Constructor.
- Parameters
-
target | The object to call TextCommandReceived() on when a line of text is received from stdin |
endServerOnClose | if true, we'll call EndServer() when stdin is closed, to cause this process to exit. |
virtual bool ClientConnectionClosed |
( |
| ) |
|
|
virtual |
Overridden to quit the ReflectServer event-loop when stdin is closed (if that behavior was specified in our constructor)
virtual DataIORef CreateDataIO |
( |
const ConstSocketRef & |
| ) |
|
|
virtual |
Overridden to create and return a StdinDataIO object.
virtual ConstSocketRef CreateDefaultSocket |
( |
| ) |
|
|
inlinevirtual |
virtual AbstractMessageIOGatewayRef CreateGateway |
( |
| ) |
|
|
virtual |
Overridden to create and return a PlainTextMessageIOGateway, since stdin input will be in the form of human-readable ASCII text.
bool EndServerRequested |
( |
| ) |
const |
|
inline |
Returns true iff this object called EndServer() already.
Definition at line 98 of file ZGStdinSession.h.
virtual const char* GetTypeName |
( |
| ) |
const |
|
inlinevirtual |
bool IsEndServerOnClose |
( |
| ) |
const |
|
inline |
Returns true iff we will call EndServer() if stdin is closed.
Definition at line 86 of file ZGStdinSession.h.
virtual bool IsReadyForInput |
( |
| ) |
const |
|
virtual |
virtual void MessageReceivedFromGateway |
( |
const MessageRef & |
msg, |
|
|
void * |
ptr |
|
) |
| |
|
virtual |
Overridden to handle incoming text from the PlainTextMessageIOGateway.
- Parameters
-
msg | The incoming MessageRef containing text strings to process |
ptr | Unused for now |
void SetEndServerOnClose |
( |
bool |
esoc | ) |
|
|
inline |
Sets whether or not we should call EndServer when stdin is closed.
Definition at line 89 of file ZGStdinSession.h.
The documentation for this class was generated from the following file: