CLI  2.9
TelnetConnection Class Reference

Telnet connection input/output device. More...

#include <telnet.h>

Inheritance diagram for TelnetConnection:

Public Member Functions

 TelnetConnection (TelnetServer *const PCLI_Server, const int I_Socket, const ResourceString::LANG E_Lang, const bool B_AutoDelete)
 Constructor. More...
 
virtual ~TelnetConnection (void)
 Destructor. More...
 
virtual const KEY GetKey (void) const
 Input key capture handler. More...
 
virtual void OnKey (const KEY E_Key) const
 Handler to call when a key is received. More...
 
virtual void PutString (const char *const STR_Out) const
 Output handler. More...
 
virtual void Beep (void) const
 Beep handler. More...
 
virtual void CleanScreen (void) const
 Clean screen. More...
 
- Public Member Functions inherited from NonBlockingIODevice
 NonBlockingIODevice (const char *const STR_DbgName, const bool B_AutoDelete)
 Main constructor. More...
 
virtual ~NonBlockingIODevice (void)
 Destructor. More...
 
- Public Member Functions inherited from IODevice
 IODevice (const char *const STR_DbgName, const bool B_AutoDelete)
 Constructor. More...
 
virtual ~IODevice (void)
 Destructor. More...
 
virtual const ResourceString GetLocation (void) const
 Input location accessor. More...
 
virtual const bool WouldInput (const IODevice &CLI_Device) const
 Stack overflow protection. More...
 
- Public Member Functions inherited from OutputDevice
const tk::String GetDebugName (void) const
 Debug name accessor. More...
 
const int UseInstance (const CallInfo &CLI_CallInfo)
 Ensures instance validity. More...
 
const int FreeInstance (const CallInfo &CLI_CallInfo)
 Releases the instance. More...
 
const int GetInstanceUsers (void) const
 Instance user count accessor. More...
 
const bool OpenUp (const CallInfo &CLI_CallInfo)
 Checks the device is opened. More...
 
const bool CloseDown (const CallInfo &CLI_CallInfo)
 Indicates the device the client does not need the device to opened anymore. More...
 
const int GetOpenUsers (void) const
 Open state user count accessor. More...
 
const OutputDeviceoperator<< (const std::string &STR_Out) const
 Output operator. More...
 
const OutputDeviceoperator<< (const tk::String &STR_Out) const
 Output operator. More...
 
const OutputDeviceoperator<< (const char *const STR_Out) const
 Output operator. More...
 
const OutputDeviceoperator<< (const char C_Out) const
 Output operator. More...
 
const OutputDeviceoperator<< (const KEY E_Key) const
 Output operator. More...
 
const OutputDeviceoperator<< (const uint8_t UI8_Out) const
 Output operator. More...
 
const OutputDeviceoperator<< (const int16_t I16_Out) const
 Output operator. More...
 
const OutputDeviceoperator<< (const uint16_t UI16_Out) const
 Output operator. More...
 
const OutputDeviceoperator<< (const int32_t I32_Out) const
 Output operator. More...
 
const OutputDeviceoperator<< (const uint32_t UI32_Out) const
 Output operator. More...
 
const OutputDeviceoperator<< (const int64_t I64_Out) const
 Output operator. More...
 
const OutputDeviceoperator<< (const uint64_t UI64_Out) const
 Output operator. More...
 
const OutputDeviceoperator<< (const float F_Out) const
 Output operator. More...
 
const OutputDeviceoperator<< (const double D_Out) const
 Output operator. More...
 
const OutputDeviceoperator<< (const void *const PV_Out) const
 Output operator. More...
 
const OutputDeviceoperator<< (const IOEndl &CLI_IOEndl) const
 Output operator. More...
 
const ResourceString GetLastError (void) const
 Last error accessor. More...
 
virtual const ScreenInfo GetScreenInfo (void) const
 Screen info accessor. More...
 
virtual const bool WouldOutput (const OutputDevice &CLI_Device) const
 Stack overflow protection. More...
 
- Public Member Functions inherited from Object
virtual ~Object (void)=0
 Pure virtual destructor. More...
 

Protected Member Functions

virtual const bool OpenDevice (void)
 Device opening handler. More...
 
virtual const bool CloseDevice (void)
 Device closure handler. More...
 
const bool ReceiveChars (void) const
 Characters received from the socket. More...
 
const bool ProcessKeys (void) const
 Processes input chars and converts them into keys one by one. More...
 
const bool CheckUp (void) const
 Checks whether the connection should still be up. More...
 
- Protected Member Functions inherited from NonBlockingIODevice
const ExecutionContext *const GetExecutionContext (void) const
 Returns the current execution context. More...
 
- Protected Member Functions inherited from IODevice
const KEY Char2Key (const int I_Char) const
 Common char translation. More...
 
- Protected Member Functions inherited from OutputDevice
 OutputDevice (const char *const STR_DbgName, const bool B_AutoDelete)
 Constructor. More...
 
virtual ~OutputDevice (void)
 Destructor. More...
 
- Protected Member Functions inherited from Object
 Object (void)
 Default constructor only available to sub-classes. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from IODevice
static IODeviceGetNullDevice (void)
 Null device singleton. More...
 
static IODeviceGetStdIn (void)
 Standard input device singleton. More...
 
- Static Public Member Functions inherited from OutputDevice
static OutputDeviceGetNullDevice (void)
 Null device singleton. More...
 
static OutputDeviceGetStdOut (void)
 Standard output device singleton. More...
 
static OutputDeviceGetStdErr (void)
 Standard error device singleton. More...
 
- Protected Attributes inherited from OutputDevice
ResourceString m_cliLastError
 

Detailed Description

Telnet connection input/output device.

Definition at line 142 of file telnet.h.

Constructor & Destructor Documentation

◆ TelnetConnection()

TelnetConnection::TelnetConnection ( TelnetServer *const  PCLI_Server,
const int  I_Socket,
const ResourceString::LANG  E_Lang,
const bool  B_AutoDelete 
)
explicit

Constructor.

Parameters
PCLI_ServerTelnet server instance reference. Can be NULL for stand alone connections.
I_SocketConnection socket handler.
E_LangDebugging language.
B_AutoDeleteAuto-deletion flag.

◆ ~TelnetConnection()

virtual TelnetConnection::~TelnetConnection ( void  )
virtual

Destructor.

Member Function Documentation

◆ Beep()

virtual void TelnetConnection::Beep ( void  ) const
virtual

Beep handler.

Reimplemented from OutputDevice.

◆ CheckUp()

const bool TelnetConnection::CheckUp ( void  ) const
protected

Checks whether the connection should still be up.

Returns
true if the connection is still up, false otherwise.

◆ CleanScreen()

virtual void TelnetConnection::CleanScreen ( void  ) const
virtual

Clean screen.

Reimplemented from OutputDevice.

◆ CloseDevice()

virtual const bool TelnetConnection::CloseDevice ( void  )
protectedvirtual

Device closure handler.

Returns
true for success, false otherwise.
Note
Devices have to be prepared to be called several times through this method. They should do the closure once only (unless they have been opened between CloseDevice() calls), and indicate no failure thereafter.

Implements OutputDevice.

◆ GetKey()

virtual const KEY TelnetConnection::GetKey ( void  ) const
virtual

Input key capture handler.

Warning
Blocking call.
Returns
KEY code captured.

Reimplemented from NonBlockingIODevice.

◆ OnKey()

virtual void TelnetConnection::OnKey ( const KEY  E_Key) const
virtual

Handler to call when a key is received.

Parameters
E_KeyInput key.

Reimplemented from NonBlockingIODevice.

◆ OpenDevice()

virtual const bool TelnetConnection::OpenDevice ( void  )
protectedvirtual

Device opening handler.

Returns
true for success, false otherwise.
Note
Devices have to be prepared to be called several times through this method. They should do the opening once only (unless they have been closed between OpendDevice() calls), and indicate no failure thereafter.

Implements OutputDevice.

◆ ProcessKeys()

const bool TelnetConnection::ProcessKeys ( void  ) const
protected

Processes input chars and converts them into keys one by one.

Returns
true if the connection is still up, false otherwise.

◆ PutString()

virtual void TelnetConnection::PutString ( const char *const  STR_Out) const
virtual

Output handler.

Parameters
STR_OutOutput string.

Implements OutputDevice.

◆ ReceiveChars()

const bool TelnetConnection::ReceiveChars ( void  ) const
protected

Characters received from the socket.

Returns
true for success, false otherwise.

The documentation for this class was generated from the following file: