1 #ifndef ZGStdinSession_h
2 #define ZGStdinSession_h
4 #include "reflector/AbstractReflectSession.h"
101 bool IsReallyStdin()
const;
104 bool _endServerOnClose;
105 bool _calledEndServer;
virtual bool IsReadyForTextCommands() const =0
Should be implemented to true iff this object is ready to have its TextCommandReceived() method calle...
const ITextCommandReceiver & GetTextCommandReceiver() const
Returns the ITextCommandReceiver object that was passed into our ctor.
bool IsEndServerOnClose() const
Returns true iff we will call EndServer() if stdin is closed.
Interface for an object that can receive text commands from the user.
ITextCommandReceiver & GetTextCommandReceiver()
Returns the ITextCommandReceiver object that was passed into our ctor.
virtual ~ITextCommandReceiver()
The zg namespace contains the public API of the ZG library.
bool EndServerRequested() const
Returns true iff this object called EndServer() already.
This is a utility class that knows how to read from the process's stdin and hand any received text co...
virtual AbstractMessageIOGatewayRef CreateGateway()
Overridden to create and return a PlainTextMessageIOGateway, since stdin input will be in the form of...
virtual ConstSocketRef CreateDefaultSocket()
Overridden to return an invalid socket.
void SetEndServerOnClose(bool esoc)
Sets whether or not we should call EndServer when stdin is closed.
virtual void MessageReceivedFromGateway(const MessageRef &msg, void *ptr)
Overridden to handle incoming text from the PlainTextMessageIOGateway.
virtual bool ClientConnectionClosed()
Overridden to quit the ReflectServer event-loop when stdin is closed (if that behavior was specified ...
virtual const char * GetTypeName() const
Implemented to return "ZGStdin".
virtual bool IsReadyForInput() const
Returns true iff our (target)'s IsReadyForInput() method returns true.
virtual bool TextCommandReceived(const String &text)=0
Called whenever the user types in a text command.
virtual DataIORef CreateDataIO(const ConstSocketRef &)
Overridden to create and return a StdinDataIO object.
ZGStdinSession(ITextCommandReceiver &target, bool endServerOnClose)
Constructor.
bool ParseGenericTextCommand(const String &cmd)
Tries to handle any text commands that can be handled generically; that is, any commands that can be ...