Minor Update:

- BufferCore: Set BufSize as class constant
- TimingCore: Add new function Timeout()
This commit is contained in:
Charl Wentzel
2016-06-02 09:36:08 +02:00
parent 59facdf1bd
commit 630583bbc6
3 changed files with 9 additions and 2 deletions

View File

@@ -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

View File

@@ -49,3 +49,9 @@ long TimePassed( timeval StartTime )
return Duration; return Duration;
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
bool Timeout( timeval StartTime, long MilliSeconds )
{
return ((TimePassed(StartTime) > MilliSeconds)? true : false);
}
//---------------------------------------------------------------------------

View File

@@ -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 );
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------