Commit 44fe2a09 by yiannis

Added multi-include protection; rearranged header files

parent f32af94e
#ifndef _DAQBUFFER_H_
#define _DAQBUFFER_H_
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
/// ///
/// $Id: DaqBuffer.h,v 1.1 2005/03/14 18:30:48 yiannis Exp $ /// $Id: DaqBuffer.h,v 1.2 2005/03/14 23:05:03 yiannis Exp $
/// ///
/// Date: December 2004 /// Date: December 2004
/// ///
...@@ -200,3 +203,5 @@ CDaqBuffer::Clear(void) ...@@ -200,3 +203,5 @@ CDaqBuffer::Clear(void)
{ {
m_Data.clear(); m_Count = 0; m_Data.clear(); m_Count = 0;
} }
#endif // _DAQBUFFER_H_
\ No newline at end of file
#ifndef _DAQCHANNEL_H_
#define _DAQCHANNEL_H_
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
/// ///
...@@ -109,3 +111,6 @@ CDaqChannelInfo::GetRecSize(void) const ...@@ -109,3 +111,6 @@ CDaqChannelInfo::GetRecSize(void) const
{ {
return GetItemSize() * GetItemCount(); return GetItemSize() * GetItemCount();
} }
#endif // DAQCHANNEL_H_
\ No newline at end of file
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
/// ///
/// DAQ low level IO Library // DAQ low level IO Library
/// //
// $Id: DaqFileIO.cxx,v 1.9 2005/03/14 23:05:04 yiannis Exp $
// Date: March, 2005
// Author: Yiannis Papelis
//
/// \defgroup clib C++ Library /// \defgroup clib C++ Library
/// ///
/// @{ /// @{
/// ///
#include "DaqIo.h" #include "DaqIoLib.h"
#include <assert.h> #include <assert.h>
/// ///
......
...@@ -31,19 +31,21 @@ ...@@ -31,19 +31,21 @@
Name="VCCustomBuildTool"/> Name="VCCustomBuildTool"/>
<Tool <Tool
Name="VCLibrarianTool" Name="VCLibrarianTool"
OutputFile="$(OutDir)/DaqIOLib.lib"/> OutputFile="..\lib\DaqIOLibD.lib"/>
<Tool <Tool
Name="VCMIDLTool"/> Name="VCMIDLTool"/>
<Tool <Tool
Name="VCPostBuildEventTool" Name="VCPostBuildEventTool"
CommandLine="replace /U DaqBuffer.h ..\include CommandLine="replace /U DaqIoLibDefines.h ..\include
replace /U DaqBuffer.h ..\include
replace /U DaqIo.h ..\include replace /U DaqIo.h ..\include
replace /U DaqIoLib.h ..\include replace /U DaqIoLib.h ..\include
replace /U DaqChannelInfo.h ..\include replace /U DaqChannelInfo.h ..\include
replace /A DaqBuffer.h ..\include replace /A DaqBuffer.h ..\include
replace /A DaqIo.h ..\include replace /A DaqIo.h ..\include
replace /A DaqIoLib.h ..\include replace /A DaqIoLib.h ..\include
replace /A DaqChannelInfo.h ..\include"/> replace /A DaqChannelInfo.h ..\include
replace /A DaqIoLibDefines.h ..\include"/>
<Tool <Tool
Name="VCPreBuildEventTool"/> Name="VCPreBuildEventTool"/>
<Tool <Tool
...@@ -77,19 +79,21 @@ replace /A DaqChannelInfo.h ..\include"/> ...@@ -77,19 +79,21 @@ replace /A DaqChannelInfo.h ..\include"/>
Name="VCCustomBuildTool"/> Name="VCCustomBuildTool"/>
<Tool <Tool
Name="VCLibrarianTool" Name="VCLibrarianTool"
OutputFile="$(OutDir)/DaqIOLib.lib"/> OutputFile="..\lib\DaqIOLib.lib"/>
<Tool <Tool
Name="VCMIDLTool"/> Name="VCMIDLTool"/>
<Tool <Tool
Name="VCPostBuildEventTool" Name="VCPostBuildEventTool"
CommandLine="replace /U DaqBuffer.h ..\include CommandLine="replace /U DaqIoLibDefines.h ..\include
replace /U DaqBuffer.h ..\include
replace /U DaqIo.h ..\include replace /U DaqIo.h ..\include
replace /U DaqIoLib.h ..\include replace /U DaqIoLib.h ..\include
replace /U DaqChannelInfo.h ..\include replace /U DaqChannelInfo.h ..\include
replace /A DaqBuffer.h ..\include replace /A DaqBuffer.h ..\include
replace /A DaqIo.h ..\include replace /A DaqIo.h ..\include
replace /A DaqIoLib.h ..\include replace /A DaqIoLib.h ..\include
replace /A DaqChannelInfo.h ..\include"/> replace /A DaqChannelInfo.h ..\include
replace /A DaqIoLibDefines.h ..\include"/>
<Tool <Tool
Name="VCPreBuildEventTool"/> Name="VCPreBuildEventTool"/>
<Tool <Tool
...@@ -116,9 +120,6 @@ replace /A DaqChannelInfo.h ..\include"/> ...@@ -116,9 +120,6 @@ replace /A DaqChannelInfo.h ..\include"/>
<File <File
RelativePath=".\DaqFileIo.cxx"> RelativePath=".\DaqFileIo.cxx">
</File> </File>
<File
RelativePath=".\DaqIo.cxx">
</File>
</Filter> </Filter>
<Filter <Filter
Name="Header Files" Name="Header Files"
...@@ -136,6 +137,9 @@ replace /A DaqChannelInfo.h ..\include"/> ...@@ -136,6 +137,9 @@ replace /A DaqChannelInfo.h ..\include"/>
<File <File
RelativePath=".\DaqIoLib.h"> RelativePath=".\DaqIoLib.h">
</File> </File>
<File
RelativePath=".\DaqIoLibDefines.h">
</File>
</Filter> </Filter>
<Filter <Filter
Name="Resource Files" Name="Resource Files"
......
/////////////////////////////////////////////////////////////////////////////////////////////////// #ifndef _DAQIO_H_
/// #define _DAQIO_H_
///
///
#include <stdio.h>
#include <string>
#include <vector>
#include <map>
#include "DaqIoLib.h"
#include "DaqBuffer.h"
#include "DaqChannelInfo.h"
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
/// ///
...@@ -269,4 +258,4 @@ CDaqLowLevelIo::TocFileExists() const ...@@ -269,4 +258,4 @@ CDaqLowLevelIo::TocFileExists() const
return m_TocExists; return m_TocExists;
}; };
/// #endif // _DAQIO_H_
\ No newline at end of file \ No newline at end of file
using namespace std; ///////////////////////////////////////////////////////////////////////////
//
class CDaqBuffer; // $Id: DaqIoLib.h,v 1.2 2005/03/14 23:05:04 yiannis Exp $
class CDaqChannelInfo; // Date: March 2005
// Author: Yiannis Papelis
#define DAQ_MAGIC_NUM_VER_2_0 0x2C3D4E5F //
#define DAQ_MAGIC_NUM_VER_2_1 0x2C3D4E6F // Main include file for the DAQ I/O library
#define DAQ_MAGIC_NUM_VER_2_2 0x2C3D4E7F //
#define DAQ_END_MARK 0x1A2B2C3D #ifndef __DAQIOLIB_H__
#define DAQ_TOC_MAGIC_NUM 0x2C3ABCDE #define __DAQIOLIB_H__
typedef unsigned char TDaqByte; #include <stdio.h>
typedef vector<int> TIntVec; #include <string>
typedef vector<string> TStrVec; #include <vector>
typedef vector<CDaqBuffer> TDataVec; #include <map>
typedef vector<FILE *> TFileVec;
typedef vector<CDaqChannelInfo> TChanInfoVec;
const int cMaxDaqRec = 128*1024; ///< maximum size of data per DAQ record using namespace std;
const int cMaxChannels = 500; ///< maximum number of channels we can handle #include "DaqIoLibDefines.h"
const int cMaxChannResyncLookahead = 2*1024; #include "DaqBuffer.h"
#include "DaqChannelInfo.h"
/////////////////////////////////////////////////////////////////////////////////// #include "DaqIo.h"
///
/// This enumeration encapsulates various conversion options
/// Appropriate operators have been defined so combining options
/// can be done by using + or |
///
typedef enum {
eNO_OPTION = 0,
eEXPAND_DIFFERENTIAL = 1,
eFILL_MISSING = 2,
eINCLUDE_FRAME = 4,
eBINARY_FORMAT = 32,
eASCII_FORMAT = 64
} TConvertOptions;
inline TConvertOptions
operator+(TConvertOptions left, TConvertOptions right) {
return (TConvertOptions)((int)left + (int)right);
}
inline TConvertOptions
operator|(TConvertOptions left, TConvertOptions right) {
return (TConvertOptions)((int)left | (int)right);
}
///////////////////////////////////////////////////////////////////////////////////////////
///
/// Return code used to specify the status of the end marker of the DAQ file
///
typedef enum {
eDAQ_EOF_OK = 0, ///< Found full EOF marker
eDAQ_EOF_PARTIAL_MARK = 1, ///< Found a partial marker
eDAQ_EOF_NOTFOUND = 2, ///< No EOF marker found
eDAQ_EOF_UNDEFINED = 3 ///< No information available yet
} TDaqEofStatus;
#endif
\ No newline at end of file
#ifndef _DAQIOLIBDEFINES_H_
#define _DAQIOLIBDEFINES_H_
//////////////////////////////////////////////////////////////////////////////
//
// $Id: DaqIoLibDefines.h,v 1.1 2005/03/14 23:05:05 yiannis Exp $
// Date: March, 2005
// Author: Yiannis Papelis
//
// General definitions for the DAQIO library
//
class CDaqBuffer;
class CDaqChannelInfo;
#define DAQ_MAGIC_NUM_VER_2_0 0x2C3D4E5F
#define DAQ_MAGIC_NUM_VER_2_1 0x2C3D4E6F
#define DAQ_MAGIC_NUM_VER_2_2 0x2C3D4E7F
#define DAQ_END_MARK 0x1A2B2C3D
#define DAQ_TOC_MAGIC_NUM 0x2C3ABCDE
typedef unsigned char TDaqByte;
typedef vector<int> TIntVec;
typedef vector<string> TStrVec;
typedef vector<CDaqBuffer> TDataVec;
typedef vector<FILE *> TFileVec;
typedef vector<CDaqChannelInfo> TChanInfoVec;
const int cMaxDaqRec = 128*1024; ///< maximum size of data per DAQ record
const int cMaxChannels = 500; ///< maximum number of channels we can handle
const int cMaxChannResyncLookahead = 2*1024;
///////////////////////////////////////////////////////////////////////////////////
///
/// This enumeration encapsulates various conversion options
/// Appropriate operators have been defined so combining options
/// can be done by using + or |
///
typedef enum {
eNO_OPTION = 0,
eEXPAND_DIFFERENTIAL = 1,
eFILL_MISSING = 2,
eINCLUDE_FRAME = 4,
eBINARY_FORMAT = 32,
eASCII_FORMAT = 64
} TConvertOptions;
inline TConvertOptions
operator+(TConvertOptions left, TConvertOptions right) {
return (TConvertOptions)((int)left + (int)right);
}
inline TConvertOptions
operator|(TConvertOptions left, TConvertOptions right) {
return (TConvertOptions)((int)left | (int)right);
}
///////////////////////////////////////////////////////////////////////////////////////////
///
/// Return code used to specify the status of the end marker of the DAQ file
///
typedef enum {
eDAQ_EOF_OK = 0, ///< Found full EOF marker
eDAQ_EOF_PARTIAL_MARK = 1, ///< Found a partial marker
eDAQ_EOF_NOTFOUND = 2, ///< No EOF marker found
eDAQ_EOF_UNDEFINED = 3 ///< No information available yet
} TDaqEofStatus;
#endif //
\ No newline at end of file
/////////////////////////////////////////////////////////////////////////////
//
// DAQ IO Library
//
//
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment