diff --git a/ApplicationCore.cpp b/ApplicationCore.cpp index f0b0911..06eaddc 100644 --- a/ApplicationCore.cpp +++ b/ApplicationCore.cpp @@ -5,16 +5,14 @@ * Author: wentzelc */ +// Standard C/C++ Libraries +/* none */ + // redA Libraries #include "ApplicationCore.h" #include "WatchdogCore.h" #include "FileCore.h" -// Standard C/C++ Libraries -#include -#include -#include - //--------------------------------------------------------------------------- // Global Vars diff --git a/ApplicationCore.h b/ApplicationCore.h index 0702b05..5c22fd0 100644 --- a/ApplicationCore.h +++ b/ApplicationCore.h @@ -8,6 +8,9 @@ #ifndef REDACORE_APPLICATIONCORE_H_ #define REDACORE_APPLICATIONCORE_H_ +// Standard C/C++ Libraries +/* none */ + // redA Libraries #include "SignalCore.h" #include "TimingCore.h" @@ -17,10 +20,6 @@ #include "FunctionCore.h" #include "SelectableCore.h" -// Standard C/C++ Libraries -#include -#include - //--------------------------------------------------------------------------- // Preview diff --git a/BufferCore.h b/BufferCore.h deleted file mode 100644 index ee37b26..0000000 --- a/BufferCore.h +++ /dev/null @@ -1,130 +0,0 @@ -/* - * BufferCore.h - * - * Created on: 18 May 2016 - * Author: wentzelc - */ - -#ifndef REDACORE_BUFFERCORE_H_ -#define REDACORE_BUFFERCORE_H_ - -// redA Libraries -/* none */ - -// Standard C/C++ Libraries -/* none */ - -//--------------------------------------------------------------------------- - -/** Shift and Rolling buffer class - * - * Shifting buffer: - * Data is either set at start of buffer or appended to buffer - * Start of buffered data is always at beginning of buffer - * Never rolls over (option to over overwrite if data longer than buffer) - * Shifts unsused data to left when clearing used data - * Always zero terminates buffer - * Can look directly at buffer - * - * Rolling buffer: - * Data is continuosly assigned to buffer - * Start of buffer is tracked by references (can be anywhere) - * Data rolls over to start of buffer if end of buffer reached (option to overwrite start) - * Data is never shifted/moved inside buffer, only references are adjusted - * Never zero terminates buffer - * Can only look at data by copying (stitching) to another buffer - */ - -class CRollingBuffer -{ -private: - // Buffer Definition - char * Buffer; // Memory allocated to buffer - const int BufSize; // Size of allocated buffer - int BufLen; // Total unread characters in buffer - - // Temporary output buffer - char * OutBuffer; // Temporary output buffer for "stitched" (rollover) data - - // Buffer pointers - int BufStart; // First unread characters in buffer - int BufEnd; // Next write position for new data (End of unread data + 1) - -public: - // Life Cycle - CRollingBuffer( int BufferSize ); - ~CRollingBuffer(); - - // Direct Operations - int Reset(); // Clear buffer and reset all pointers to start of buffer - - // Reading from buffer - char PeekChar( int Pos = 0 ); // Return one character from buffer (do not remove from buffer - int PeekDirect( char ** Data, int PeekPos = 0 ); // Return contiguous data pointer direct to buffer (continguous data couont returned) - int Peek( char ** Data, int PeekPos = 0, int MaxLen = -1 ); // Return stiched data copied to temporary output buffer - int PeekCopy( char ** Data, int PeekPos = 0, int MaxLen = -1 ); // Return stiched data copied to supplied pointer (create if not exist) - - bool FindStr( const char * SearchStr, int SearchLen, int &FoundPos, int StartPos = 0 ); // Search buffer directly - - // Change data on buffer - int Push( bool Overwrite, const char * Data, int Len = -1 ); - int Clear( int ClearLen = -1 ); - - int Pop( char ** Data, int MaxLen = -1 ); - int PopCopy( char ** Data, int MaxLen = -1 ); - - // File operations - int ReadFromFD( int Handle, int MaxRead = -1, bool Overwrite = false ); - int WriteToFD( int Handle, int MaxWrite = -1 ); - - // Miscellaneous - int Size() { return BufSize; }; - int Len() { return BufLen; }; -}; -//--------------------------------------------------------------------------- - -class CShiftBuffer -{ -private: - // Buffer Definition - char * Buffer; // Memory allocated to buffer - const int BufSize; // Size of allocated buffer - int BufLen; // Total unread characters in buffer - - // Temporary output buffer - char * OutBuffer; // Temporary output buffer for "stitched" (rollover) data - -public: - // Life Cycle - CShiftBuffer( int BufferSize ); - ~CShiftBuffer(); - - // Direct Operations - int Reset(); // Clear buffer and reset all pointers to start of buffer - - // Reading from buffer - char PeekChar( int Pos = 0 ); // Return one character from buffer (do not remove from buffer - int PeekDirect( char ** Data, int PeekPos = 0 ); // Return contiguous data pointer direct to buffer (continguous data couont returned) - int Peek( char ** Data, int PeekPos = 0, int MaxLen = -1 ); // Return stiched data copied to temporary output buffer - int PeekCopy( char ** Data, int PeekPos = 0, int MaxLen = -1 ); // Return stiched data copied to supplied pointer (create if not exist) - - bool FindStr( const char * SearchStr, int SearchLen, int &FoundPos, int StartPos = 0 ); // Search buffer directly - - // Change data on buffer - int Push( bool Overwrite, const char * Data, int Len = -1 ); - int Clear( int ClearLen = -1 ); - - int Pop( char ** Data, int MaxLen = -1 ); - int PopCopy( char ** Data, int MaxLen = -1 ); - - // File operations - int ReadFromFD( int Handle, int MaxRead = -1, bool Overwrite = false ); - int WriteToFD( int Handle, int MaxWrite = -1 ); - - // Miscellaneous - int Size() { return BufSize; }; - int Len() { return BufLen; }; -}; -//--------------------------------------------------------------------------- - -#endif /* REDACORE_BUFFERCORE_H_ */ diff --git a/CMakeLists.txt b/CMakeLists.txt index e6a5b87..7c5ebd9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ PROJECT(lib_redAcore) -ADD_LIBRARY(redAcore TimingCore.cpp DateTimeCore.cpp LogCore.cpp SignalCore.cpp DataTreeCore.cpp JSONparseCore.cpp BufferCore.cpp LiteProtocolCore.cpp +ADD_LIBRARY(redAcore TimingCore.cpp DateTimeCore.cpp LogCore.cpp SignalCore.cpp DataTreeCore.cpp JSONparseCore.cpp CharBufferCore.cpp LiteProtocolCore.cpp ApplicationCore.cpp FunctionCore.cpp FileCore.cpp SelectCore.cpp SelectableCore.cpp WatchdogCore.cpp DeviceCore.cpp ) diff --git a/BufferCore.cpp b/CharBufferCore.cpp similarity index 91% rename from BufferCore.cpp rename to CharBufferCore.cpp index 65f1667..0798807 100644 --- a/BufferCore.cpp +++ b/CharBufferCore.cpp @@ -1,25 +1,24 @@ /* - * BufferCore.cpp + * CharBufferCore.cpp * * Created on: 18 May 2016 * Author: wentzelc */ -// redA Libraries -#include "BufferCore.h" - // Standard C/C++ Libraries -#include #include #include #include #include +// redA Libraries +#include "CharBufferCore.h" + //--------------------------------------------------------------------------- -/***** Rolling Buffer *****/ +/***** Char Buffer *****/ -CRollingBuffer::CRollingBuffer( int BufferSize ) : BufSize( BufferSize ) +CCharBuffer::CCharBuffer( int BufferSize ) : BufSize( BufferSize ) { // Create Buffer if (BufSize) @@ -38,13 +37,11 @@ CRollingBuffer::CRollingBuffer( int BufferSize ) : BufSize( BufferSize ) } // Set pointers - BufStart = 0; - BufEnd = 0; BufLen = 0; } //--------------------------------------------------------------------------- -CRollingBuffer::~CRollingBuffer() +CCharBuffer::~CCharBuffer() { // Destroy Buffer if (Buffer) { @@ -57,19 +54,68 @@ CRollingBuffer::~CRollingBuffer() //--------------------------------------------------------------------------- // Clear all data from buffer -int CRollingBuffer::Reset() +int CCharBuffer::Reset() { int BytesCleared = 0; - // Clear buffer + // Reset buffer BytesCleared = BufLen; + BufLen = 0; + Buffer[0] = 0; + return BytesCleared; +} +//--------------------------------------------------------------------------- + +// Read first-in bytes from buffer +// Return "stitched" buffer data in temporary buffer +int CCharBuffer::Pop( char ** Data, int MaxLen ) +{ + int BytesWritten = 0; + + // Read & clear data + BytesWritten = Peek( Data, 0, MaxLen ); + Clear( BytesWritten ); + + // Return temp buffer + return BytesWritten; +} +//--------------------------------------------------------------------------- + +// Read first-in bytes from buffer +// Return "stitched" buffer data copied to pointer which if created if NULL +int CCharBuffer::PopCopy( char ** Data, int MaxLen ) +{ + int BytesWritten = 0; + + // Copy & clear data + BytesWritten = PeekCopy( Data, 0, MaxLen ); + Clear( BytesWritten ); + + // Return temp buffer + return BytesWritten; +} +//--------------------------------------------------------------------------- + + +/***** Rolling Buffer *****/ + +CRollingBuffer::CRollingBuffer( int BufferSize ) : CCharBuffer( BufferSize ) +{ + // Set pointers + BufStart = 0; + BufEnd = 0; +} +//--------------------------------------------------------------------------- + +// Clear all data from buffer +int CRollingBuffer::Reset() +{ // Reset pointers BufStart = 0; BufEnd = 0; - BufLen = 0; - return BytesCleared; + return CCharBuffer::Reset(); } //--------------------------------------------------------------------------- @@ -357,36 +403,6 @@ int CRollingBuffer::Push( bool Overwrite, const char * Data, int Len ) } //--------------------------------------------------------------------------- -// Read first-in bytes from buffer -// Return "stitched" buffer data in temporary buffer -int CRollingBuffer::Pop( char ** Data, int MaxLen ) -{ - int BytesWritten = 0; - - // Read & clear data - BytesWritten = Peek( Data, 0, MaxLen ); - Clear( BytesWritten ); - - // Return temp buffer - return BytesWritten; -} -//--------------------------------------------------------------------------- - -// Read first-in bytes from buffer -// Return "stitched" buffer data copied to pointer which if created if NULL -int CRollingBuffer::PopCopy( char ** Data, int MaxLen ) -{ - int BytesWritten = 0; - - // Copy & clear data - BytesWritten = PeekCopy( Data, 0, MaxLen ); - Clear( BytesWritten ); - - // Return temp buffer - return BytesWritten; -} -//--------------------------------------------------------------------------- - // Read File descriptor directly into rolling buffer int CRollingBuffer::ReadFromFD( int Handle, int MaxRead, bool Overwrite ) { @@ -476,52 +492,9 @@ int CRollingBuffer::WriteToFD( int Handle, int MaxLen ) /***** Shifting Buffer *****/ -CShiftBuffer::CShiftBuffer( int BufferSize ) : BufSize( BufferSize ) +CShiftBuffer::CShiftBuffer( int BufferSize ) : + CCharBuffer( BufferSize ) { - // Create Buffer - if (BufSize) - { - // Create Buffer - Buffer = (char *)malloc( BufSize+1 ); - Buffer[0] = 0; - - // Create temp output buffer big enough to handle all data - OutBuffer = (char *)malloc( BufSize+1 ); - } - else { - // No buffers created - Buffer = NULL; - OutBuffer = NULL; - } - - // Set vars - BufLen = 0; -} -//--------------------------------------------------------------------------- - -CShiftBuffer::~CShiftBuffer() -{ - // Destroy Buffer - if (Buffer) { - free( Buffer ); - } - if (OutBuffer) { - free( OutBuffer ); - } -} -//--------------------------------------------------------------------------- - -// Clear all data from buffer -int CShiftBuffer::Reset() -{ - int BytesCleared = 0; - - // Reset buffer - BytesCleared = BufLen; - BufLen = 0; - Buffer[0] = 0; - - return BytesCleared; } //--------------------------------------------------------------------------- @@ -749,35 +722,6 @@ int CShiftBuffer::Push( bool Overwrite, const char * Data, int Len ) } //--------------------------------------------------------------------------- -// Read first-in bytes from buffer -// Return "stitched" buffer data in temporary buffer -int CShiftBuffer::Pop( char ** Data, int MaxLen ) -{ - int BytesWritten = 0; - - // Read and clear bytes - BytesWritten = Peek( Data, 0, MaxLen ); - Clear( BytesWritten ); - - return BytesWritten; -} -//--------------------------------------------------------------------------- - -// Read first-in bytes from buffer -// Return "stitched" buffer data copied to pointer which if created if NULL -int CShiftBuffer::PopCopy( char ** Data, int MaxLen ) -{ - int BytesWritten = 0; - - // Copy and clear bytes - BytesWritten = PeekCopy( Data, 0, MaxLen ); - Clear( BytesWritten ); - - // Return temp buffer - return BytesWritten; -} -//--------------------------------------------------------------------------- - // Read File descriptor directly into buffer int CShiftBuffer::ReadFromFD( int Handle, int MaxRead, bool Overwrite ) { diff --git a/CharBufferCore.h b/CharBufferCore.h new file mode 100644 index 0000000..dfd6aba --- /dev/null +++ b/CharBufferCore.h @@ -0,0 +1,146 @@ +/* + * CharBufferCore.h + * + * Created on: 18 May 2016 + * Author: wentzelc + */ + +#ifndef REDACORE_CHARBUFFERCORE_H_ +#define REDACORE_CHARBUFFERCORE_H_ + +// Standard C/C++ Libraries +/* none */ + +// redA Libraries +/* none */ + +//--------------------------------------------------------------------------- + +/** Shift and Rolling buffer class + * + * Char Buffer: + * Virtual definition of core parameters and buffer interface + * + * Shifting buffer: + * Data is either set at start of buffer or appended to buffer + * Start of buffered data is always at beginning of buffer + * Never rolls over (option to over overwrite if data longer than buffer) + * Shifts unsused data to left when clearing used data + * Always zero terminates buffer + * Can look directly at buffer + * + * Rolling buffer: + * Data is continuosly assigned to buffer + * Start of buffer is tracked by references (can be anywhere) + * Data rolls over to start of buffer if end of buffer reached (option to overwrite start) + * Data is never shifted/moved inside buffer, only references are adjusted + * Never zero terminates buffer + * Can only look at data by copying (stitching) to another buffer + */ + +//--------------------------------------------------------------------------- + +class CCharBuffer +{ +protected: + // Buffer Definition + char * Buffer; // Memory allocated to buffer + const int BufSize; // Size of allocated buffer + int BufLen; // Total unread characters in buffer + + // Temporary output buffer + char * OutBuffer; // Temporary output buffer for "stitched" (rollover) data + +public: + // Life Cycle + CCharBuffer( int BufferSize ); + virtual ~CCharBuffer(); + + // Direct Operations + virtual int Reset(); // Clear buffer and reset all pointers to start of buffer + + // Reading from buffer + virtual char PeekChar( int Pos = 0 ) = 0; // Return one character from buffer (do not remove from buffer + virtual int PeekDirect( char ** Data, int PeekPos = 0 ) = 0; // Return contiguous data pointer direct to buffer (continguous data couont returned) + virtual int Peek( char ** Data, int PeekPos = 0, int MaxLen = -1 ) = 0; // Return stiched data copied to temporary output buffer + virtual int PeekCopy( char ** Data, int PeekPos = 0, int MaxLen = -1 ) = 0; // Return stiched data copied to supplied pointer (create if not exist) + + virtual bool FindStr( const char * SearchStr, int SearchLen, int &FoundPos, int StartPos = 0 ) = 0; // Search buffer directly + + // Change data on buffer + virtual int Push( bool Overwrite, const char * Data, int Len = -1 ) = 0; // Add Bytes to the end of the buffer + virtual int Clear( int ClearLen = -1 ) = 0; // Clear Bytes from start of buffer + + virtual int Pop( char ** Data, int MaxLen = -1 ); // Read and remove bytes from start of buffer + virtual int PopCopy( char ** Data, int MaxLen = -1 ); // Same as Pop() except it returns a copy of the bytes in a new pointer + + // File operations + virtual int ReadFromFD( int Handle, int MaxRead = -1, bool Overwrite = false ) = 0; // Read directly from file descriptor into buffer (speed advantage) + virtual int WriteToFD( int Handle, int MaxWrite = -1 ) = 0; // Write directly to file descriptor from buffer (speed advantage) + + // Miscellaneous + int Size() { return BufSize; }; // Returns number of total size of buffer (used and empty) + int Len() { return BufLen; }; // Returns number of bytes stored in buffer +}; + +//--------------------------------------------------------------------------- + +class CRollingBuffer : public CCharBuffer +{ +protected: + // Buffer pointers + int BufStart; // First unread characters in buffer + int BufEnd; // Next write position for new data (End of unread data + 1) + +public: + // Life Cycle + CRollingBuffer( int BufferSize ); + virtual ~CRollingBuffer() {}; + + // Direct Operations + virtual int Reset(); + + // Reading from buffer + virtual char PeekChar( int Pos = 0 ); + virtual int PeekDirect( char ** Data, int PeekPos = 0 ); + virtual int Peek( char ** Data, int PeekPos = 0, int MaxLen = -1 ); + virtual int PeekCopy( char ** Data, int PeekPos = 0, int MaxLen = -1 ); + + virtual bool FindStr( const char * SearchStr, int SearchLen, int &FoundPos, int StartPos = 0 ); + + // Change data on buffer + virtual int Push( bool Overwrite, const char * Data, int Len = -1 ); + virtual int Clear( int ClearLen = -1 ); + + // File operations + virtual int ReadFromFD( int Handle, int MaxRead = -1, bool Overwrite = false ); + virtual int WriteToFD( int Handle, int MaxWrite = -1 ); +}; +//--------------------------------------------------------------------------- + +class CShiftBuffer : public CCharBuffer +{ +public: + // Life Cycle + CShiftBuffer( int BufferSize ); + virtual ~CShiftBuffer() {}; + + // Reading from buffer + virtual char PeekChar( int Pos = 0 ); + virtual int PeekDirect( char ** Data, int PeekPos = 0 ); + virtual int Peek( char ** Data, int PeekPos = 0, int MaxLen = -1 ); + virtual int PeekCopy( char ** Data, int PeekPos = 0, int MaxLen = -1 ); + + virtual bool FindStr( const char * SearchStr, int SearchLen, int &FoundPos, int StartPos = 0 ); + + // Change data on buffer + virtual int Push( bool Overwrite, const char * Data, int Len = -1 ); + virtual int Clear( int ClearLen = -1 ); + + // File operations + virtual int ReadFromFD( int Handle, int MaxRead = -1, bool Overwrite = false ); + virtual int WriteToFD( int Handle, int MaxWrite = -1 ); +}; +//--------------------------------------------------------------------------- + +#endif /* REDACORE_CHARBUFFERCORE_H_ */ diff --git a/DataTreeCore.cpp b/DataTreeCore.cpp index e657cbf..69a116a 100644 --- a/DataTreeCore.cpp +++ b/DataTreeCore.cpp @@ -5,15 +5,12 @@ * Author: wentzelc */ -// redA Libraries -#include "DataTreeCore.h" - // Standard C/C++ Libraries #include -#include #include -#include -#include + +// redA Libraries +#include "DataTreeCore.h" //--------------------------------------------------------------------------- diff --git a/DataTreeCore.h b/DataTreeCore.h index 6eb3050..54dc1fe 100644 --- a/DataTreeCore.h +++ b/DataTreeCore.h @@ -8,14 +8,11 @@ #ifndef REDACORE_DATATREECORE_H_ #define REDACORE_DATATREECORE_H_ -// redA Libraries -#include - // Standard C/C++ Libraries #include -#include -#include -#include + +// redA Libraries +#include "CharBufferCore.h" //--------------------------------------------------------------------------- diff --git a/DateTimeCore.cpp b/DateTimeCore.cpp index 55df337..9eb5a5a 100644 --- a/DateTimeCore.cpp +++ b/DateTimeCore.cpp @@ -5,16 +5,14 @@ * Author: wentzelc */ -// redA Libraries -#include "DateTimeCore.h" - // Standard C/C++ Libraries #include #include -#include -#include #include +// redA Libraries +#include "DateTimeCore.h" + //--------------------------------------------------------------------------- // Variable used to temp values with diff --git a/DateTimeCore.h b/DateTimeCore.h index bfaaf60..713ae86 100644 --- a/DateTimeCore.h +++ b/DateTimeCore.h @@ -8,12 +8,12 @@ #ifndef REDACORE_DATETIMECORE_H_ #define REDACORE_DATETIMECORE_H_ -// redA Libraries -/* none */ - // Standard C/C++ Libraries #include +// redA Libraries +/* none */ + //--------------------------------------------------------------------------- // Get and set System Date and Time diff --git a/DeviceCore.cpp b/DeviceCore.cpp index 5099726..5426870 100644 --- a/DeviceCore.cpp +++ b/DeviceCore.cpp @@ -8,12 +8,7 @@ //--------------------------------------------------------------------------- // Standard C/C++ Libraries -#include -#include -#include -#include -#include -#include +/* none */ // redA Libraries #include "ApplicationCore.h" diff --git a/DeviceCore.h b/DeviceCore.h index 1856857..55fff74 100644 --- a/DeviceCore.h +++ b/DeviceCore.h @@ -8,12 +8,12 @@ #ifndef REDACORE_DEVICECORE_H_ #define REDACORE_DEVICECORE_H_ -// redA Libraries -#include "FunctionCore.h" - // Standard C/C++ Libraries /* none */ +// redA Libraries +#include "FunctionCore.h" + //--------------------------------------------------------------------------- // Enumerated types diff --git a/FileCore.cpp b/FileCore.cpp index 5920dbf..ecf681b 100644 --- a/FileCore.cpp +++ b/FileCore.cpp @@ -5,19 +5,15 @@ * Author: wentzelc */ -// redA Libraries -#include "ApplicationCore.h" -#include "FileCore.h" - // Standard C/C++ Libraries -#include -#include -#include -#include #include #include #include +// redA Libraries +#include "ApplicationCore.h" +#include "FileCore.h" + //--------------------------------------------------------------------------- // Global Vars diff --git a/FileCore.h b/FileCore.h index a150ac1..119344c 100644 --- a/FileCore.h +++ b/FileCore.h @@ -8,12 +8,12 @@ #ifndef JOANETELEMETRY_FILECORE_H_ #define JOANETELEMETRY_FILECORE_H_ -// redA Libraries -#include "FunctionCore.h" - // Standard C/C++ Libraries /* none */ +// redA Libraries +#include "FunctionCore.h" + //--------------------------------------------------------------------------- const int NO_FD = -1; diff --git a/FunctionCore.cpp b/FunctionCore.cpp index 3832f5e..bc00f5a 100644 --- a/FunctionCore.cpp +++ b/FunctionCore.cpp @@ -5,15 +5,13 @@ * Author: wentzelc */ +// Standard C/C++ Libraries +/* none */ + // redA Libraries #include "ApplicationCore.h" #include "FunctionCore.h" -// Standard C/C++ Libraries -#include -#include -#include - //--------------------------------------------------------------------------- // Global Vars diff --git a/FunctionCore.h b/FunctionCore.h index dee06fc..448a2b7 100644 --- a/FunctionCore.h +++ b/FunctionCore.h @@ -8,14 +8,14 @@ #ifndef REDACORE_FUNCTIONCORE_H_ #define REDACORE_FUNCTIONCORE_H_ +// Standard C/C++ Libraries +/* none */ + // redA Libraries #include "LogCore.h" -#include "BufferCore.h" #include "DataTreeCore.h" +#include "CharBufferCore.h" -// Standard C/C++ Libraries -#include -#include //--------------------------------------------------------------------------- diff --git a/JSONparseCore.cpp b/JSONparseCore.cpp index 9c27c66..db87436 100644 --- a/JSONparseCore.cpp +++ b/JSONparseCore.cpp @@ -5,16 +5,14 @@ * Author: wentzelc */ -// redA Libraries -#include "JSONparseCore.h" - // Standard C/C++ Libraries #include -#include -#include #include #include +// redA Libraries +#include "JSONparseCore.h" + //--------------------------------------------------------------------------- CJSONparse::CJSONparse( CDataTree * pDataTree ) diff --git a/JSONparseCore.h b/JSONparseCore.h index 70ff2c9..19ac3f4 100644 --- a/JSONparseCore.h +++ b/JSONparseCore.h @@ -8,15 +8,13 @@ #ifndef REDACORE_JSONPARSECORE_H_ #define REDACORE_JSONPARSECORE_H_ -// redA Libraries -#include -#include - // Standard C/C++ Libraries -#include #include #include -#include + +// redA Libraries +#include "DataTreeCore.h" +#include "CharBufferCore.h" //--------------------------------------------------------------------------- diff --git a/LogCore.cpp b/LogCore.cpp index 1de900b..4e3b72a 100644 --- a/LogCore.cpp +++ b/LogCore.cpp @@ -5,17 +5,14 @@ * Author: wentzelc */ +// Standard C/C++ Libraries +#include +#include + // redA Libraries #include "LogCore.h" #include "DateTimeCore.h" -// Standard C/C++ Libraries -#include -#include -#include -#include -#include - //--------------------------------------------------------------------------- // Global vars diff --git a/LogCore.h b/LogCore.h index b93bdd6..1506c7b 100644 --- a/LogCore.h +++ b/LogCore.h @@ -8,12 +8,12 @@ #ifndef REDACORE_LOGCORE_H_ #define REDACORE_LOGCORE_H_ -// redA Libraries -/* none */ - // Standard C/C++ Libraries #include +// redA Libraries +/* none */ + //--------------------------------------------------------------------------- // Debug options diff --git a/SelectCore.cpp b/SelectCore.cpp index 2914a9f..56a652a 100644 --- a/SelectCore.cpp +++ b/SelectCore.cpp @@ -5,16 +5,13 @@ * Author: wentzelc */ +// Standard C/C++ Libraries +/* none */ + // redA Libraries #include "ApplicationCore.h" #include "SelectableCore.h" -// Standard C/C++ Libraries -#include -#include -#include -#include - //--------------------------------------------------------------------------- // Global Vars diff --git a/SelectableCore.cpp b/SelectableCore.cpp index 25b6bb7..a5cb8f6 100644 --- a/SelectableCore.cpp +++ b/SelectableCore.cpp @@ -5,15 +5,8 @@ * Author: wentzelc */ -// redA Libraries -#include "ApplicationCore.h" -#include "SelectableCore.h" - // Standard C/C++ Libraries -#include #include -#include -#include #include #include @@ -28,6 +21,10 @@ #include #include +// redA Libraries +#include "ApplicationCore.h" +#include "SelectableCore.h" + //--------------------------------------------------------------------------- // Global Vars diff --git a/SelectableCore.h b/SelectableCore.h index 0aa55a9..f1f6448 100644 --- a/SelectableCore.h +++ b/SelectableCore.h @@ -9,9 +9,7 @@ #define REDACORE_SELECTABLECORE_H_ // Standard C/C++ Libraries -#include -#include -#include +/* none */ // redA Libraries #include "FunctionCore.h" diff --git a/SignalCore.cpp b/SignalCore.cpp index e593b78..748304b 100644 --- a/SignalCore.cpp +++ b/SignalCore.cpp @@ -5,18 +5,14 @@ * Author: wentzelc */ +// Standard C/C++ Libraries +#include +#include + // redA Libraries #include "ApplicationCore.h" #include "SignalCore.h" -// Standard C/C++ Libraries -#include -#include -#include -#include - -#include - //--------------------------------------------------------------------------- // Global vars diff --git a/SignalCore.h b/SignalCore.h index 1df30a4..beb4ae7 100644 --- a/SignalCore.h +++ b/SignalCore.h @@ -8,10 +8,10 @@ #ifndef REDACORE_SIGNALCORE_H_ #define REDACORE_SIGNALCORE_H_ -// redA Libraries +// Standard C/C++ Libraries /* none */ -// Standard C/C++ Libraries +// redA Libraries /* none */ //--------------------------------------------------------------------------- diff --git a/TimingCore.cpp b/TimingCore.cpp index 9448c99..b9e2b94 100644 --- a/TimingCore.cpp +++ b/TimingCore.cpp @@ -5,14 +5,12 @@ * Author: wentzelc */ +// Standard C/C++ Libraries +#include + // redA Libraries #include "TimingCore.h" -// Standard C/C++ Libraries -#include -#include -#include - //--------------------------------------------------------------------------- // Set time diff --git a/TimingCore.h b/TimingCore.h index f9b97ba..87f1150 100644 --- a/TimingCore.h +++ b/TimingCore.h @@ -8,12 +8,12 @@ #ifndef REDACORE_TIMINGCORE_H_ #define REDACORE_TIMINGCORE_H_ -// redA Libraries -/* none */ - // Standard C/C++ Libraries #include +// redA Libraries +/* none */ + //--------------------------------------------------------------------------- // Manage as Interval diff --git a/WatchdogCore.cpp b/WatchdogCore.cpp index 6e6f5ae..4e5847c 100644 --- a/WatchdogCore.cpp +++ b/WatchdogCore.cpp @@ -5,17 +5,13 @@ * Author: wentzelc */ +// Standard C/C++ Libraries +/* none */ + // redA Libraries #include "ApplicationCore.h" #include "WatchdogCore.h" -// Standard C/C++ Libraries -#include -#include -#include -#include -#include - //--------------------------------------------------------------------------- // Global vars diff --git a/WatchdogCore.h b/WatchdogCore.h index c45bb31..7b9a802 100644 --- a/WatchdogCore.h +++ b/WatchdogCore.h @@ -8,13 +8,13 @@ #ifndef REDACORE_WATCHDOGCORE_H_ #define REDACORE_WATCHDOGCORE_H_ +// Standard C/C++ Libraries +/* none */ + // redA Libraries #include "SelectableCore.h" #include "LiteProtocolCore.h" -// Standard C/C++ Libraries -/*none*/ - //--------------------------------------------------------------------------- class CWatchdogCore : public CSelectableCore