Major Update:
- Merged SelectCore and PortCore into new SelectableCore Single well integrated Class - Rename SelectCore.h to SelectableCore.h - Create new TFileHandle structure for Ports/Sockets - Moved buffer and Input Timeout from FunctionCore to TFileHandle - Moved Read, Write and ProcessBuffer from FunctionCore to TFileHandle Bug Fixes: - malloc correct size for names - Calculate MaxFD correctly when closing FDs
This commit is contained in:
@@ -22,13 +22,7 @@ protected:
|
||||
// Function Definition
|
||||
char * Name;
|
||||
|
||||
// Input/Outputs
|
||||
CBuffer * Buffer;
|
||||
CFunctionCore *OutFunction;
|
||||
|
||||
// Input Timer
|
||||
timeval InStart;
|
||||
long InTimeout; // millisecs
|
||||
CFunctionCore * OutFunction;
|
||||
|
||||
public:
|
||||
// Life cycle
|
||||
@@ -36,20 +30,13 @@ public:
|
||||
virtual ~CFunctionCore();
|
||||
|
||||
// Manual Data Input/Output
|
||||
virtual int Input( int InputID, char * Buffer, int MaxLen );
|
||||
virtual int Output( int OutputID, char * Buffer, int Len );
|
||||
virtual int Input( int InputID, const char * Buffer, int MaxLen );
|
||||
virtual int Output( int OutputID, const char * Buffer, int Len );
|
||||
|
||||
// Automated Data Input/Output
|
||||
virtual bool AddInput( int InputID, CFunctionCore * OutFunction, int OutputID );
|
||||
virtual bool AddOutput( int OutputID, CFunctionCore * InFunction, int InputID );
|
||||
virtual bool Process();
|
||||
|
||||
// Device Interface
|
||||
virtual bool Read( int FD );
|
||||
virtual bool Write( int FD );
|
||||
virtual bool ProcessBuffer( bool Force ) = 0;
|
||||
|
||||
int WriteToFD( int FD, char * Data, int Len );
|
||||
virtual bool Process() = 0;
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user