Minor Update:
- BufferCore: Set BufSize as class constant - TimingCore: Add new function Timeout()
This commit is contained in:
@@ -21,7 +21,7 @@ class CBuffer
|
|||||||
private:
|
private:
|
||||||
// Buffer Definition
|
// Buffer Definition
|
||||||
char * Buffer; // Memory allocated to buffer
|
char * Buffer; // Memory allocated to buffer
|
||||||
int BufSize; // Size of allocated buffer
|
const int BufSize; // Size of allocated buffer
|
||||||
|
|
||||||
// Buffer pointers
|
// Buffer pointers
|
||||||
int BufStart; // First unread characters on buffer
|
int BufStart; // First unread characters on buffer
|
||||||
|
|||||||
@@ -49,3 +49,9 @@ long TimePassed( timeval StartTime )
|
|||||||
return Duration;
|
return Duration;
|
||||||
}
|
}
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
bool Timeout( timeval StartTime, long MilliSeconds )
|
||||||
|
{
|
||||||
|
return ((TimePassed(StartTime) > MilliSeconds)? true : false);
|
||||||
|
}
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
void SetInterval( timeval *Time, long MilliSeconds );
|
void SetInterval( timeval *Time, long MilliSeconds );
|
||||||
void SetStartTime( timeval *StartTime );
|
void SetStartTime( timeval *StartTime );
|
||||||
long TimePassed( timeval StartTime );
|
long TimePassed( timeval StartTime );
|
||||||
|
bool Timeout( timeval StartTime, long MilliSeconds );
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user