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
///
......@@ -200,3 +203,5 @@ CDaqBuffer::Clear(void)
{
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
{
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
///
/// @{
///
#include "DaqIo.h"
#include "DaqIoLib.h"
#include <assert.h>
///
......
......@@ -31,19 +31,21 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="$(OutDir)/DaqIOLib.lib"/>
OutputFile="..\lib\DaqIOLibD.lib"/>
<Tool
Name="VCMIDLTool"/>
<Tool
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 DaqIoLib.h ..\include
replace /U DaqChannelInfo.h ..\include
replace /A DaqBuffer.h ..\include
replace /A DaqIo.h ..\include
replace /A DaqIoLib.h ..\include
replace /A DaqChannelInfo.h ..\include"/>
replace /A DaqChannelInfo.h ..\include
replace /A DaqIoLibDefines.h ..\include"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
......@@ -77,19 +79,21 @@ replace /A DaqChannelInfo.h ..\include"/>
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="$(OutDir)/DaqIOLib.lib"/>
OutputFile="..\lib\DaqIOLib.lib"/>
<Tool
Name="VCMIDLTool"/>
<Tool
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 DaqIoLib.h ..\include
replace /U DaqChannelInfo.h ..\include
replace /A DaqBuffer.h ..\include
replace /A DaqIo.h ..\include
replace /A DaqIoLib.h ..\include
replace /A DaqChannelInfo.h ..\include"/>
replace /A DaqChannelInfo.h ..\include
replace /A DaqIoLibDefines.h ..\include"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
......@@ -116,9 +120,6 @@ replace /A DaqChannelInfo.h ..\include"/>
<File
RelativePath=".\DaqFileIo.cxx">
</File>
<File
RelativePath=".\DaqIo.cxx">
</File>
</Filter>
<Filter
Name="Header Files"
......@@ -136,6 +137,9 @@ replace /A DaqChannelInfo.h ..\include"/>
<File
RelativePath=".\DaqIoLib.h">
</File>
<File
RelativePath=".\DaqIoLibDefines.h">
</File>
</Filter>
<Filter
Name="Resource Files"
......
///////////////////////////////////////////////////////////////////////////////////////////////////
///
///
///
#include <stdio.h>
#include <string>
#include <vector>
#include <map>
#include "DaqIoLib.h"
#include "DaqBuffer.h"
#include "DaqChannelInfo.h"
#ifndef _DAQIO_H_
#define _DAQIO_H_
/////////////////////////////////////////////////////////////////////////////
///
......@@ -269,4 +258,4 @@ CDaqLowLevelIo::TocFileExists() const
return m_TocExists;
};
///
\ No newline at end of file
#endif // _DAQIO_H_
\ No newline at end of file
using namespace std;
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;
///////////////////////////////////////////////////////////////////////////
//
// $Id: DaqIoLib.h,v 1.2 2005/03/14 23:05:04 yiannis Exp $
// Date: March 2005
// Author: Yiannis Papelis
//
// Main include file for the DAQ I/O library
//
#ifndef __DAQIOLIB_H__
#define __DAQIOLIB_H__
#include <stdio.h>
#include <string>
#include <vector>
#include <map>
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;
using namespace std;
#include "DaqIoLibDefines.h"
#include "DaqBuffer.h"
#include "DaqChannelInfo.h"
#include "DaqIo.h"
#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