Commit f55949ca by IOWA\vhorosewski

Removed the "using namespace std" line from this header as it pollutes the…

Removed the "using namespace std" line from this header as it pollutes the global namespace in all files which include it; string's, vector's, and such are now prefixed with "std::" and the using directive has been moved to the implementation file, as necessary.
parent de3bd82f
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
/// ///
/// $Id: DaqBuffer.h,v 1.4 2007/04/25 17:53:13 dheitbri Exp $ /// $Id: DaqBuffer.h,v 1.5 2013/04/30 00:59:10 IOWA\vhorosewski Exp $
/// ///
/// Date: December 2004 /// Date: December 2004
/// ///
...@@ -30,7 +30,7 @@ public: ...@@ -30,7 +30,7 @@ public:
~CDaqBuffer() {}; ~CDaqBuffer() {};
vector<TDaqByte>::const_pointer GetDataPtr() const; ///< Return faw pointer to data std::vector<TDaqByte>::const_pointer GetDataPtr() const; ///< Return faw pointer to data
int GetCount() const; ///< Return number of typed elements in buffer int GetCount() const; ///< Return number of typed elements in buffer
int GetSize() const; ///< Return buffer size in bytes int GetSize() const; ///< Return buffer size in bytes
...@@ -41,7 +41,7 @@ public: ...@@ -41,7 +41,7 @@ public:
short* GetShort(int ind=0); ///< Return short type pointer to data short* GetShort(int ind=0); ///< Return short type pointer to data
friend class CDaqLowLevelIo; friend class CDaqLowLevelIo;
vector<TDaqByte> m_Data; ///< data is stored here std::vector<TDaqByte> m_Data; ///< data is stored here
protected: protected:
void Append(const void *pData, int size, int count); ///< Add data void Append(const void *pData, int size, int count); ///< Add data
...@@ -119,7 +119,7 @@ CDaqBuffer::GetShort(int ind) ///< Return short type pointer to data ...@@ -119,7 +119,7 @@ CDaqBuffer::GetShort(int ind) ///< Return short type pointer to data
/// ///
/// This function returns a raw pointer to the data in the buffer. /// This function returns a raw pointer to the data in the buffer.
/// ///
inline vector<TDaqByte>::const_pointer inline std::vector<TDaqByte>::const_pointer
CDaqBuffer::GetDataPtr() const CDaqBuffer::GetDataPtr() const
{ {
if (m_Data.size() > 0) if (m_Data.size() > 0)
......
...@@ -41,7 +41,7 @@ public: ...@@ -41,7 +41,7 @@ public:
int GetItemCount() const; ///< C int GetItemCount() const; ///< C
int GetType() const; ///< D int GetType() const; ///< D
int GetId() const; ///< E int GetId() const; ///< E
const string& GetName() const; ///< H const std::string& GetName() const; ///< H
int GetCapRate() const; ///< G int GetCapRate() const; ///< G
bool IsVarLen() const; ///< H bool IsVarLen() const; ///< H
...@@ -50,7 +50,7 @@ public: ...@@ -50,7 +50,7 @@ public:
private: private:
int m_Id; int m_Id;
int m_Items; int m_Items;
string m_Name; std::string m_Name;
int m_CapRate; int m_CapRate;
int m_Type; int m_Type;
bool m_VarLen; bool m_VarLen;
...@@ -73,7 +73,7 @@ CDaqChannelInfo::GetCapRate(void) const ...@@ -73,7 +73,7 @@ CDaqChannelInfo::GetCapRate(void) const
} }
///// Return name as specified in cell file ///// Return name as specified in cell file
inline const string & inline const std::string &
CDaqChannelInfo::GetName(void) const CDaqChannelInfo::GetName(void) const
{ {
return m_Name; return m_Name;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/// ///
// DAQ low level IO Library // DAQ low level IO Library
// //
// $Id: DaqFileIO.cxx,v 1.20 2011/12/28 16:12:05 iowa\vhorosewski Exp $ // $Id: DaqFileIO.cxx,v 1.21 2013/04/30 00:59:10 IOWA\vhorosewski Exp $
// Date: March, 2005 // Date: March, 2005
// Author: Yiannis Papelis // Author: Yiannis Papelis
// //
...@@ -13,6 +13,9 @@ ...@@ -13,6 +13,9 @@
#include "DaqIoLib.h" #include "DaqIoLib.h"
#include <assert.h> #include <assert.h>
#include <io.h> #include <io.h>
using namespace std;
/// ///
/// Small dummy function to act as the default callback /// Small dummy function to act as the default callback
/// ///
......
...@@ -25,26 +25,26 @@ public: ...@@ -25,26 +25,26 @@ public:
CDaqLowLevelIo(); CDaqLowLevelIo();
~CDaqLowLevelIo(); ~CDaqLowLevelIo();
bool LowLevelDataRead(const TIntVec* , TDataVec& , vector<TIntVec>* pFrameList=0); bool LowLevelDataRead(const TIntVec* , TDataVec& , std::vector<TIntVec>* pFrameList=0);
bool LowLevelDataCopy(const TIntVec* chans, TFileVec& dest, bool LowLevelDataCopy(const TIntVec* chans, TFileVec& dest,
TConvertOptions options = eBINARY_FORMAT + eINCLUDE_FRAME); TConvertOptions options = eBINARY_FORMAT + eINCLUDE_FRAME);
bool GetFullData(const TIntVec* chans, TDataVec& data, TConvertOptions option = eNO_OPTION, bool GetFullData(const TIntVec* chans, TDataVec& data, TConvertOptions option = eNO_OPTION,
int firstFrame = -1, int lastFrame = -1, vector<TIntVec>* pFrameList = 0); int firstFrame = -1, int lastFrame = -1, std::vector<TIntVec>* pFrameList = 0);
bool Open(const string &); ///< Open the file bool Open(const std::string &); ///< Open the file
void GetChannels(TChanInfoVec& channels) const; ///< Return info about channels void GetChannels(TChanInfoVec& channels) const; ///< Return info about channels
bool GetChannelInfo(int chId, CDaqChannelInfo &info) const; bool GetChannelInfo(int chId, CDaqChannelInfo &info) const;
int GetFirstFrame() const; int GetFirstFrame() const;
int GetLastFrame() const; int GetLastFrame() const;
int GetFrames() const; int GetFrames() const;
int GetFrequency() const; int GetFrequency() const;
const string& GetDate() const; const std::string& GetDate() const;
const string& GetVersion() const; const std::string& GetVersion() const;
const string& GetTitle() const; const std::string& GetTitle() const;
const string& GetSubject() const; const std::string& GetSubject() const;
const string& GetRun() const; const std::string& GetRun() const;
const string& GetRunInst() const; const std::string& GetRunInst() const;
const string& GetFileName() const; const std::string& GetFileName() const;
size_t GetNumChannels() const; size_t GetNumChannels() const;
bool TocFileExists() const; bool TocFileExists() const;
...@@ -52,7 +52,7 @@ public: ...@@ -52,7 +52,7 @@ public:
bool QueryIntegrityValues(TIntVec& drops, TIntVec& dropedFrm, TIntVec& skips, bool QueryIntegrityValues(TIntVec& drops, TIntVec& dropedFrm, TIntVec& skips,
TDaqEofStatus &stat); TDaqEofStatus &stat);
const string& GetLastError(void) const ///< Return text of most recent error const std::string& GetLastError(void) const ///< Return text of most recent error
{ return m_LastError; }; { return m_LastError; };
void Close(void); ///< Close the file void Close(void); ///< Close the file
...@@ -85,21 +85,21 @@ private: ...@@ -85,21 +85,21 @@ private:
bool DetectFrameHeader(int recFrame); bool DetectFrameHeader(int recFrame);
bool ResyncFrame(int curFrame, int& skipCount); bool ResyncFrame(int curFrame, int& skipCount);
TResyncOutcome ResyncChannel(int recFrame, int& skipCount); TResyncOutcome ResyncChannel(int recFrame, int& skipCount);
bool WriteTocFile(const string& fname); bool WriteTocFile(const std::string& fname);
bool ReadTocFile(const string& fname); bool ReadTocFile(const std::string& fname);
TReadErrorCode ReadFrameHeader(int, int& ,int&, int&); TReadErrorCode ReadFrameHeader(int, int& ,int&, int&);
TReadErrorCode ReadDataForOneFrame(int, TIntVec, TDataVec &, void *, vector<bool>&); TReadErrorCode ReadDataForOneFrame(int, TIntVec, TDataVec &, void *, std::vector<bool>&);
TReadErrorCode ReadChannelDataForOneFrame(int, int, CDaqBuffer&, void*, bool&); TReadErrorCode ReadChannelDataForOneFrame(int, int, CDaqBuffer&, void*, bool&);
string m_Filename; std::string m_Filename;
string m_Version; ///< file version std::string m_Version; ///< file version
FILE* m_pFile; FILE* m_pFile;
string m_Title; ///< Simulation title, as stored in DAQ file std::string m_Title; ///< Simulation title, as stored in DAQ file
string m_Date; ///< Date of collection, as stored in DAQ file std::string m_Date; ///< Date of collection, as stored in DAQ file
string m_Subj; ///< As stored in DAQ file std::string m_Subj; ///< As stored in DAQ file
string m_Run; ///< As stored in DAQ file std::string m_Run; ///< As stored in DAQ file
string m_RunInst; ///< As stored in DAQ file std::string m_RunInst; ///< As stored in DAQ file
int m_NumEntries; ///< As stored in DAQ file int m_NumEntries; ///< As stored in DAQ file
int m_Frequency; ///< As stored in DAQ file int m_Frequency; ///< As stored in DAQ file
...@@ -110,11 +110,11 @@ private: ...@@ -110,11 +110,11 @@ private:
bool m_HaveToc; ///< Indicates if we have TOC in memory bool m_HaveToc; ///< Indicates if we have TOC in memory
TChanInfoVec m_Channels; ///< Channel information TChanInfoVec m_Channels; ///< Channel information
long m_DataOffset; ///< where data starts in the file long m_DataOffset; ///< where data starts in the file
map<int, int> m_Toc; ///< given a sim frame, gives the offset in the file std::map<int, int> m_Toc; ///< given a sim frame, gives the offset in the file
vector<int> m_DroppedFrames; std::vector<int> m_DroppedFrames;
int m_FirstFrame; int m_FirstFrame;
int m_LastFrame; int m_LastFrame;
mutable string m_LastError; mutable std::string m_LastError;
TDaqEofStatus m_EofStatus; TDaqEofStatus m_EofStatus;
// These are for data integrity // These are for data integrity
...@@ -138,7 +138,7 @@ CDaqLowLevelIo::GetChannels(TChanInfoVec & chn) const ...@@ -138,7 +138,7 @@ CDaqLowLevelIo::GetChannels(TChanInfoVec & chn) const
/// ///
/// Return the title stored in the DAQ file. /// Return the title stored in the DAQ file.
/// ///
inline const string & inline const std::string &
CDaqLowLevelIo::GetTitle(void) const CDaqLowLevelIo::GetTitle(void) const
{ {
return m_Title; return m_Title;
...@@ -149,7 +149,7 @@ CDaqLowLevelIo::GetTitle(void) const ...@@ -149,7 +149,7 @@ CDaqLowLevelIo::GetTitle(void) const
/// ///
/// Return the DAQ file version number as an STL string. /// Return the DAQ file version number as an STL string.
inline const string & inline const std::string &
CDaqLowLevelIo::GetVersion(void) const CDaqLowLevelIo::GetVersion(void) const
{ {
return m_Version; return m_Version;
...@@ -160,7 +160,7 @@ CDaqLowLevelIo::GetVersion(void) const ...@@ -160,7 +160,7 @@ CDaqLowLevelIo::GetVersion(void) const
/// Return the run instance name. If the feature is not /// Return the run instance name. If the feature is not
/// supported due to an older version, an empty string is returned. /// supported due to an older version, an empty string is returned.
/// ///
inline const string & inline const std::string &
CDaqLowLevelIo::GetRunInst(void) const CDaqLowLevelIo::GetRunInst(void) const
{ {
return m_RunInst; return m_RunInst;
...@@ -170,7 +170,7 @@ CDaqLowLevelIo::GetRunInst(void) const ...@@ -170,7 +170,7 @@ CDaqLowLevelIo::GetRunInst(void) const
/// ///
/// Return the subject name (also known as the participant). /// Return the subject name (also known as the participant).
/// ///
inline const string & inline const std::string &
CDaqLowLevelIo::GetSubject(void) const CDaqLowLevelIo::GetSubject(void) const
{ {
return m_Subj; return m_Subj;
...@@ -180,7 +180,7 @@ CDaqLowLevelIo::GetSubject(void) const ...@@ -180,7 +180,7 @@ CDaqLowLevelIo::GetSubject(void) const
/// ///
/// Return the name of the Run that produced the daq file /// Return the name of the Run that produced the daq file
/// ///
inline const string & inline const std::string &
CDaqLowLevelIo::GetRun(void) const CDaqLowLevelIo::GetRun(void) const
{ {
return m_Run; return m_Run;
...@@ -190,7 +190,7 @@ CDaqLowLevelIo::GetRun(void) const ...@@ -190,7 +190,7 @@ CDaqLowLevelIo::GetRun(void) const
/// ///
/// Return the file creation date as stored in the header /// Return the file creation date as stored in the header
/// ///
inline const string & inline const std::string &
CDaqLowLevelIo::GetDate(void) const CDaqLowLevelIo::GetDate(void) const
{ {
return m_Date; return m_Date;
...@@ -251,7 +251,7 @@ CDaqLowLevelIo::GetNumChannels(void) const ...@@ -251,7 +251,7 @@ CDaqLowLevelIo::GetNumChannels(void) const
/// ///
/// This function returns the name of the DAQ file /// This function returns the name of the DAQ file
/// ///
inline const string& inline const std::string&
CDaqLowLevelIo::GetFileName() const CDaqLowLevelIo::GetFileName() const
{ {
return m_Filename; return m_Filename;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// //
// $Id: DaqIoLibDefines.h,v 1.2 2007/04/25 17:53:55 dheitbri Exp $ // $Id: DaqIoLibDefines.h,v 1.3 2013/04/30 00:59:10 IOWA\vhorosewski Exp $
// Date: March, 2005 // Date: March, 2005
// Author: Yiannis Papelis // Author: Yiannis Papelis
// //
...@@ -20,11 +20,11 @@ class CDaqChannelInfo; ...@@ -20,11 +20,11 @@ class CDaqChannelInfo;
#define DAQ_TOC_MAGIC_NUM 0x2C3ABCDE #define DAQ_TOC_MAGIC_NUM 0x2C3ABCDE
typedef unsigned char TDaqByte; typedef unsigned char TDaqByte;
typedef vector<int> TIntVec; typedef std::vector<int> TIntVec;
typedef vector<string> TStrVec; typedef std::vector<std::string> TStrVec;
typedef vector<CDaqBuffer> TDataVec; typedef std::vector<CDaqBuffer> TDataVec;
typedef vector<FILE *> TFileVec; typedef std::vector<FILE *> TFileVec;
typedef vector<CDaqChannelInfo> TChanInfoVec; typedef std::vector<CDaqChannelInfo> TChanInfoVec;
const int cMaxDaqRec = 128*1024; ///< maximum size of data per DAQ record 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 cMaxChannels = 500; ///< maximum number of channels we can handle
......
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