diff --git a/include/ByteStream.h b/include/ByteStream.h index d90a67d742911673068025c4e2e764aab82dd325..078698fd83a9bf54640a1fa58a465c9b1ed28a84 100644 --- a/include/ByteStream.h +++ b/include/ByteStream.h @@ -1,7 +1,9 @@ /*************************************************************************** + ByteStream.h + ------------------- begin : Thu Nov 29 2001 - copyright : (C) 2001 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** diff --git a/include/ConfigurationFile.h b/include/ConfigurationFile.h index d29f1fcd30b835e1ac32b9bb8b01a9a6c895ab46..ebc96da6938d1bc5eb5772405584df148325acfd 100644 --- a/include/ConfigurationFile.h +++ b/include/ConfigurationFile.h @@ -1,9 +1,9 @@ /*************************************************************************** - ConfigurationFile.h - description + ConfigurationFile.h ------------------- begin : Thu Nov 29 2001 - copyright : (C) 2001 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -15,8 +15,8 @@ * * ***************************************************************************/ -#ifndef CONFIGURATIONFILE_H -#define CONFIGURATIONFILE_H +#ifndef _CONFIGURATIONFILE_H +#define _CONFIGURATIONFILE_H #include "PacketExceptionIO.h" #include "InputTextFile.h" @@ -24,38 +24,26 @@ namespace PacketLib { -//##ModelId=3EADC12201A5 -//##Documentation -//## $Date: 2012/06/08 15:14:29 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/ConfigurationFile.h,v 1.3 2012/06/08 15:14:29 bulgarelli Exp $ -//## $Id: ConfigurationFile.h,v 1.3 2012/06/08 15:14:29 bulgarelli Exp $ -//## $Revision: 1.3 $ -//## \brief This class represent the text file which contains the configurations + +/// \brief This class represent the text file which contains the configurations class ConfigurationFile : public InputTextFile { public: - //##ModelId=3EADC12701F1 ConfigurationFile(); - //##ModelId=3EADC12701F4 ~ConfigurationFile(); - //##ModelId=3EADC12701F5 virtual bool open(char** parameters) throw(PacketExceptionIO*); - //##ModelId=3EADC12701F8 virtual char* getLine() throw(PacketExceptionIO*); - //##ModelId=3EADC12701FB virtual char* getLine(const char* s) throw(PacketExceptionIO*); - //##ModelId=3EADC12701FE virtual void close() throw(PacketExceptionIO*); private: - //##ModelId=3EADC12701EF char* currentpwd; }; diff --git a/include/DataFieldHeader.h b/include/DataFieldHeader.h index 677bcd4a41a5ffabe5ece3e35e71581fdaa896c4..bea88381e458f7756e247f532b6f8d4f7e0c1920 100644 --- a/include/DataFieldHeader.h +++ b/include/DataFieldHeader.h @@ -1,9 +1,9 @@ /*************************************************************************** - DataFieldHeader.h - description + DataFieldHeader.h ------------------- begin : Thu Nov 29 2001 - copyright : (C) 2001 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -14,8 +14,9 @@ * For commercial purpose see appropriate license terms * * * ***************************************************************************/ -#ifndef DataFieldHeader_h_h -#define DataFieldHeader_h_h + +#ifndef _DATAFIELDHEADER_H +#define _DATAFIELDHEADER_H #include "PacketLibDefinition.h" #include "PartOfPacket.h" @@ -23,13 +24,7 @@ namespace PacketLib { -//##ModelId=3C0F6C1902E3 -//##Documentation -//## $Date: 2005/03/09 10:57:50 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/DataFieldHeader.h,v 1.3 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Id: DataFieldHeader.h,v 1.3 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Revision: 1.3 $ -//## \brief This class represent the data field header of a packet +/// \brief This class represent the data field header of a packet class DataFieldHeader : public PartOfPacket { public: diff --git a/include/Device.h b/include/Device.h index ac8c20027f4b6baaf240846d26956fe104c57d4e..c7ad2a48f4595492831a07332728d17a5ecde5c3 100644 --- a/include/Device.h +++ b/include/Device.h @@ -1,9 +1,9 @@ /*************************************************************************** - Device.h - description + Device.h ------------------- begin : Mon Mar 4 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -15,58 +15,39 @@ * * ***************************************************************************/ -#ifndef DEVICE_H -#define DEVICE_H +#ifndef _DEVICE_H +#define _DEVICE_H namespace PacketLib { -//##ModelId=3C87743F01CC -//##Documentation -//## $Date: 2005/03/09 10:57:50 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/Device.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Id: Device.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Revision: 1.2 $ -//## \brief This class represent a Device for IO system. +/// \brief This class represent a Device for IO system. class Device { public: - //##ModelId=3C87744002A0 Device(bool bigendian); - //##ModelId=3C87744002A2 - virtual bool isClosed() const; + virtual bool isClosed() const; - //##ModelId=3C87744002AB virtual bool isEOF() const; - //##ModelId=3ACCD75E02EE - //##Documentation - //## Write property of bool endsession. + /// Write property of bool endsession. virtual void setEndSession( const bool& _newVal); - //##ModelId=3ACCD75E031C - //##Documentation - //## Read property of bool endsession. + /// Read property of bool endsession. virtual const bool& getEndSession() const; - //##ModelId=3EADC1270262 virtual bool isBigEndian() const; protected: - //##ModelId=3C8774400282 bool eof; - //##ModelId=3C8774400296 bool closed; - //##ModelId=3C8774400297 bool bigendian; - //##ModelId=3ACCD75E0242 - //##Documentation - //## This variable indicates when a measurement session is terminated - //## The device class have this attribute because this information is passed - //## with the device. + /// This variable indicates when a measurement session is terminated + /// The device class have this attribute because this information is passed + /// with the device. bool endsession; }; } diff --git a/include/Field.h b/include/Field.h index 83ea492f97ba225414a419091a99b17888021fd2..b793ff02a40b4ecf722b80526d37ba753b7b6795 100644 --- a/include/Field.h +++ b/include/Field.h @@ -1,9 +1,9 @@ /*************************************************************************** - Field.h - description + Field.h ------------------- begin : Thu Nov 29 2001 - copyright : (C) 2001 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -14,8 +14,9 @@ * For commercial purpose see appropriate license terms * * * ***************************************************************************/ -#ifndef Field_h_h -#define Field_h_h + +#ifndef _FIELD_H_H +#define _FIELD_H_H #include "PacketLibDefinition.h" @@ -28,54 +29,54 @@ class FieldType public: - //Dimension of field in bit. + /// Dimension of field in bit. word dimension; - //It indicates that there's a predefined value for this field. + /// It indicates that there's a predefined value for this field. bool thereIsPredefinedValue; - //Predefined value of field (for the generation of packet). + /// Predefined value of field (for the generation of packet). int predefinedValue; - //Name of the field. + /// Name of the field. char* name; }; -//A single field of a telemetry packet +/// A single field of a telemetry packet class Field { public: - //Constructor of class. + /// Constructor of class. Field(char* name, char* dimension, char* predefinedValue, int progressiv); - //Destructor of class. + /// Destructor of class. ~Field(); - //Value reads from stream of byte (from packet). + /// Value reads from stream of byte (from packet). word value; - //Dimension of field in bit. + /// Dimension of field in bit. inline dword getDimension() { return type->dimension; }; - //It indicates that there's a predefined value for this field. + /// It indicates that there's a predefined value for this field. inline bool thereIsPredefinedValue() { return type->thereIsPredefinedValue; }; - //Predefined value of field (for the generation of packet). + /// Predefined value of field (for the generation of packet). inline int getPredefinedValue() { return type->predefinedValue; }; - //Name of the field. + /// Name of the field. inline char* getName() { return type->name; @@ -88,7 +89,7 @@ public: protected: - //Index of packet in the list of packet. + /// Index of packet in the list of packet. int progressiv; FieldType * type; diff --git a/include/File.h b/include/File.h index 84d695b37b5483d1a0a193542bdbd794615ab919..3839cb67faae85357175ff7cd38bb4822d20b2a3 100644 --- a/include/File.h +++ b/include/File.h @@ -1,9 +1,9 @@ /*************************************************************************** - File.h - description + File.h ------------------- begin : Thu Nov 29 2001 - copyright : (C) 2001 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -14,8 +14,8 @@ * For commercial purpose see appropriate license terms * * * ***************************************************************************/ -#ifndef file_h_h -#define file_h_h +#ifndef _FILE_H_H +#define _FILE_H_H #include "PacketLibDefinition.h" #include "Device.h" @@ -25,34 +25,23 @@ namespace PacketLib { -//##ModelId=3C0F6C190309 -//##Documentation -//## $Date: 2012/06/08 15:14:29 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/File.h,v 1.6 2012/06/08 15:14:29 bulgarelli Exp $ -//## $Id: File.h,v 1.6 2012/06/08 15:14:29 bulgarelli Exp $ -//## $Revision: 1.6 $ -//## \brief This class represent a device file for IO system. +/// \brief This class represent a device file for IO system. class File : public Device { public: - //##ModelId=3C0F6C1A0012 File(); - //##ModelId=3C187750028F - //##Documentation - //## \param b Indicates if the machine is big or little endian. If little endian, this class - //## swap the byte of a word - //## \param startP Starting position whitin file + /// \param b Indicates if the machine is big or little endian. If little endian, this class + /// swap the byte of a word + /// \param startP Starting position whitin file File(bool b, long startP = 0); virtual ~File(); - //##ModelId=3C0F6C1A0013 - //##Documentation - //## Open the file - //## \param filename Name of file - //## \param mode Mode of file opened. r for read, w for writing + /// Open the file + /// \param filename Name of file + /// \param mode Mode of file opened. r for read, w for writing virtual bool open( const char* filename, const char* mode="r") throw(PacketExceptionIO*); virtual void setFileName(char* filename ) @@ -65,117 +54,81 @@ public: return filename; }; - //##ModelId=3C0F6C1A0016 - //## Documentation - //## Get a single byte from current position of file opened. - //## \pre The file must be opened. + /// Get a single byte from current position of file opened. + /// \pre The file must be opened. virtual int getByte(); - //##ModelId=3C0F6C1A0018 - //##Documentation - //## Reads a pair number of byte from opened file and manages the big or little endian - //## format. If the format of machine is little endian, a pair of byte is swapped. - //## \pre The file must be opened. + /// Reads a pair number of byte from opened file and manages the big or little endian + /// format. If the format of machine is little endian, a pair of byte is swapped. + /// \pre The file must be opened. virtual ByteStream* getNByte( dword N = 1 ); - //##ModelId=3C0F6C1A001B - //##Documentation - //## Get the current line. - //## \pre The file must be opened. + /// Get the current line. + /// \pre The file must be opened. virtual char* getLine() throw(PacketExceptionIO*); - //##ModelId=3C0F6C1A001F - //##Documentation - - //## Close the file. + /// Close the file. virtual void close( ) throw(PacketExceptionIO*); - //##ModelId=3C0F6C1A0021 - //##Documentation - //## \return true if file is closed, false if file is opened. + /// \return true if file is closed, false if file is opened. virtual bool isClosed(); - //##ModelId=3C15F42303C4 - //##Documentation - //## \return Returns last line read from file. + /// \return Returns last line read from file. char* getLastLineRead(); - //##ModelId=3C205AF20278 - //## Sets the position into file. - //## \pre The file must be opened. + /// Sets the position into file. + /// \pre The file must be opened. virtual dword setpos(dword offset) throw(PacketExceptionIO*); - //##ModelId=3C205AF202C3 - //## Gets the current file position. - //## \pre The file must be opened. + /// Gets the current file position. + /// \pre The file must be opened. virtual dword getpos(); - //##ModelId=3C205AF20313 - //##Documentation - //## Stores the current position - //## \pre The file must be opened. + /// Stores the current position + /// \pre The file must be opened. virtual bool memBookmarkPos(); - //##ModelId=3C205AF20334 - //##Documentation - //## Sets the position stored with memBookmarkPos() method. - //## \pre The file must be opened. + /// Sets the position stored with memBookmarkPos() method. + /// \pre The file must be opened. virtual bool setLastBookmarkPos(); - //##ModelId=3A5A30B40368 - //##Documentation - //## \return Returns true is the position into file is at end of file + /// \return Returns true is the position into file is at end of file virtual bool isEOF(); - //##ModelId=3C51324A022E - //## \pre The file must be opened. + /// \pre The file must be opened. int setFirstPos() throw(PacketExceptionIO*); - //##ModelId=3C51324A0299 - //## Changes directory. The path is in the filename of file opened. - //## \pre The file name must be set. + /// Changes directory. The path is in the filename of file opened. + /// \pre The file name must be set. bool fchdir() throw(PacketExceptionIO*); - //##ModelId=3C51324A0304 long find(byte b) throw(PacketExceptionIO*) ; - //##ModelId=3EADC12800D8 - //##Documentation - //## Writes a string into opend file. - //## \pre The file must be opened in w mode + /// Writes a string into opend file. + /// \pre The file must be opened in w mode bool writeString(const char* str) throw(PacketExceptionIO*); - //##ModelId=3EADC12801EA - //##Documentation - //## Writes a stream of byte into opend file. - //## \pre The file must be opened in w mode + /// Writes a stream of byte into opend file. + /// \pre The file must be opened in w mode bool writeByteStream(ByteStream* b) throw(PacketExceptionIO*); - //##Documentation - //## Count the number of string lines into a text file. + /// Count the number of string lines into a text file. long getNumberOfStringLines(); - //##ModelId=3EADC12702C9 static dword byte_read; - //##ModelId=3EADC1270363 static dword char_read; protected: - //##ModelId=3ACCD75E038A char* lastLineRead; - //##ModelId=3DA3E56B0064 FILE* fp; - //##ModelId=3C187750023E dword bookmarkPos; - //##ModelId=3C51324900FB dword startPosition; - //##ModelId=3C5132490213 char* filename; char* mode; diff --git a/include/FileStream.h b/include/FileStream.h index 36be2e4c519f052b1c5066dbcbfa066e082f6034..61736dd8017f985c80a60c1630e76768c646415b 100644 --- a/include/FileStream.h +++ b/include/FileStream.h @@ -2,8 +2,8 @@ FileStream.h - description ------------------- begin : Thu Nov 29 2001 - copyright : (C) 2001 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -14,44 +14,32 @@ * For commercial purpose see appropriate license terms * * * ***************************************************************************/ -#ifndef FILESTREAM_H_INCLUDED_9A29CA8E -#define FILESTREAM_H_INCLUDED_9A29CA8E + +#ifndef _FILESTREAM_H +#define _FILESTREAM_H #include "File.h" #include "ByteStream.h" namespace PacketLib { -//##ModelId=3C187750014C -//##Documentation -//## $Date: 2005/03/09 10:57:50 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/FileStream.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Id: FileStream.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Revision: 1.2 $ -//## \brief This class represent a stream of byte into a file. +/// \brief This class represent a stream of byte into a file. class FileStream : public File { public: - //##ModelId=3C1877500365 FileStream(bool prefix, bool bigen, word dimprefix, long startposition = 0); - //##ModelId=3C87744100F3 ByteStream* readPrefix(); - //##ModelId=3C205AF20368 ByteStream* readHeader(unsigned int dimHeader); - //##ModelId=3C205AF2036F ByteStream* readDataField(unsigned int dimDataField); private: - - //##ModelId=3C18775002D6 - //##Documentation - //## Indicates if it's present a prefix for each packet - //## \li true if it's present - //## \li false if it isn't present + /// Indicates if it's present a prefix for each packet + /// \li true if it's present + /// \li false if it isn't present bool thereIsPrefix; ByteStream* header; diff --git a/include/FileStreamPointer.h b/include/FileStreamPointer.h index f55f13a04c29fe50b497204619db9b5e548fe4ed..4bb3d54406ec8014c2e0dc67ef2477e7103cd023 100644 --- a/include/FileStreamPointer.h +++ b/include/FileStreamPointer.h @@ -2,8 +2,8 @@ FileStreamPointer.h - description ------------------- begin : Mon Jan 14 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -15,53 +15,41 @@ * * ***************************************************************************/ -#ifndef FILESTREAMPOINTER_H -#define FILESTREAMPOINTER_H +#ifndef _FILESTREAMPOINTER_H +#define _FILESTREAMPOINTER_H namespace PacketLib { -//##ModelId=3C87743F0230 -//## $Date: 2005/08/02 15:07:13 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/FileStreamPointer.h,v 1.3 2005/08/02 15:07:13 bulgarelli Exp $ -//## $Id: FileStreamPointer.h,v 1.3 2005/08/02 15:07:13 bulgarelli Exp $ -//## $Revision: 1.3 $ -//## \brief This class represent a pointer into a file of byte +///ModelId=3C87743F0230 +/// $Date: 2005/08/02 15:07:13 $ +/// $Header: /home/repository/cvs/gtb/PacketLib/include/FileStreamPointer.h,v 1.3 2005/08/02 15:07:13 bulgarelli Exp $ +/// $Id: FileStreamPointer.h,v 1.3 2005/08/02 15:07:13 bulgarelli Exp $ +/// $Revision: 1.3 $ +/// \brief This class represent a pointer into a file of byte class FileStreamPointer { public: - //##ModelId=3C877441011B FileStreamPointer(); - //##ModelId=3C877441011C ~FileStreamPointer(); public: - //##ModelId=3C87744100FD - //##Documentation - //## Type of packet. This is the index in the list of packetType attribute of InputPacketStream class + /// Type of packet. This is the index in the list of packetType attribute of InputPacketStream class int typeOfPacket; - //##ModelId=3C8774410107 - //##Documentation - //## Pointer of the start position into the file (FileStream) + /// Pointer of the start position into the file (FileStream) long pointerStart; - //##ModelId=3C8774410108 - //##Documentation - //## A global index of this pointer into the full list of pointers + /// A global index of this pointer into the full list of pointers long index; - //##ModelId=3C8774410111 - //##Documentation - //## The name of the found packet + /// The name of the found packet char* nameOfPacket; - //##ModelId=3C8774410112 - //##Documentation - //## Pointer of the end position into the file (FileStream) + /// Pointer of the end position into the file (FileStream) long pointerEnd; }; diff --git a/include/Input.h b/include/Input.h index c2042e0bb05d53d10d827217bdded7ecf2d13f77..49dd221013001d4fdb61f0177853c85505ab8154 100644 --- a/include/Input.h +++ b/include/Input.h @@ -2,8 +2,8 @@ Input.h - description ------------------- begin : Sat Oct 26 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -15,8 +15,8 @@ * * ***************************************************************************/ -#ifndef INPUT_H -#define INPUT_H +#ifndef _INPUT_H +#define _INPUT_H #include "PacketExceptionIO.h" #include "ByteStream.h" @@ -24,55 +24,38 @@ namespace PacketLib { -//##ModelId=3EADC12202F0 -//## $Date: 2005/03/09 10:57:50 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/Input.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Id: Input.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Revision: 1.2 $ -//## \brief This class represent a generic input for IO system. +/// \brief This class represent a generic input for IO system. class Input { public: - //##ModelId=3EADC1280336 Input(bool bigendian); - //##ModelId=3EADC1280338 virtual ~Input(); - //##ModelId=3EADC128033A virtual bool open( char** parameters ) throw(PacketExceptionIO*) = 0; - //##ModelId=3EADC128033E virtual ByteStream* readByteStream(dword n_byte) throw(PacketExceptionIO*) = 0; - //##ModelId=3EADC1280341 virtual char* readString() throw(PacketExceptionIO*) = 0; - //##ModelId=3EADC1280344 virtual void close( ) throw(PacketExceptionIO*) = 0; - //##ModelId=3EADC1280347 virtual int getType() = 0; - //##ModelId=3EADC1280349 - virtual bool isClosed(); + virtual bool isClosed(); - //##ModelId=3EADC128034B virtual bool isEOF(); - //##ModelId=3EADC128034E virtual bool isBigendian(); protected: - //##ModelId=3EADC128032F bool eof; - //##ModelId=3EADC1280331 bool closed; - //##ModelId=3EADC1280333 + bool bigendian; }; diff --git a/include/InputFile.h b/include/InputFile.h index baeff9a021e58170a2c44b19a7db5999786b4c93..b802db431042f2f40483dde88dc0488b378e4a10 100644 --- a/include/InputFile.h +++ b/include/InputFile.h @@ -2,8 +2,8 @@ InputFile.h - description ------------------- begin : Sat Oct 26 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -15,8 +15,8 @@ * * ***************************************************************************/ -#ifndef INPUTFILE_H -#define INPUTFILE_H +#ifndef _INPUTFILE_H +#define _INPUTFILE_H #include "Input.h" #include "PacketExceptionIO.h" @@ -25,34 +25,22 @@ namespace PacketLib { -//##ModelId=3EADC12202FD -//## $Date: 2005/03/09 10:57:50 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/InputFile.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Id: InputFile.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Revision: 1.2 $ -//## \brief This class represent a File input for IO system. +/// \brief This class represent a File input for IO system. class InputFile : public Input { public: - //##ModelId=3EADC1280365 InputFile(bool bigendian); - //##ModelId=3EADC1280368 ~InputFile(); - //##ModelId=3EADC1280369 virtual bool open( char** parameters ) throw(PacketExceptionIO*); - //##ModelId=3EADC128036F - virtual void close() throw(PacketExceptionIO*); + virtual void close() throw(PacketExceptionIO*); - //##ModelId=3EADC1280371 virtual ByteStream* readByteStream(dword n_byte) throw(PacketExceptionIO*); - //##ModelId=3EADC1280377 - virtual char* readString() throw(PacketExceptionIO*); + virtual char* readString() throw(PacketExceptionIO*); - //##ModelId=3EADC128037A virtual int getType() { return 0; @@ -60,10 +48,8 @@ public: protected: - //##ModelId=3EADC128035A File* file; - //##ModelId=3EADC1280361 char* filename; }; diff --git a/include/InputPacketStream.h b/include/InputPacketStream.h index f429928f11481023e67d17005b9390ebd641b6c5..af89c16b620f6ac436d68dca064850843eafbb9d 100644 --- a/include/InputPacketStream.h +++ b/include/InputPacketStream.h @@ -2,8 +2,8 @@ InputPacketStream.h - description ------------------- begin : Sun Oct 27 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -15,8 +15,8 @@ * * ***************************************************************************/ -#ifndef INPUTPACKETSTREAM_H -#define INPUTPACKETSTREAM_H +#ifndef _INPUTPACKETSTREAM_H +#define _INPUTPACKETSTREAM_H #include "PacketStream.h" #include "Input.h" @@ -25,56 +25,39 @@ namespace PacketLib { -//##ModelId=3C0F6C190336 -//## $Date: 2005/03/09 10:57:50 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/InputPacketStream.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Id: InputPacketStream.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Revision: 1.2 $ -//## \brief This class represents the stream of byte in input that contains the packets. The input object must be deleted by its creator. +/// \brief This class represents the stream of byte in input that contains the packets. The input object must be deleted by its creator. class InputPacketStream : public PacketStream { public: - //##ModelId=3EADC1290013 InputPacketStream(); - //##ModelId=3EADC1290020 InputPacketStream(const char* fileNameConfig); - //##ModelId=3EADC1290051 ~InputPacketStream(); - //##ModelId=3C3AB71401AE - //##Documentation - //## \return The index of packet type if it's recognized. 0 if packet isn't recogniezed. - //## \param prefix A ByteStream that contains the prefix of packet (if present). - //## \param packetHeader A ByteStream that contains the packet header. - //## \param packetDataField A ByteStream that contains the packet data field. + /// \return The index of packet type if it's recognized. 0 if packet isn't recogniezed. + /// \param prefix A ByteStream that contains the prefix of packet (if present). + /// \param packetHeader A ByteStream that contains the packet header. + /// \param packetDataField A ByteStream that contains the packet data field. int detPacketType(ByteStream* prefix, ByteStream* packetHeader, ByteStream* packetDataField); - //##ModelId=3EADC1290097 - //##Documentation - //## \return The index of packet type if it's recognized. 0 if packet isn't recogniezed. - //## \param prefix A ByteStream that contains the prefix of packet (if present). - //## \param packet A ByteStream that contains the packet. + /// \return The index of packet type if it's recognized. 0 if packet isn't recogniezed. + /// \param prefix A ByteStream that contains the prefix of packet (if present). + /// \param packet A ByteStream that contains the packet. int detPacketType(ByteStream* prefix, ByteStream* packet); - //##ModelId=3EADC12900F5 - //##Documentation - //## This method sets the generic input of the stream - //## \param in An input. + /// This method sets the generic input of the stream + /// \param in An input. void setInput(Input* in); - //##ModelId=3EADC1290130 - //##Documentation - //## This method read a telemetry packet - //## \pre The setInput method must be invocated - //## \return A pointer telemetry packet. Make attention: the object returned is one of the TM packet object of the array of this object. Don't delete it! + /// This method read a telemetry packet + /// \pre The setInput method must be invocated + /// \return A pointer telemetry packet. Make attention: the object returned is one of the TM packet object of the array of this object. Don't delete it! Packet* readPacket() throw(PacketExceptionIO*); protected: -//##ModelId=3EADC128038F Input* in; }; diff --git a/include/InputPacketStreamFile.h b/include/InputPacketStreamFile.h index 445fa6c52ef6d51ac629f322003dff5cd03fa852..671bf83af799a1afb4552123e30aab81e221816d 100644 --- a/include/InputPacketStreamFile.h +++ b/include/InputPacketStreamFile.h @@ -1,9 +1,9 @@ /*************************************************************************** - InputPacketStream.h - description + InputPacketStreamFile.h - description ------------------- begin : Thu Nov 29 2001 - copyright : (C) 2001 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -14,8 +14,9 @@ * For commercial purpose see appropriate license terms * * * ***************************************************************************/ -#ifndef InputPacketStreamFile_h_h -#define InputPacketStreamFile_h_h + +#ifndef _INPUTPACKETSTREAMFILE_H_H +#define _INPUTPACKETSTREAMFILE_H_H #include "PacketLibDefinition.h" #include "PacketHeader.h" @@ -30,95 +31,61 @@ namespace PacketLib { -//##ModelId=3EADC1220335 -//## $Date: 2005/07/12 09:10:35 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/InputPacketStreamFile.h,v 1.5 2005/07/12 09:10:35 bulgarelli Exp $ -//## $Id: InputPacketStreamFile.h,v 1.5 2005/07/12 09:10:35 bulgarelli Exp $ -//## $Revision: 1.5 $ -//## \brief This class represents the stream of byte into a file that contains the packets. +/// \brief This class represents the stream of byte into a file that contains the packets. class InputPacketStreamFile : public InputPacketStream { public: - //##ModelId=3EADC12901CB InputPacketStreamFile(const char* fileNameConfig, const char* fileNameStream, long initialPosition) ; - //##ModelId=3EADC12901D7 InputPacketStreamFile(); - //##ModelId=3EADC12901D8 ~InputPacketStreamFile(); - //##ModelId=3EADC12901D9 void setFileNameStream(char *); - //Documentation - //##ModelId=3EADC12901DE - //## Opens the input stream. + /// Opens the input stream. bool openInputStream() throw(PacketExceptionIO*); - //Documentation - //##ModelId=3EADC12901E0 - //## Closes the input stream + /// Closes the input stream void closeInputStream() throw(PacketExceptionIO*); - //Documentation - //##ModelId=3EADC12901E2 - //## \return true if stream is at the end of file (input) + /// \return true if stream is at the end of file (input) bool isInputStreamEOF() throw(PacketExceptionIO*); - //##ModelId=3EADC12901E4 Packet* getPacketFromStream() throw (PacketExceptionIO * ); - //##ModelId=3EADC12901E6 long getNumberOfFileStreamPointer(); - //##ModelId=3EADC12901E8 - //##Documentation - //## This method builds a list of FileStreamPointer + /// This method builds a list of FileStreamPointer bool freeRun() throw(PacketExceptionIO*); - //##ModelId=3EADC12901EA - //##Documentation - //## Get a packet form the file stream pointer - //## \pre freeRun() must be invocated. + /// Get a packet form the file stream pointer + /// \pre freeRun() must be invocated. Packet* getPacketFromFileStreamPointer(int index, bool newpointer = false) throw(PacketExceptionIO*); - //##ModelId=3EADC12901F0 - //##Documentation - //## Get a file stream pointer - //## \pre freeRun() must be invocated. + /// Get a file stream pointer + /// \pre freeRun() must be invocated. FileStreamPointer* getFileStreamPointer(int index); - //##ModelId=3EADC12901F8 void setInitialPosition(long p); - //##ModelId=3EADC1290189 - //##Documentation - //## List of FileStreamPointer in the inputStream + /// List of FileStreamPointer in the inputStream FileStreamPointer** listOfFileStreamPointer; - //##ModelId=3EADC12901AC - //##Documentation - //## File that contains byte stream + /// File that contains byte stream FileStream* inputStream; private: - //##ModelId=3EADC12901B7 - //##Documentation - //## File name of file that contains the packet + /// File name of file that contains the packet char* fileNameStream; - //##ModelId=3EADC12901BD - //##Documentation - //## Initial position into file + /// Initial position into file long initialPosition; - //##ModelId=3EADC12901C4 - //##Documentation - //## Number of packet in the listOfFileStreamPointer + /// Number of packet in the listOfFileStreamPointer long numberOfFileStreamPointer; }; diff --git a/include/InputSerial.h b/include/InputSerial.h index 74b63249aece6fd8b3e1f70f435526556aceb7f2..30b397d5f684b416bfcff5521a673d7bc68876c5 100644 --- a/include/InputSerial.h +++ b/include/InputSerial.h @@ -1,9 +1,9 @@ /*************************************************************************** - InputFile.h - description + InputSerial.h - description ------------------- begin : Sat Oct 26 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -15,8 +15,8 @@ * * ***************************************************************************/ -#ifndef INPUTSERIAL_H -#define INPUTSERIAL_H +#ifndef _INPUTSERIAL_H +#define _INPUTSERIAL_H #include "Input.h" #include "PacketExceptionIO.h" @@ -25,34 +25,22 @@ namespace PacketLib { -//##ModelId=3EADC12202FD -//## $Date: 2005/03/09 10:57:50 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/InputSerial.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Id: InputSerial.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Revision: 1.2 $ -//## \brief This class represent a File input for IO system. +/// \brief This class represent a File input for IO system. class InputSerial : public Input { public: - //##ModelId=3EADC1280365 InputSerial(bool bigendian); - //##ModelId=3EADC1280368 ~InputSerial(); - //##ModelId=3EADC1280369 virtual bool open( char** parameters ) throw(PacketExceptionIO*); - //##ModelId=3EADC128036F virtual void close() throw(PacketExceptionIO*); - //##ModelId=3EADC1280371 virtual ByteStream* readByteStream(int n_byte) throw(PacketExceptionIO*); - //##ModelId=3EADC1280377 virtual char* readString() throw(PacketExceptionIO*); - //##ModelId=3EADC128037A virtual int getType() { return 0; @@ -60,10 +48,8 @@ public: protected: - //##ModelId=3EADC128035A Serial* serial; - //##ModelId=3EADC1280361 char* device; int flag; diff --git a/include/InputSocketServer.h b/include/InputSocketServer.h index b16696088941956ba853c7b17c4126109264044d..8303502c5731fd20802f680e892f5244b7e549b6 100644 --- a/include/InputSocketServer.h +++ b/include/InputSocketServer.h @@ -1,9 +1,9 @@ /*************************************************************************** - InputSocket.h - description + InputSocketServer.h - description ------------------- begin : Sat Oct 26 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -15,8 +15,8 @@ * * ***************************************************************************/ -#ifndef INPUTSOCKET_H -#define INPUTSOCKET_H +#ifndef _INPUTSOCKET_H +#define _INPUTSOCKET_H #include "Input.h" #include "PacketExceptionIO.h" @@ -25,34 +25,22 @@ namespace PacketLib { -//##ModelId=3EADC1220343 -//## $Date: 2005/03/09 10:57:50 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/InputSocketServer.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Id: InputSocketServer.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Revision: 1.2 $ -//## \brief This class represent a Socket Server input for IO system. +/// \brief This class represent a Socket Server input for IO system. class InputSocketServer : public Input { public: - //##ModelId=3EADC1290227 InputSocketServer(bool bigendian); - //##ModelId=3EADC129022D ~InputSocketServer(); - //##ModelId=3EADC129022E virtual bool open( char** parameters ) throw(PacketExceptionIO*); - //##ModelId=3EADC1290235 virtual void close() throw(PacketExceptionIO*); - //##ModelId=3EADC1290237 virtual ByteStream* readByteStream(int n_byte) throw(PacketExceptionIO*); - //##ModelId=3EADC129023E virtual char* readString() throw(PacketExceptionIO*); - //##ModelId=3EADC1290240 virtual int getType() { return 1; @@ -60,18 +48,14 @@ public: protected: - //##ModelId=3EADC1290208 SocketServer* socketserver; - //##ModelId=3EADC1290211 int port; - //##ModelId=3EADC1290217 bool accepted; private: - //##ModelId=3EADC129021D SocketServer* new_sock; }; diff --git a/include/InputText.h b/include/InputText.h index 5e957034051a58d34b29591f15ee73155cfdb512..19ef717153bd3bb54c53a85bcae5e36f15429ea8 100644 --- a/include/InputText.h +++ b/include/InputText.h @@ -2,8 +2,8 @@ InputText.h - description ------------------- begin : Mon Mar 4 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -15,8 +15,8 @@ * * ***************************************************************************/ -#ifndef INPUTTEXT_H -#define INPUTTEXT_H +#ifndef _INPUTTEXT_H +#define _INPUTTEXT_H #include "PacketLibDefinition.h" #include "PacketExceptionIO.h" @@ -24,7 +24,7 @@ namespace PacketLib { -//This class represents generic type of input. The input must be a text input. This class is used for the configuration files +/// This class represents generic type of input. The input must be a text input. This class is used for the configuration files class InputText { public: diff --git a/include/InputTextFile.h b/include/InputTextFile.h index 04c968e15fbcbdff18a2b89bc47c326c4f2efc22..38f764935ed2b7571568bc86ae5ad7c32519b6bc 100644 --- a/include/InputTextFile.h +++ b/include/InputTextFile.h @@ -2,8 +2,8 @@ InputTextFile.h - description ------------------- begin : Mon Mar 4 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -15,8 +15,8 @@ * * ***************************************************************************/ -#ifndef INPUTTEXTFILE_H -#define INPUTTEXTFILE_H +#ifndef _INPUTTEXTFILE_H +#define _INPUTTEXTFILE_H #include "InputText.h" #include "File.h" @@ -26,28 +26,18 @@ namespace PacketLib { -//##ModelId=3C87743F02B2 -//##Documentation -//## $Date: 2012/06/08 15:14:29 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/InputTextFile.h,v 1.4 2012/06/08 15:14:29 bulgarelli Exp $ -//## $Id: InputTextFile.h,v 1.4 2012/06/08 15:14:29 bulgarelli Exp $ -//## $Revision: 1.4 $ -//## \brief This class represents generic type of input. The input must be a input text file. +/// \brief This class represents generic type of input. The input must be a input text file. class InputTextFile : public InputText { public: - //##ModelId=3AA64922006A InputTextFile(); - //##ModelId=3AA64922007E virtual ~InputTextFile(); - //##ModelId=3AA64922009C // parameters[0] is the name of file virtual bool open(char** parameters) throw(PacketExceptionIO*); - //##ModelId=3AA6492200F6 virtual void close() throw(PacketExceptionIO*) ; virtual char* getInputTextName() @@ -55,30 +45,22 @@ public: return file.getFileName(); }; - //##ModelId=3AA64922011E virtual char* getLine() throw(PacketExceptionIO*); - //##ModelId=3AA64922013C virtual char* getLine(const char* s) throw(PacketExceptionIO*); - //##ModelId=3AA649220196 virtual char* getLastLineRead(); - //##ModelId=3AA6492201BE virtual long getpos(); - //##ModelId=3AA6492201DC virtual bool memBookmarkPos(); - //##ModelId=3AA64922020E virtual int setFirstPos(); virtual bool setLastBookmarkPos(); - //##ModelId=3AA64922025E virtual long setpos(long offset) throw(PacketExceptionIO*); - //##ModelId=3EADC12903E4 virtual bool fchdir() throw(PacketExceptionIO*); protected: @@ -87,7 +69,7 @@ protected: private: - //for caching mechanism + /// for caching mechanism static MemoryBuffer** listOfBuffers; static int nListOfBuffers; MemoryBuffer* buffer; diff --git a/include/MSGQ.h b/include/MSGQ.h index 46ae36a41e016d9a965ba2c68b646051cb38f094..15c9cced4f6ec95bb1bf379af367affe24501deb 100644 --- a/include/MSGQ.h +++ b/include/MSGQ.h @@ -1,9 +1,9 @@ /*************************************************************************** - SHQ.h - description + MSGQ.h - description ------------------- begin : Wed Dec 4 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -15,8 +15,8 @@ * * ***************************************************************************/ -#ifndef MSGQ_H -#define MSGQ_H +#ifndef _MSGQ_H +#define _MSGQ_H #include "PacketLibDefinition.h" #include "Device.h" @@ -29,65 +29,47 @@ namespace PacketLib { -//##ModelId=3EADC124022B typedef struct mesgbuf { long mtype; char mtext[2048]; } msgbuf; -//##Documentation -//## $Date: 2005/03/09 10:57:50 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/MSGQ.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Id: MSGQ.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Revision: 1.2 $ -//## \brief Represent a shared queue +/// \brief Represent a shared queue class MSGQ : public Device { public: - //##ModelId=3EADC12A0052 MSGQ(bool bigendian); - //##ModelId=3EADC12A0056 virtual ~MSGQ(); - //##ModelId=3EADC12A0058 virtual bool create(long shqkey, long dim) throw(PacketExceptionIO*); - //##ModelId=3EADC12A0061 virtual bool open(long shqkey, long dim) throw(PacketExceptionIO*); - //##ModelId=3EADC12A0069 virtual bool close() throw(PacketExceptionIO*); - //##ModelId=3EADC12A006B virtual bool destroy() throw(PacketExceptionIO*); - //##ModelId=3EADC12A006E virtual bool isCreated() const; - //##ModelId=3EADC12A0070 virtual void writeMessage(char* msg, long mtype) throw(PacketExceptionIO*); - //##ModelId=3EADC12A0078 virtual char* readMessage(long mtype) throw(PacketExceptionIO*); public: - //##ModelId=3EADC12A0040 - int msgqid; //id restituito dalla shmget + /// id given by shmget + int msgqid; + + /// key given by the user + long msgqkey; - //##ModelId=3EADC12A0042 - long msgqkey; //chiave passata dall'utente - - //##ModelId=3EADC12A0044 bool created; - //##ModelId=3EADC12A0045 long dimmsg; - //##ModelId=3EADC12A0048 msgbuf buf; }; diff --git a/include/MemoryBuffer.h b/include/MemoryBuffer.h index 988214c981f14b7692a82ce92193cb1971af7464..569d460dc208392030275e2bab3419b59f8e1772 100644 --- a/include/MemoryBuffer.h +++ b/include/MemoryBuffer.h @@ -2,8 +2,8 @@ MemoryBuffer.h - description ------------------- begin : Fri Apr 12 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -15,8 +15,9 @@ * * ***************************************************************************/ -#ifndef MEMORYBUFFER_H -#define MEMORYBUFFER_H +#ifndef _MEMORYBUFFER_H +#define _MEMORYBUFFER_H + #include "PacketLibDefinition.h" #include "PacketExceptionIO.h" #include "PacketException.h" @@ -24,53 +25,34 @@ namespace PacketLib { -//##ModelId=3EADC1230064 -//##Documentation -//## $Date: 2005/05/09 12:24:29 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/MemoryBuffer.h,v 1.3 2005/05/09 12:24:29 bulgarelli Exp $ -//## $Id: MemoryBuffer.h,v 1.3 2005/05/09 12:24:29 bulgarelli Exp $ -//## $Revision: 1.3 $ -//## \brief Class that represent an FIFO structure of char* +/// \brief Class that represent an FIFO structure of char* class MemoryBuffer { public: - //##ModelId=3EADC12A00B6 MemoryBuffer(); - //##ModelId=3EADC12A00B7 ~MemoryBuffer(); - //##ModelId=3EADC12A00B8 - //##Documentation - //## Write property of char** buffer. + /// Write property of char** buffer. void setbuffer( char* _newVal) throw(PacketException*);; - //##ModelId=3EADC12A00BF void setbuffer( char* _newVal, dword index) throw(PacketException*); - //##ModelId=3EADC12A00CB - //##Documentation - //## Read property of char** buffer. + /// Read property of char** buffer. char* getbuffer(); char* getlastbuffer(); - //##ModelId=3EADC12A00CD char* getbuffer(dword index); - //##ModelId=3EADC12A00D3 void readRewind(); - //##ModelId=3EADC12A00D5 void writeRewind(); - //##ModelId=3EADC12A00D6 dword getBufferDimension(); - //##ModelId=3EADC12A00D8 bool loadBuffer(char* filename) throw(PacketExceptionIO*); - //##ModelId=3EADC12A00DF bool saveBuffer(char* filename) throw(PacketExceptionIO*); void freebuffer(); @@ -96,17 +78,14 @@ private: dword dim; - //##ModelId=3EADC12A0091 char** buffer; dword indexwrite; dword indexread; - //##ModelId=3EADC12A00AF char* currentpwd; - // The name of the buffer char* bufferName; }; diff --git a/include/Output.h b/include/Output.h index 053c87cbd312b510fe910fd062f4c60010a47767..ab14441bf7df238d3fb05e29b385ce87564590f3 100644 --- a/include/Output.h +++ b/include/Output.h @@ -2,8 +2,8 @@ Output.h - description ------------------- begin : Thu Nov 29 2001 - copyright : (C) 2001 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -14,8 +14,9 @@ * For commercial purpose see appropriate license terms * * * ***************************************************************************/ -#ifndef OUTPUT_H_HEADER_INCLUDED_D25155A3 -#define OUTPUT_H_HEADER_INCLUDED_D25155A3 + +#ifndef _OUTPUT_H +#define _OUTPUT_H #include "PacketLibDefinition.h" #include "ByteStream.h" @@ -24,46 +25,30 @@ namespace PacketLib { -//##ModelId=3C51317202D1 -//##Documentation -//## $Date: 2012/06/08 15:14:29 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/Output.h,v 1.3 2012/06/08 15:14:29 bulgarelli Exp $ -//## $Id: Output.h,v 1.3 2012/06/08 15:14:29 bulgarelli Exp $ -//## $Revision: 1.3 $ -//## \brief This class represents generic type of output. +/// \brief This class represents generic type of output. class Output { public: - //##ModelId=3EADC12A0144 Output(bool bigendian); - //##ModelId=3C5131A3033F virtual void close() throw(PacketExceptionIO*) = 0; - //##ModelId=3C5131A30373 virtual bool open(char** parameters) throw(PacketExceptionIO*) = 0; - //##ModelId=3C5131A3038E virtual bool isClosed(); - //##ModelId=3EADC12A0193 virtual bool isBigendian(); - //##ModelId=3C5131B30382 virtual bool writeByteStream(ByteStream* b) throw(PacketExceptionIO*) = 0; - //##ModelId=3EADC12A01E3 virtual bool writeString(const char* str) throw(PacketExceptionIO*) = 0; - //##ModelId=3EADC12A0223 virtual int getType() = 0; protected: - //##ModelId=3EADC12A00EE bool isclosed; - //##ModelId=3EADC12A0119 bool bigendian; }; diff --git a/include/OutputFile.h b/include/OutputFile.h index c2952cf378b9dfd6b4748fe98d1fb79bb6d30853..893f9921234c359b7b7563251de2c87d9cb9bb87 100644 --- a/include/OutputFile.h +++ b/include/OutputFile.h @@ -2,8 +2,8 @@ OutputFile.h - description ------------------- begin : Mon Apr 29 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -15,8 +15,8 @@ * * ***************************************************************************/ -#ifndef OUTPUTFILE_H -#define OUTPUTFILE_H +#ifndef _OUTPUTFILE_H +#define _OUTPUTFILE_H #include "Output.h" #include "File.h" @@ -24,37 +24,24 @@ namespace PacketLib { -//##ModelId=3EADC123008A -//##Documentation -//## $Date: 2012/06/08 15:14:29 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/OutputFile.h,v 1.3 2012/06/08 15:14:29 bulgarelli Exp $ -//## $Id: OutputFile.h,v 1.3 2012/06/08 15:14:29 bulgarelli Exp $ -//## $Revision: 1.3 $ -//## \brief This class represents generic type of output. The output must be a file. +/// \brief This class represents generic type of output. The output must be a file. class OutputFile : public Output { public: - //##ModelId=3EADC12A0254 OutputFile(bool bigendian); - //##ModelId=3EADC12A0259 virtual ~OutputFile(); - //##ModelId=3EADC12A025B virtual void close() throw(PacketExceptionIO*); - //##ModelId=3EADC12A025D virtual bool open(char** parameters) throw(PacketExceptionIO*); - //##ModelId=3EADC12A0263 virtual bool writeByteStream(ByteStream* b) throw(PacketExceptionIO*); - //##ModelId=3EADC12A0269 virtual bool writeString(const char* str) throw(PacketExceptionIO*); - //##ModelId=3EADC12A026F virtual int getType() { return 0; @@ -62,10 +49,8 @@ public: protected: - //##ModelId=3EADC12A0245 File* file; - //##ModelId=3EADC12A024E char* filename; }; diff --git a/include/OutputPacketStream.h b/include/OutputPacketStream.h index a3fe946b769f5082eefcaec545f16cfbfa66f48a..633cb3d6d37a33eebcb1566576b7c13514407a49 100644 --- a/include/OutputPacketStream.h +++ b/include/OutputPacketStream.h @@ -2,8 +2,8 @@ OutputPacketStream.h - description ------------------- begin : Thu Nov 29 2001 - copyright : (C) 2001 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -14,8 +14,9 @@ * For commercial purpose see appropriate license terms * * * ***************************************************************************/ -#ifndef OutputPacketStream_h_h -#define OutputPacketStream_h_h + +#ifndef _OUTPUTPACKETSTREAM_H_H +#define _OUTPUTPACKETSTREAM_H_H #include "PacketLibDefinition.h" #include "PacketStream.h" @@ -24,33 +25,22 @@ namespace PacketLib { -//##ModelId=3C0F6C190344 -//##Documentation -//## $Date: 2005/03/09 10:57:50 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/OutputPacketStream.h,v 1.3 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Id: OutputPacketStream.h,v 1.3 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Revision: 1.3 $ -//## \brief This class represents generic output of strean if packet. +/// \brief This class represents generic output of strean if packet. class OutputPacketStream : public PacketStream { public: - //##ModelId=3EADC12A0289 OutputPacketStream(); - //##ModelId=3EADC12A0290 OutputPacketStream(const char* fileNameConfig); - //##ModelId=3EADC12A02A9 - //## Generate the output ByteStream and send it to the output. + /// Generate the output ByteStream and send it to the output. bool writePacket(Packet* p) throw(PacketExceptionIO*); - //##ModelId=3EADC12A02C8 void setOutput(Output* out); protected: - //##ModelId=3EADC12A027A Output* out; }; diff --git a/include/OutputSerial.h b/include/OutputSerial.h index bf712b6e9d8c69d7d7a7aad4cab088f40b867645..570c587f3856571f39694cad9e2c55bd35218510 100644 --- a/include/OutputSerial.h +++ b/include/OutputSerial.h @@ -1,9 +1,9 @@ /*************************************************************************** - OutputFile.h - description + OutputSerial.h - description ------------------- begin : Mon Apr 29 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -15,8 +15,8 @@ * * ***************************************************************************/ -#ifndef OUTPUTSERIAL_H -#define OUTPUTSERIAL_H +#ifndef _OUTPUTSERIAL_H +#define _OUTPUTSERIAL_H #include "Output.h" #include "Serial.h" @@ -24,37 +24,24 @@ namespace PacketLib { -//##ModelId=3EADC123008A -//##Documentation -//## $Date: 2012/06/08 15:14:29 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/OutputSerial.h,v 1.3 2012/06/08 15:14:29 bulgarelli Exp $ -//## $Id: OutputSerial.h,v 1.3 2012/06/08 15:14:29 bulgarelli Exp $ -//## $Revision: 1.3 $ -//## \brief This class represents generic type of output. The output must be a serial port. +/// \brief This class represents generic type of output. The output must be a serial port. class OutputSerial : public Output { public: - //##ModelId=3EADC12A0254 OutputSerial(bool bigendian); - //##ModelId=3EADC12A0259 virtual ~OutputSerial(); - //##ModelId=3EADC12A025B virtual void close() throw(PacketExceptionIO*); - //##ModelId=3EADC12A025D virtual bool open(char** parameters) throw(PacketExceptionIO*); - //##ModelId=3EADC12A0263 virtual bool writeByteStream(ByteStream* b) throw(PacketExceptionIO*); - //##ModelId=3EADC12A0269 virtual bool writeString(const char* str) throw(PacketExceptionIO*); - //##ModelId=3EADC12A026F virtual int getType() { return 0; @@ -63,7 +50,6 @@ public: protected: - //##ModelId=3EADC12A024E char* device; Serial* serial; int flag; diff --git a/include/OutputSocketClient.h b/include/OutputSocketClient.h index f06115e1d3eeea700f9e810feeab18fcdb20fc70..aa41ca3e0462c2de58ee71f6db04d2daa5a2d46c 100644 --- a/include/OutputSocketClient.h +++ b/include/OutputSocketClient.h @@ -2,8 +2,8 @@ OutputSocketClient.h - description ------------------- begin : Mon May 20 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -15,8 +15,8 @@ * * ***************************************************************************/ -#ifndef OUTPUTSOCKET_H -#define OUTPUTSOCKET_H +#ifndef _OUTPUTSOCKET_H +#define _OUTPUTSOCKET_H #include "Output.h" #include "SocketClient.h" @@ -24,36 +24,23 @@ namespace PacketLib { -//##ModelId=3EADC12300AB -//##Documentation -//## $Date: 2012/06/08 15:14:29 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/OutputSocketClient.h,v 1.3 2012/06/08 15:14:29 bulgarelli Exp $ -//## $Id: OutputSocketClient.h,v 1.3 2012/06/08 15:14:29 bulgarelli Exp $ -//## $Revision: 1.3 $ -//## \brief This class represents generic type of output. The output must be a file. +/// \brief This class represents generic type of output. The output must be a file. class OutputSocketClient : public Output { public: - //##ModelId=3EADC12A0305 OutputSocketClient(bool bigendian); - //##ModelId=3EADC12A0309 virtual ~OutputSocketClient(); - //##ModelId=3EADC12A030B virtual void close() throw(PacketExceptionIO*); - //##ModelId=3EADC12A030E virtual bool open(char** parameters) throw(PacketExceptionIO*); - //##ModelId=3EADC12A0314 virtual bool writeByteStream(ByteStream* b) throw(PacketExceptionIO*); - //##ModelId=3EADC12A031A virtual bool writeString(const char* str) throw(PacketExceptionIO*); - //##ModelId=3EADC12A0320 virtual int getType() { return 2; @@ -61,13 +48,10 @@ public: protected: - //##ModelId=3EADC12A02F1 SocketClient* socketclient; - //##ModelId=3EADC12A02F9 char* host; - //##ModelId=3EADC12A02FF int port; }; diff --git a/include/Packet.h b/include/Packet.h index 025c6cda46fa4da9fa8fbadf6e5e573ccb215a77..53efe149a1c1c45fd6fdb78b7fe7677f69950c30 100644 --- a/include/Packet.h +++ b/include/Packet.h @@ -2,8 +2,8 @@ Packet.h - description ------------------- begin : Thu Nov 29 2001 - copyright : (C) 2001 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -14,8 +14,9 @@ * For commercial purpose see appropriate license terms * * * ***************************************************************************/ -#ifndef PACKET_H_HEADER_INCLUDED_C37705A5 -#define PACKET_H_HEADER_INCLUDED_C37705A5 + +#ifndef _PACKET_H +#define _PACKET_H #include "PacketLibDefinition.h" #include "PacketDataField.h" @@ -36,308 +37,241 @@ namespace PacketLib { -//##ModelId=3C0F6C19034E -//##Documentation -//## Memory management: the ByteStrem passed to an object of this class isn't delete -//## to this class. The responsibility to delete the ByteStream is of the caller. -//## For deleting the external ByteStream of this class it's possible to call the -//## deleteExternalByteStream() method. -//## $Date: 2012/06/08 15:14:29 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/Packet.h,v 1.6 2012/06/08 15:14:29 bulgarelli Exp $ -//## $Id: Packet.h,v 1.6 2012/06/08 15:14:29 bulgarelli Exp $ -//## $Revision: 1.6 $ -//## \brief Represent a single packet. +/// \brief Represent a single packet. class Packet { public: - //##ModelId=3C0F6C1A0187 - //##Documentation - //## Constructor + /// Constructor Packet(bool bigendian); - //##ModelId=3EADC12C026C - //##Documentation - //## Distruttore + /// Distruttore virtual ~Packet(); - //##ModelId=3C14BA710151 virtual bool createPacketType(char* fileName, bool prefix, word dimprefix) throw (PacketException*); - //##Documentation - //## This method verifies if the ByteStream on argument contains the correct value - //## in the identifiers. If this is true, the method return true and the stream - //## contains a packet of this type. This method overloads another method. - //## \post A side effects of this method is that the value of fields of packet are set with - //## correct value. + /// This method verifies if the ByteStream on argument contains the correct value + /// in the identifiers. If this is true, the method return true and the stream + /// contains a packet of this type. This method overloads another method. + /// \post A side effects of this method is that the value of fields of packet are set with + /// correct value. virtual bool setAndVerifyPacketValue(ByteStream* prefix, ByteStream* packetHeader, ByteStream* packetDataField); - //##ModelId=3EADC12E0025 - //##Documentation - //## This method verifies if the ByteStream on argument contains the correct value - //## in the identifiers. If this is true, the method returns true and the stream - //## contains a packet of this type. This method overloads another method. - //## \post A side effect of this method is that the values of fields of packet are set with - //## correct value + /// This method verifies if the ByteStream on argument contains the correct value + /// in the identifiers. If this is true, the method returns true and the stream + /// contains a packet of this type. This method overloads another method. + /// \post A side effect of this method is that the values of fields of packet are set with + /// correct value virtual bool setAndVerifyPacketValue(ByteStream* prefix, ByteStream* packet); - //##ModelId=3C301E890023 - //##Documentation - //## Sets all the fields of the packet with correct value contained into the input ByteStream. - //## \pre The structure of the stream must be loaded. - //## \param prefix This is the prefix of the packet - //## \param packetHeader This is the header of the packet - //## \param packetDataField This is the data field of the packet - //## \post If return is true all the fields are set with the correct value. + /// Sets all the fields of the packet with correct value contained into the input ByteStream. + /// \pre The structure of the stream must be loaded. + /// \param prefix This is the prefix of the packet + /// \param packetHeader This is the header of the packet + /// \param packetDataField This is the data field of the packet + /// \post If return is true all the fields are set with the correct value. virtual bool setPacketValue(ByteStream* prefix, ByteStream* packetHeader, ByteStream* packetDataField); - //##ModelId=3EADC12F0160 - //##Documentation - //## Sets all the fields of the packet with correct value contained into the input ByteStream. - //## \pre The structure of the stream must be loaded. - //## \param prefix This is the prefix of the packet - //## \param packet This is the packet - //## \post If return is true all the fields are set with the correct value. + /// Sets all the fields of the packet with correct value contained into the input ByteStream. + /// \pre The structure of the stream must be loaded. + /// \param prefix This is the prefix of the packet + /// \param packet This is the packet + /// \post If return is true all the fields are set with the correct value. virtual bool setPacketValue(ByteStream* prefix, ByteStream* packet); - //##ModelId=3EADC12F03B1 - //##Documentation - //## Verifies if within the ByteStream passed with arguments it's present a correct packet. - //## \pre The structure of the stream must be loaded. - //## \param prefix This is the prefix of the packet - //## \param packet This is the packet - //## \return True if the ByteStream contains a packet + /// Verifies if within the ByteStream passed with arguments it's present a correct packet. + /// \pre The structure of the stream must be loaded. + /// \param prefix This is the prefix of the packet + /// \param packet This is the packet + /// \return True if the ByteStream contains a packet bool verifyPacketValue(ByteStream* prefix, ByteStream* packet); - //##ModelId=3EADC13001D3 - //##Documentation - //## Verifies if within the ByteStream passed with arguments it's present a correct packet. - //## \pre The structure of the stream must be loaded. - //## \param prefix This is the prefix of the packet. - //## \param packetHeader This is the header of the packet. - //## \param packetDataField This is the data field of the packet. - //## \return True if the ByteStream contains a packet. + /// Verifies if within the ByteStream passed with arguments it's present a correct packet. + /// \pre The structure of the stream must be loaded. + /// \param prefix This is the prefix of the packet. + /// \param packetHeader This is the header of the packet. + /// \param packetDataField This is the data field of the packet. + /// \return True if the ByteStream contains a packet. bool verifyPacketValue(ByteStream* prefix, ByteStream* packetHeader, ByteStream* packetDataField); - //##ModelId=3EADC13100D6 - //##Documentation - //## Prints to stdout the value of packet data field in a formatted mode. + /// Prints to stdout the value of packet data field in a formatted mode. virtual void printPacketValue(); - //##Documentation - //## Prints the hexadecimal dump of the prefix. + /// Prints the hexadecimal dump of the prefix. virtual char* printPrefixStream(); - //##Documentation - //## Prints the header values. + /// Prints the header values. virtual char** printHeaderValue(); - //##Documentation - //## Prints the hexadecimal dump of the header. + /// Prints the hexadecimal dump of the header. virtual char* printHeaderStream(); - //##Documentation - //## Prints the data field header values. + /// Prints the data field header values. virtual char** printDataFieldHeaderValue(); - //##Documentation - //## Prints the hexadecimal dump of the data field header. + /// Prints the hexadecimal dump of the data field header. virtual char* printDataFieldHeaderStream(); - //##Documentation - //## Prints the source data field values. + + /// Prints the source data field values. virtual char** printSourceDataFieldValue(); - //##Documentation - //## Prints the hexadecimal dump of the source data field. + + /// Prints the hexadecimal dump of the source data field. virtual char* printSourceDataFieldStream(); - //##Documentation - //## Prints the tail values + + /// Prints the tail values virtual char** printTailValue(); - //##Documentation - //## Print he hexadecimal dump of the tail. + + /// Print he hexadecimal dump of the tail. virtual char* printTailStream(); virtual char* printPacketOutputStream(); - //##ModelId=3EADC131018A - //##Documentation - //## Gets the dimension in byte of the current packet. + + /// Gets the dimension in byte of the current packet. dword getDimension(); - //##ModelId=3EADC13101E9 - //##Documentation - //## Gets the max dimension in byte of the packet. + + /// Gets the max dimension in byte of the packet. dword getMaxDimension(); - //##Documentation - //## Gets the ByteStream received as input + + /// Gets the ByteStream received as input ByteStream* getInputStream(); - //##ModelId=3EADC132003F - //##Documentation - //## Gets the packet generated with the generateStream() method. The output - //## packet is generated during this call. + + /// Gets the packet generated with the generateStream() method. The output + /// packet is generated during this call. ByteStream* getOutputStream(); - //##ModelId=3EADC131024A - //##Documentation - //## Gets the name of packet. + + /// Gets the name of packet. virtual char* getName() { return name; } - //##Documentation - //## The name of the file .packet that contains the structure of the packet + + /// The name of the file .packet that contains the structure of the packet virtual char* getFileName() { return filename; } - //##ModelId=3C187751008D - //##Documentation - //## Prints to stdout the identifiers of the packet. + + /// Prints to stdout the identifiers of the packet. virtual void printIdentifiers(); - //##ModelId=3EADC1310364 - //##Documentation - //## Deletes the ByteStream passed as arguments. + + /// Deletes the ByteStream passed as arguments. virtual void deleteExternalByteStream(); - //##ModelId=3EADC13200A5 - //##Documentation - //## Writes property of byte packetID. + + /// Writes property of byte packetID. virtual void setPacketID(const byte& value); - //##ModelId=3EADC1320266 - //##Documentation - //## Read property of byte packetID. + + /// Read property of byte packetID. virtual const byte& getPacketID(); - //##ModelId=3EADC1320336 bool thereIsPrefix(); - //##Documentation - //## This attribute represents the packet header. + + /// This attribute represents the packet header. PacketHeader *header; - //##Documentation - //## This attribute represent the packet data field. + + /// This attribute represent the packet data field. PacketDataField *dataField; - //##ModelId=3EADC12A0365 - //##Documentation - //## the prefix of the packet. + + /// the prefix of the packet. ByteStream* prefix; - //##ModelId=3EADC12A0382 - //##Documentation - //## The ByteStrem of the packet read + + /// The ByteStrem of the packet read ByteStream* packet; - //##ModelId=3EADC12A039E - //##Documentation - //## This is the ByteStream generated with generateStream(). + + /// This is the ByteStream generated with generateStream(). ByteStream* packet_output; protected: - //##ModelId=3EADC13203A3 - //##Documentation - //## Generates the stream for output. - //## \pre the number of block and the number of element for each block - //## must be set (if appliable) + + /// Generates the stream for output. + /// \pre the number of block and the number of element for each block + /// must be set (if appliable) virtual void generateStream(); - //##ModelId=3C1877510044 - //##Documentation - //## Loads the configuration of identifiers from file .packet. + + /// Loads the configuration of identifiers from file .packet. virtual bool loadIdentifiers(ConfigurationFile& file); - //##ModelId=3EADC12A03B8 - //##Documentation - //## This is the number that identifies the packet in the .stream file + + /// This is the number that identifies the packet in the .stream file byte packetID; - //##ModelId=3EADC12B006D - //##Documentation - //## The name of the packet + + /// The name of the packet char* name; - //##ModelId=3EADC12B010E - //##Documentation - //## List of identifiers. This identifiers permits to identify if the stream contains - //## a particular type of packet + + /// List of identifiers. This identifiers permits to identify if the stream contains + /// a particular type of packet PacketIdentifier** identifiers; - //##ModelId=3EADC12B012E - //##Documentation - //## List of bool that indicates which part of packet are presents into one or more - //## identifiers. 0 is the header, 1 is the data field header, 2 is the source data field + + /// List of bool that indicates which part of packet are presents into one or more + /// identifiers. 0 is the header, 1 is the data field header, 2 is the source data field bool type_of_identifier[3]; - //##ModelId=3EADC12B01D4 unsigned number_of_identifier; - //##ModelId=3EADC13301AB bool setPacketValuePrefix(ByteStream* prefix); - //##ModelId=3EADC133035E bool setPacketValueVerify(ByteStream* prefix, ByteStream* packetHeader, ByteStream* packetDataField); - //##ModelId=3EADC13403C2 bool setPacketValueDataFieldHeader(ByteStream* packetDataField); - //##ModelId=3EADC13501A2 bool setPacketValueSourceDataField(ByteStream* packetDataField); - //##ModelId=3EADC1350364 bool setPacketValueHeader(ByteStream* header); bool setPacketValueTail(ByteStream* packetDataField); - //##ModelId=3EADC1360145 void memByteStream(ByteStream* prefix, ByteStream* packetHeader, ByteStream* packetDataField); - //##ModelId=3EADC1370165 void memByteStream(ByteStream* prefix, ByteStream* packet); - //##ModelId=3EADC12B027F bool bigendian; - //##ModelId=3EADC12B032D bool thereisprefix; - //##ModelId=3EADC12B03DC word dimPrefix; - //##Documentation - //## The name of the file .packet that contains the structure of the packet + + /// The name of the file .packet that contains the structure of the packet char* filename; private: - //##ModelId=3EADC12C001B ByteStream* tempHeader; - //##ModelId=3EADC12C0043 ByteStream* tempDataField; - //##ModelId=3EADC12C006A ByteStream* tempDataFieldHeader; - //##ModelId=3EADC12C0090 ByteStream* tempPacketDataField; ByteStream* tempTail; - //##ModelId=3EADC12C00B6 bool first_output_stream_setted; }; diff --git a/include/PacketDataField.h b/include/PacketDataField.h index 7e73921965823267bf139f06a5cbb0948469c6d7..4a92aadb7c5cdca6cbf6fbbceb4e9d5c1abbbf35 100644 --- a/include/PacketDataField.h +++ b/include/PacketDataField.h @@ -2,8 +2,8 @@ PacketDataField.h - description ------------------- begin : Thu Nov 29 2001 - copyright : (C) 2001 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -14,8 +14,9 @@ * For commercial purpose see appropriate license terms * * * ***************************************************************************/ -#ifndef PacketDataField_h_h -#define PacketDataField_h_h + +#ifndef _PACKETDATAFIELD_H_H +#define _PACKETDATAFIELD_H_H #include "PacketLibDefinition.h" #include "PacketExceptionFileFormat.h" @@ -26,67 +27,44 @@ namespace PacketLib { -//##ModelId=3C0F6C190357 -//##Documentation -//## $Date: 2005/03/09 10:57:50 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/PacketDataField.h,v 1.3 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Id: PacketDataField.h,v 1.3 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Revision: 1.3 $ -//## \brief Represent the data field of the packet. +/// \brief Represent the data field of the packet. class PacketDataField : public PartOfPacket { public: - //##ModelId=3EADC13801BA - //##Documentation - //##Constructor + ///Constructor PacketDataField(); - //##ModelId=3EADC13801EB ~PacketDataField(); - //##ModelId=3EADC138021F - //##Documentation - //## Returns the number of events data block in the source data field. - //## Returns 0 if there aren't blocks. + /// Returns the number of events data block in the source data field. + /// Returns 0 if there aren't blocks. word getNumberOfRealDataBlock(); - //##ModelId=3EADC1380256 - //##Documentation - //## Sets the number of data block presents in the source data field. - //## If the number is up of the max number of data block allowed, the - //## number of real data blocks is set with the max number of blocks. + /// Sets the number of data block presents in the source data field. + /// If the number is up of the max number of data block allowed, the + /// number of real data blocks is set with the max number of blocks. void setNumberOfRealDataBlock(word number); - //##ModelId=3EADC1380316 - //##Documentation - //## Total dimension in bytes of data field. + /// Total dimension in bytes of data field. dword getDimension(); - //##ModelId=3EADC138034F - //##Documentation - //## Total max dimension in bytes of data field. + /// Total max dimension in bytes of data field. dword getMaxDimension(); - //##ModelId=3EADC138038B - //##Documentation - //## Creates the outputstream ByteStream for the generation of the output stream + /// Creates the outputstream ByteStream for the generation of the output stream virtual bool setOutputStream(ByteStream* os, word first); - //##ModelId=3EADC1390165 virtual ByteStream* generateStream(bool bigendian); - //##Documentation - //## Represents the data field header. + /// Represents the data field header. DataFieldHeader *dataFieldHeader; - //##Documentation - //## Represents the source data field. + /// Represents the source data field. SourceDataField *sourceDataField; - //##Documentation - //## The tail of the packet. It should be a Packet Error Control section. + /// The tail of the packet. It should be a Packet Error Control section. PartOfPacket* tail; }; diff --git a/include/PacketException.h b/include/PacketException.h index 5116287f9bc49979274f43b0007fe14a0dceca74..46f6af6726c3ac9439dfc5a3432892bc54ae6b4f 100644 --- a/include/PacketException.h +++ b/include/PacketException.h @@ -2,8 +2,8 @@ PacktException.h - description ------------------- begin : Tue Jan 15 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -15,49 +15,35 @@ * * ***************************************************************************/ -#ifndef PACKTEXCEPTION_H -#define PACKTEXCEPTION_H +#ifndef _PACKTEXCEPTION_H +#define _PACKTEXCEPTION_H #include "PacketLibDefinition.h" namespace PacketLib { -//##ModelId=3EADC123017C -//##Documentation -//## $Date: 2012/06/08 15:14:29 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/PacketException.h,v 1.4 2012/06/08 15:14:29 bulgarelli Exp $ -//## $Id: PacketException.h,v 1.4 2012/06/08 15:14:29 bulgarelli Exp $ -//## $Revision: 1.4 $ -//## \brief Exception class of the PacketLib +/// \brief Exception class of the PacketLib class PacketException { public: - //##ModelId=3EADC139032F PacketException(const char* error, int code = 0); - //##ModelId=3EADC1390335 virtual ~PacketException(); - //##ModelId=3EADC1390337 virtual const char* geterror(); - //##ModelId=3EADC1390339 void add(const char* error); - //##ModelId=3EADC139033C int geterrorcode() const; - //##ModelId=3EADC139033E void seterrorcode(int errorcode); protected: - //##ModelId=3EADC1390326 string* error; - //##ModelId=3EADC139032C int errorcode; }; diff --git a/include/PacketExceptionFileFormat.h b/include/PacketExceptionFileFormat.h index 8aafeab17d1dec405c45c4c06e57986af5b94eb6..6b6b264248768029442b16bb86871bc0ea5313d4 100644 --- a/include/PacketExceptionFileFormat.h +++ b/include/PacketExceptionFileFormat.h @@ -2,8 +2,8 @@ PacketExceptionFileFormat.h - description ------------------- begin : Tue Jan 15 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -15,29 +15,21 @@ * * ***************************************************************************/ -#ifndef PACKETEXCEPTIONFILEFORMAT_H -#define PACKETEXCEPTIONFILEFORMAT_H +#ifndef _PACKETEXCEPTIONFILEFORMAT_H +#define _PACKETEXCEPTIONFILEFORMAT_H #include "PacketException.h" namespace PacketLib { -//##ModelId=3C87743F030D -//##Documentation -//## $Date: 2012/06/08 15:14:29 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/PacketExceptionFileFormat.h,v 1.3 2012/06/08 15:14:29 bulgarelli Exp $ -//## $Id: PacketExceptionFileFormat.h,v 1.3 2012/06/08 15:14:29 bulgarelli Exp $ -//## $Revision: 1.3 $ -//## \brief Exception class of the PacketLib. The error is the bad file format of the configuration files. +/// \brief Exception class of the PacketLib. The error is the bad file format of the configuration files. class PacketExceptionFileFormat : public PacketException { public: - //##ModelId=3AA649E50210 PacketExceptionFileFormat(const char* error); - //##ModelId=3AA649E50219 virtual ~PacketExceptionFileFormat(); }; diff --git a/include/PacketExceptionIO.h b/include/PacketExceptionIO.h index f087cf030f10b0e4823a27f3d34898057467df23..7acca3ae8502a589589816f5719838c2581fe96b 100644 --- a/include/PacketExceptionIO.h +++ b/include/PacketExceptionIO.h @@ -2,8 +2,8 @@ PacketExceptionIO.h - description ------------------- begin : Tue Jan 15 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -15,29 +15,21 @@ * * ***************************************************************************/ -#ifndef PACKETEXCEPTIONIO_H -#define PACKETEXCEPTIONIO_H +#ifndef _PACKETEXCEPTIONIO_H +#define _PACKETEXCEPTIONIO_H #include "PacketException.h" namespace PacketLib { -//##ModelId=3C87743F0317 -//##Documentation -//## $Date: 2012/06/08 15:14:29 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/PacketExceptionIO.h,v 1.3 2012/06/08 15:14:29 bulgarelli Exp $ -//## $Id: PacketExceptionIO.h,v 1.3 2012/06/08 15:14:29 bulgarelli Exp $ -//## $Revision: 1.3 $ -//## \brief Exception class of the PacketLib. The error is an IO error. +/// \brief Exception class of the PacketLib. The error is an IO error. class PacketExceptionIO : public PacketException { public: - //##ModelId=3AA649E902A2 PacketExceptionIO(const char* error); - //##ModelId=3AA649E902AC virtual ~PacketExceptionIO(); }; diff --git a/include/PacketHeader.h b/include/PacketHeader.h index 587d0e26507017d0ad311cd2e6f13393125700b5..6e2aba3e3524da47dee8fa8bb1bbcd7243f71214 100644 --- a/include/PacketHeader.h +++ b/include/PacketHeader.h @@ -2,8 +2,8 @@ PacketHeader.h - description ------------------- begin : Thu Nov 29 2001 - copyright : (C) 2001 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -14,8 +14,9 @@ * For commercial purpose see appropriate license terms * * * ***************************************************************************/ -#ifndef PacketHeader_h_h -#define PacketHeader_h_h + +#ifndef _PACKETHEADER_H_H +#define _PACKETHEADER_H_H #include "PacketLibDefinition.h" #include "PartOfPacket.h" @@ -23,45 +24,30 @@ namespace PacketLib { -//##ModelId=3C0F6C19035E -//##Documentation -//## $Date: 2005/03/09 10:57:50 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/PacketHeader.h,v 1.3 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Id: PacketHeader.h,v 1.3 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Revision: 1.3 $ -//## \brief Header of packet. +/// \brief Header of packet. class PacketHeader : public PartOfPacket { public: - //##ModelId=3EADC13A0088 PacketHeader(); - //##ModelId=3EADC13A0016 ~PacketHeader(); - //##ModelId=3C0F6C1A01DC - //##Documentation - //## Sets the name of packet header + /// Sets the name of packet header void setName(char* n) { name = n; }; - //##ModelId=3C14980F00F2 - //##Documentation - //## Loads data header from configuration file. + /// Loads data header from configuration file. bool loadHeader(char* fileName) throw(PacketException*); - //##ModelId=3C15ED930064 - //##Documentation - //## Returns the total lenght of packet data field (data field header plus source data field) + /// Returns the total lenght of packet data field (data field header plus source data field) dword getPacketLength(); //set the length of the packet in the 'packet lenght' field (the data field dimension - 1) void setPacketLength(dword dim); - //##ModelId=3EADC13A00BC Field * getFieldWithPacketDimension(); inline word getDimensionOfPacketLenght() @@ -71,16 +57,13 @@ public: private: - //##ModelId=3EADC1390359 - //##Documentation - //## Packet name + /// Packet name char* name; - //##Documentation - //## Numbers of fields into the header that contains the dimension of packet. + /// Numbers of fields into the header that contains the dimension of packet. word numberOfFieldWithPacketDimension; - //16 or 32 bit + /// 16 or 32 bit word dimensionOfPacketLenght; }; diff --git a/include/PacketIdentifier.h b/include/PacketIdentifier.h index 1cb9921ae814f01fe2c84d0157619640f1873bf7..920b93d99352976ce6db1027c4099f2e7c7b7ee4 100644 --- a/include/PacketIdentifier.h +++ b/include/PacketIdentifier.h @@ -2,8 +2,8 @@ PacketIdentifier.h - description ------------------- begin : Thu Nov 29 2001 - copyright : (C) 2001 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -14,43 +14,32 @@ * For commercial purpose see appropriate license terms * * * ***************************************************************************/ -#ifndef PacketIdentifier_h_h -#define PacketIdentifier_h_h + +#ifndef _PACKETIDENTIFIER_H_H +#define _PACKETIDENTIFIER_H_H #include "PacketLibDefinition.h" namespace PacketLib { -//##ModelId=3C0F6C190364 -//##Documentation -//## $Date: 2005/03/09 10:57:50 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/PacketIdentifier.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Id: PacketIdentifier.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Revision: 1.2 $ -//## \brief Identifier of packet. +/// \brief Identifier of packet. class PacketIdentifier { public: - //##ModelId=3EADC13A0178 word fieldNumber; - //##ModelId=3C0F6C1A01EC - //##Documentation - //## This field rappresent which list of fields read: - //## \li 0 - List of fields of PacketHeader; - //## \li 1 - List of fields of DataFieldHeader - //## \li 2 - List of fields of SourceDataField + /// This field rappresent which list of fields read: + /// \li 0 - List of fields of PacketHeader; + /// \li 1 - List of fields of DataFieldHeader + /// \li 2 - List of fields of SourceDataField byte type; - //##ModelId=3EADC13A0199 word value; - //##ModelId=3C18775100C8 PacketIdentifier(int fn, byte t, word v); - //##ModelId=3EADC13A01FC ~PacketIdentifier(); }; diff --git a/include/PacketLibDefinition.h b/include/PacketLibDefinition.h index 2a3d2a610c843161bcf032ff48209e05dfbd5ec4..4c42d7d80d39717f7629f57569ad083917c6c24a 100644 --- a/include/PacketLibDefinition.h +++ b/include/PacketLibDefinition.h @@ -1,9 +1,9 @@ /*************************************************************************** - Definition.h - description + PacketLibDefinition.h - description ------------------- begin : Tue Nov 27 2001 - copyright : (C) 2001 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -14,8 +14,9 @@ * For commercial purpose see appropriate license terms * * * ***************************************************************************/ -#ifndef Definition_h_h -#define Definition_h_h + +#ifndef _DEFINITION_H_H +#define _DEFINITION_H_H #include #include @@ -32,26 +33,24 @@ #define DEBUGMODE 0 #define ERRORMODE 1 #define EXCEPTION_ENABLED 1 -//#define NULL 0 +/// define NULL 0 #define ARCH_BIGENDIAN 0 -//#define NOFIELDSNAME +/// define NOFIELDSNAME -//#define PRINTDEBUG(strprint) if(DEBUGMODE) cout << strprint << endl; +///define PRINTDEBUG(strprint) if(DEBUGMODE) cout << strprint << endl; #define PRINTDEBUG(strprint) if(DEBUGMODE) cout << strprint << endl; #define PRINTERROR(strprint) if(ERRORMODE) cerr << strprint << endl; -//##ModelId=3C0F6C190397 namespace PacketLib { - -//##ModelId=3EADC124020F -typedef unsigned char byte; //1 byte for both 32 and 64 bit system -//##ModelId=3C187750017C -typedef unsigned short word; //2 byte for both 32 and 64 bit system -//##ModelId=3EADC124021D -typedef unsigned int dword; //4 byte for both 32 and 64 bit system +/// 1 byte for both 32 and 64 bit system +typedef unsigned char byte; +///2 byte for both 32 and 64 bit system +typedef unsigned short word; +/// 4 byte for both 32 and 64 bit system +typedef unsigned int dword; } @@ -62,7 +61,7 @@ typedef unsigned int dword; //4 byte for both 32 and 64 bit system #define CONFIG_MAXNUMBER_OFCONFIGILES 20000 #define CONFIG_MAXNUMBEROFLINES_OFCONFIGILES 100000 -//typedef bool boolean; +/// typedef bool boolean; using namespace std; #endif diff --git a/include/PacketLibDemo.h b/include/PacketLibDemo.h index cf8fb029994d076eecbf16c87b48070cc2326164..31676e46e246ca6ffa2efd9a4c216cec91e68678 100644 --- a/include/PacketLibDemo.h +++ b/include/PacketLibDemo.h @@ -1,16 +1,32 @@ -#ifndef Demo_h_h -#define Demo_h_h +/*************************************************************************** + PacketLibDemo.h - description + ------------------- + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software for non commercial purpose * + * and for public research institutes; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License. * + * For commercial purpose see appropriate license terms * + * * + ***************************************************************************/ + +#ifndef _DEMO_H_H +#define _DEMO_H_H #include #define DEMOMODE 0 #define STARTTIME 1114771000 #define NSECDEMO 2592000 -#define DEMORET if(DEMOMODE) if(difftime(time(NULL), STARTTIME) > NSECDEMO) { cerr << "PacketLib: demo period expired. Contact: bulgarelli@bo.iasf.cnr.it" << endl; return; }; +#define DEMORET if(DEMOMODE) if(difftime(time(NULL), STARTTIME) > NSECDEMO) { cerr << "PacketLib: demo period expired. Contact: bulgarelli@iasfbo.inaf.it" << endl; return; }; #define DEMORET0_STRONG if(DEMOMODE) \ if(difftime(time(NULL), STARTTIME) > NSECDEMO || fopen("/tmp/SYM34TU3IOP", "r") != 0 ) { \ fopen("/tmp/SYM34TU3IOP", "w"); \ - cerr << "PacketLib: demo period expired. Contact: bulgarelli@bo.iasf.cnr.it" << endl; return 0; }; + cerr << "PacketLib: demo period expired. Contact: bulgarelli@iasfbo.inaf.it" << endl; return 0; }; #define DEMORET0 if(DEMOMODE) \ if(difftime(time(NULL), STARTTIME) > NSECDEMO ) { \ - cerr << "PacketLib: demo period expired. Contact: bulgarelli@bo.iasf.cnr.it" << endl; return 0; }; + cerr << "PacketLib: demo period expired. Contact: bulgarelli@iasfbo.inaf.it" << endl; return 0; }; #endif diff --git a/include/PacketNotRecognized.h b/include/PacketNotRecognized.h index a4488918f3dd0b9a2e4961d8ebe07d520b143907..7d48d9b4f2de87587e2b8352acb6d80a724182c1 100644 --- a/include/PacketNotRecognized.h +++ b/include/PacketNotRecognized.h @@ -2,8 +2,8 @@ PacketNotRecognized.h - description ------------------- begin : Mon Jan 21 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -15,8 +15,8 @@ * * ***************************************************************************/ -#ifndef PACKETNOTRECOGNIZED_H -#define PACKETNOTRECOGNIZED_H +#ifndef _PACKETNOTRECOGNIZED_H +#define _PACKETNOTRECOGNIZED_H #include "Packet.h" #include "PacketLibDefinition.h" @@ -24,27 +24,17 @@ namespace PacketLib { -//##ModelId=3C87743F0349 -//##Documentation -//## $Date: 2005/03/09 10:57:50 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/PacketNotRecognized.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Id: PacketNotRecognized.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Revision: 1.2 $ -//## \brief Packet not recognized. +/// \brief Packet not recognized. class PacketNotRecognized : public Packet { public: - //##ModelId=3AA64A03005A PacketNotRecognized(bool bigendian); - //##ModelId=3AA64A03005B virtual ~PacketNotRecognized(); - //##ModelId=3AA64A03005D virtual bool createPacketType(char* fileName, bool prefix, word dimprefix) throw (PacketException*); - //##ModelId=3AA64A030065 virtual bool setPacketValue(ByteStream* prefix, ByteStream* packetHeader, ByteStream* packetDataField); }; diff --git a/include/PacketStream.h b/include/PacketStream.h index 247b0b3a727b271140ff5cf5d8f82ed790cd5822..9e1d25c6ed63f9dabbf5f322b5ecd289a7c26437 100644 --- a/include/PacketStream.h +++ b/include/PacketStream.h @@ -2,8 +2,8 @@ PacketStream.h - description ------------------- begin : Thu Nov 29 2001 - copyright : (C) 2001 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -14,8 +14,9 @@ * For commercial purpose see appropriate license terms * * * ***************************************************************************/ -#ifndef PacketStream_h_h -#define PacketStream_h_h + +#ifndef _PACKETSTREAM_H_H +#define _PACKETSTREAM_H_H #include "PacketLibDefinition.h" #include "Packet.h" @@ -25,99 +26,65 @@ namespace PacketLib { -//##ModelId=3C0F6C19036A -//##Documentation -//## $Date: 2012/06/08 15:14:29 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/PacketStream.h,v 1.16 2012/06/08 15:14:29 bulgarelli Exp $ -//## $Id: PacketStream.h,v 1.16 2012/06/08 15:14:29 bulgarelli Exp $ -//## $Revision: 1.16 $ -//## \brief Stream of byte with packets. +/// \brief Stream of byte with packets. class PacketStream { public: - //##ModelId=3EADC13A0371 PacketStream(const char* fileNameConfig) ; - //##ModelId=3EADC13A03D1 PacketStream(); - //##ModelId=3EADC13B0004 ~PacketStream(); - //##ModelId=3EADC13B0020 void setFileNameConfig(const char* f); - //##ModelId=3EADC13B0085 - //##Documentation - //## This method creates the structure of the stream. - //## The structure of the stream is represented with the pachetReference and the collection of type of packet. - //## Each packet has the collection of field and the collection of identifier + /// This method creates the structure of the stream. + /// The structure of the stream is represented with the pachetReference and the collection of type of packet. + /// Each packet has the collection of field and the collection of identifier bool createStreamStructure() throw(PacketException*); - //##ModelId=3EADC13B00A5 - //##Documentation - //## Return a packet of index passed as parameters. + /// Return a packet of index passed as parameters. Packet* getPacketType(int index); - //##ModelId=3EADC13B0111 static char* packetLibVersion() { return (char*) "PacketLib version: 1.3.9 - June 2012"; }; - //##ModelId=3EADC13B0143 bool isBigEndian(); - //##ModelId=3EADC13B0164 bool thereIsPrefix(); - //##ModelId=3EADC13B0187 word getNumberOfPacketType(); - //##ModelId=3EADC13B01AA - //##Documentation - //## Gets the dimension (in bytes) of the prefix of all the packets of the stream + /// Gets the dimension (in bytes) of the prefix of all the packets of the stream word getPrefixDimension() const; - //##ModelId=3EADC13B01E2 - //##Documentation - //## Gets the dimension (in bytes) of the header of all the packets of the stream + /// Gets the dimension (in bytes) of the header of all the packets of the stream word getHeaderDimension() const; - //##ModelId=3EADC13A0243 PacketHeader* headerReference; - //##ModelId=3EADC13A024F char* filenameConfig; char* pathFileNameConfig; protected: - //##ModelId=3EADC13A0283 - //##Documentation - //## List of packet. + /// List of packet. Packet** packetType; - //##ModelId=3EADC13A0292 - //##Documentation - //## Numbers of type of packet presents + /// Numbers of type of packet presents byte numberOfPacketType; - //##ModelId=3EADC13A02D5 - //##Documentation - //## Indicates if there is a prefix. + /// Indicates if there is a prefix. bool prefix; - //##ModelId=3EADC13A0319 - //##Documentation - //## Indicates if the machine is bigendian. + /// Indicates if the machine is bigendian. bool bigendian; - //##ModelId=3EADC13A0360 - //##Documentation - //## Indicates the dimension of prefix. + /// Indicates the dimension of prefix. word dimPrefix; }; diff --git a/include/PartOfPacket.h b/include/PartOfPacket.h index f2db9a6d63ce63ba190bb48a1c18fcfe0e8b605a..2a50732256295ea797b2c5c2a4bafd64ab5107db 100644 --- a/include/PartOfPacket.h +++ b/include/PartOfPacket.h @@ -2,8 +2,8 @@ PartOfPacket.h - description ------------------- begin : Thu Dec 6 2001 - copyright : (C) 2001 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -15,8 +15,8 @@ * * ***************************************************************************/ -#ifndef PARTOFPACKET_H -#define PARTOFPACKET_H +#ifndef _PARTOFPACKET_H +#define _PARTOFPACKET_H #include "InputText.h" #include "Field.h" @@ -31,48 +31,47 @@ namespace PacketLib extern word pattern[17]; -//This class represent a subset of the packet. This class has been created for grouping -//the common behaviours of PacketHeader, DataFieldHeader and SourceDataField -//\brief Single part of packet. +/// This class represent a subset of the packet. This class has been created for grouping +/// the common behaviours of PacketHeader, DataFieldHeader and SourceDataField +/// \brief Single part of packet. class PartOfPacket { public: - //Constructor + /// Constructor PartOfPacket(const char* popName = 0); - //Virtual destructor + /// Virtual destructor virtual ~PartOfPacket(); - //Prints the structure of this part of packet. + /// Prints the structure of this part of packet. virtual string* printStructure(); - //Prints the value of each field of this part of packet. + /// Prints the value of each field of this part of packet. virtual char** printValue(const char* addString = ""); virtual void printValueStdout(); - //This method loads the field present into the InputText (passed with the - //parameter). - //The InputText must be open and the internal pointer of the file must - //be in the first line that describes the fields. + /// This method loads the field present into the InputText (passed with the + /// parameter). + /// The InputText must be open and the internal pointer of the file must + /// be in the first line that describes the fields. virtual bool loadFields(InputText& fp) throw(PacketException*); - //This method loads the field present into the MemoryBuffer (passed with the - //parameter). + /// This method loads the field present into the MemoryBuffer (passed with the + /// parameter). virtual bool loadFields(MemoryBuffer* mb) throw(PacketException*); - //##ModelId=3EADC13C029C virtual MemoryBuffer* loadFieldsInBuffer(InputText & fp); - //Returns the dimension (in byte) of this part of packet. + /// Returns the dimension (in byte) of this part of packet. virtual inline dword getDimension() { return fieldsDimension / 8; }; - //Returns a pointer of a field in the list of fields of this part of packet. - //\param index Represent the index in the list. + /// Returns a pointer of a field in the list of fields of this part of packet. + /// \param index Represent the index in the list. virtual inline Field* getFields(word index) { if(index < numberOfFields) @@ -81,8 +80,8 @@ public: return 0; }; - //Returns the value of a field in the list of fields of this part of packet. - //\param index Represent the index in the list. + /// Returns the value of a field in the list of fields of this part of packet. + /// \param index Represent the index in the list. virtual inline word getFieldValue(word index) { if(index < numberOfFields) @@ -91,187 +90,187 @@ public: return 0; }; - //Returns the value of a field in the list of fields of this part of packet. - //The value returned is interpreted as a real single precision (IEEE 754). - //The index of the argument is the first 16 bit field of the 2 fields that compound - //the 32 bit real single precision. The layout foreseen is the following: - //--------------------------------- - //- float last 16 bits - the index passed as argument - //--------------------------------- - //- float first 16 bits - the index + 1 - //--------------------------------- - //This corresponds with the PTC=5, PFC = 1. - //\param index Represent the index of the field. + /// Returns the value of a field in the list of fields of this part of packet. + /// The value returned is interpreted as a real single precision (IEEE 754). + /// The index of the argument is the first 16 bit field of the 2 fields that compound + /// the 32 bit real single precision. The layout foreseen is the following: + /// --------------------------------- + /// - float last 16 bits - the index passed as argument + /// --------------------------------- + /// - float first 16 bits - the index + 1 + /// --------------------------------- + /// This corresponds with the PTC=5, PFC = 1. + /// \param index Represent the index of the field. virtual float getFieldValue_5_1(word index); - //## Set the value of a field. The value is interpreted as a real single - //## precision (IEEE 754). - //## The index of the argument is the first 16 bit field of the 2 fields that compound - //## the 32 bit real single precision. The layout foreseen is the following: - //## --------------------------------- - //## - float last 16 bits - the index passed as argument - //## --------------------------------- - //## - float first 16 bits - the index + 1 - //## --------------------------------- - //## This corresponds with the PTC=5, PFC = 1. - //## See setFieldValue(word index, word value) for general considerations. - //## \param index Represent the index of the field. - //## \param value The real single precision value + /// Set the value of a field. The value is interpreted as a real single + /// precision (IEEE 754). + /// The index of the argument is the first 16 bit field of the 2 fields that compound + /// the 32 bit real single precision. The layout foreseen is the following: + /// --------------------------------- + /// - float last 16 bits - the index passed as argument + /// --------------------------------- + /// - float first 16 bits - the index + 1 + /// --------------------------------- + /// This corresponds with the PTC=5, PFC = 1. + /// See setFieldValue(word index, word value) for general considerations. + /// \param index Represent the index of the field. + /// \param value The real single precision value virtual void setFieldValue_5_1(word index, float value); - //## Returns the value of a field in the list of fields of this part of packet. - //## The value returned is interpreted as a 32 bit signed integer. - //## The index of the argument is the first 16 bit field of the 2 fields that compound - //## the 32 bit signed integer. The layout foreseen is the following: - //## --------------------------------- - //## - 32 bit int MSB 16 bits - the index passed as argument - //## --------------------------------- - //## - 32 bit int LSB 16 bits - the index + 1 - //## --------------------------------- - //## This corresponds with the PTC=4, PFC = 14. - //## \param index Represent the index of the field. + /// Returns the value of a field in the list of fields of this part of packet. + /// The value returned is interpreted as a 32 bit signed integer. + /// The index of the argument is the first 16 bit field of the 2 fields that compound + /// the 32 bit signed integer. The layout foreseen is the following: + /// --------------------------------- + /// - 32 bit int MSB 16 bits - the index passed as argument + /// --------------------------------- + /// - 32 bit int LSB 16 bits - the index + 1 + /// --------------------------------- + /// This corresponds with the PTC=4, PFC = 14. + /// \param index Represent the index of the field. virtual signed long getFieldValue_4_14(word index); - //## Sets the value of a field. The value is interpreted as a 32 bit signed integer. - //## The index of the argument is the first 16 bit field of the 2 fields that compound - //## the 32 bit signed integer. The layout foreseen is the following: - //## --------------------------------- - //## - 32 bit int MSB 16 bits - the index passed as argument - //## --------------------------------- - //## - 32 bit int LSB 16 bits - the index + 1 - //## --------------------------------- - //## This corresponds with the PTC=4, PFC = 14. - //## See setFieldValue(word index, word value) for general considerations. - //## \param index Represent the index of the field. - //## \param value The 32 bit signed integer value. + /// Sets the value of a field. The value is interpreted as a 32 bit signed integer. + /// The index of the argument is the first 16 bit field of the 2 fields that compound + /// the 32 bit signed integer. The layout foreseen is the following: + /// --------------------------------- + /// - 32 bit int MSB 16 bits - the index passed as argument + /// --------------------------------- + /// - 32 bit int LSB 16 bits - the index + 1 + /// --------------------------------- + /// This corresponds with the PTC=4, PFC = 14. + /// See setFieldValue(word index, word value) for general considerations. + /// \param index Represent the index of the field. + /// \param value The 32 bit signed integer value. virtual void setFieldValue_4_14(word index, signed long value); - //## Returns the value of a field in the list of fields of this part of packet. - //## The value returned is interpreted as a 24 bit signed integer. - //## The index of the argument is the first 16 bit field of the 2 fields that compound - //## the 24 bit signed integer. The layout foreseen is the following: - //## --------------------------------- - //## - 24 bit int MSB 16 bits - the index passed as argument - //## --------------------------------- - //## - 24 bit int LSB 8 bits - the index + 1 - //## --------------------------------- - //## This corresponds with the PTC=4, PFC = 13. - //## \param index Represent the index of the field. - //## \return the 24 bit signed data converted in a long 32 bit + /// Returns the value of a field in the list of fields of this part of packet. + /// The value returned is interpreted as a 24 bit signed integer. + /// The index of the argument is the first 16 bit field of the 2 fields that compound + /// the 24 bit signed integer. The layout foreseen is the following: + /// --------------------------------- + /// - 24 bit int MSB 16 bits - the index passed as argument + /// --------------------------------- + /// - 24 bit int LSB 8 bits - the index + 1 + /// --------------------------------- + /// This corresponds with the PTC=4, PFC = 13. + /// \param index Represent the index of the field. + /// \return the 24 bit signed data converted in a long 32 bit virtual signed long getFieldValue_4_13(word index); - //## Sets the value of a field. The value is interpreted as a 24 bit signed integer. - //## The index of the argument is the first 16 bit field of the 2 fields that compound - //## the 24 bit signed integer. The layout foreseen is the following: - //## --------------------------------- - //## - 24 bit int MSB 16 bits - the index passed as argument - //## --------------------------------- - //## - 24 bit int LSB 8 bits - the index + 1 - //## --------------------------------- - //## This corresponds with the PTC=4, PFC = 13. - //## See setFieldValue(word index, word value) for general considerations. - //## \param index Represent the index of the field. - //## \param value The 24 bit signed integer value. The long value is converted in a - //## 24 bit data format (bit0 with the sign became 24 bit) + /// Sets the value of a field. The value is interpreted as a 24 bit signed integer. + /// The index of the argument is the first 16 bit field of the 2 fields that compound + /// the 24 bit signed integer. The layout foreseen is the following: + /// --------------------------------- + /// - 24 bit int MSB 16 bits - the index passed as argument + /// --------------------------------- + /// - 24 bit int LSB 8 bits - the index + 1 + /// --------------------------------- + /// This corresponds with the PTC=4, PFC = 13. + /// See setFieldValue(word index, word value) for general considerations. + /// \param index Represent the index of the field. + /// \param value The 24 bit signed integer value. The long value is converted in a + /// 24 bit data format (bit0 with the sign became 24 bit) virtual void setFieldValue_4_13(word index, signed long value) throw(PacketException*); - //## Returns the value of a field in the list of fields of this part of packet. - //## The value returned is interpreted as a 32 bit unsigned integer. - //## The index of the argument is the first 16 bit field of the 2 fields that compound - //## the 32 bit unsigned long. The layout foreseen is the following: - //## --------------------------------- - //## - 32 bit int MSB 16 bits - the index passed as argument - //## --------------------------------- - //## - 32 bit int LSB 16 bits - the index + 1 - //## --------------------------------- - //## This corresponds with the PTC=3, PFC = 14. - //## \param index Represent the index of the field. + /// Returns the value of a field in the list of fields of this part of packet. + /// The value returned is interpreted as a 32 bit unsigned integer. + /// The index of the argument is the first 16 bit field of the 2 fields that compound + /// the 32 bit unsigned long. The layout foreseen is the following: + /// --------------------------------- + /// - 32 bit int MSB 16 bits - the index passed as argument + /// --------------------------------- + /// - 32 bit int LSB 16 bits - the index + 1 + /// --------------------------------- + /// This corresponds with the PTC=3, PFC = 14. + /// \param index Represent the index of the field. virtual unsigned long getFieldValue_3_14(word index); - //## Sets the value of a field. The value is interpreted as a 32 bit unsigned integer. - //## The index of the argument is the first 16 bit field of the 2 fields that compound - //## the 32 bit unsigned long. The layout foreseen is the following: - //## --------------------------------- - //## - 32 bit int MSB 16 bits - the index passed as argument - //## --------------------------------- - //## - 32 bit int LSB 16 bits - the index + 1 - //## --------------------------------- - //## This corresponds with the PTC=3, PFC = 14. - //## See setFieldValue(word index, word value) for general considerations. - //## \param index Represent the index of the field. - //## \param value The 32 bit unsigned integer value. + /// Sets the value of a field. The value is interpreted as a 32 bit unsigned integer. + /// The index of the argument is the first 16 bit field of the 2 fields that compound + /// the 32 bit unsigned long. The layout foreseen is the following: + /// --------------------------------- + /// - 32 bit int MSB 16 bits - the index passed as argument + /// --------------------------------- + /// - 32 bit int LSB 16 bits - the index + 1 + /// --------------------------------- + /// This corresponds with the PTC=3, PFC = 14. + /// See setFieldValue(word index, word value) for general considerations. + /// \param index Represent the index of the field. + /// \param value The 32 bit unsigned integer value. virtual void setFieldValue_3_14(word index, unsigned long value); - //## Returns the value of a field in the list of fields of this part of packet. - //## The value returned is interpreted as a 24 bit unsigned integer. - //## The index of the argument is the first 16 bit field of the 2 fields that compound - //## the 24 bit unsigned long. The layout foreseen is the following: - //## --------------------------------- - //## - 24 bit int MSB 16 bits - the index passed as argument - //## --------------------------------- - //## - 24 bit int LSB 8 bits - the index + 1 - //## --------------------------------- - //## This corresponds with the PTC=3, PFC = 13. - //## \param index Represent the index of the field. + /// Returns the value of a field in the list of fields of this part of packet. + /// The value returned is interpreted as a 24 bit unsigned integer. + /// The index of the argument is the first 16 bit field of the 2 fields that compound + /// the 24 bit unsigned long. The layout foreseen is the following: + /// --------------------------------- + /// - 24 bit int MSB 16 bits - the index passed as argument + /// --------------------------------- + /// - 24 bit int LSB 8 bits - the index + 1 + /// --------------------------------- + /// This corresponds with the PTC=3, PFC = 13. + /// \param index Represent the index of the field. virtual unsigned long getFieldValue_3_13(word index); - //## Sets the value of a field. The value is interpreted as a 24 bit unsigned integer. - //## The index of the argument is the first 16 bit field of the 2 fields that compound - //## the 24 bit unsigned long. The layout foreseen is the following: - //## --------------------------------- - //## - 24 bit int MSB 16 bits - the index passed as argument - //## --------------------------------- - //## - 24 bit int LSB 8 bits - the index + 1 - //## --------------------------------- - //## This corresponds with the PTC=3, PFC = 13. - //## See setFieldValue(word index, word value) for general considerations. - //## \param index Represent the index of the field. - //## \param value The 24 bit unsigned integer value. + /// Sets the value of a field. The value is interpreted as a 24 bit unsigned integer. + /// The index of the argument is the first 16 bit field of the 2 fields that compound + /// the 24 bit unsigned long. The layout foreseen is the following: + /// --------------------------------- + /// - 24 bit int MSB 16 bits - the index passed as argument + /// --------------------------------- + /// - 24 bit int LSB 8 bits - the index + 1 + /// --------------------------------- + /// This corresponds with the PTC=3, PFC = 13. + /// See setFieldValue(word index, word value) for general considerations. + /// \param index Represent the index of the field. + /// \param value The 24 bit unsigned integer value. virtual void setFieldValue_3_13(word index, unsigned long value) throw(PacketException*); - //##Documentation - //## Sets the value of a field in the list of fields of this part of packet. Remember that - //## if a predefined value is specified in the .stream, this method has not effect and the - //## value contained in the .stream is used. - //## \param index Represent the index in the list. - //## \param value The value must be set. + ///Documentation + /// Sets the value of a field in the list of fields of this part of packet. Remember that + /// if a predefined value is specified in the .stream, this method has not effect and the + /// value contained in the .stream is used. + /// \param index Represent the index in the list. + /// \param value The value must be set. virtual void setFieldValue(word index, word value); - //## Returns the number of fields. + /// Returns the number of fields. virtual inline word getNumberOfFields() { return numberOfFields; }; - //## Sets the stream of byte. This method assigns the value of stream for each field of part of packet + /// Sets the stream of byte. This method assigns the value of stream for each field of part of packet virtual bool setByteStream(ByteStream* s); - //## Represent current stream reads from input. + /// Represent current stream reads from input. ByteStream* stream; - //## Represent current stream writes to output. + /// Represent current stream writes to output. ByteStream* outputstream; - //## Generates the stream. + /// Generates the stream. virtual ByteStream* generateStream(bool bigendian); - //## Creates the outputstream ByteStream for the generation of the output stream + /// Creates the outputstream ByteStream for the generation of the output stream virtual bool setOutputStream(ByteStream* os, dword first); - //## In a recoursive structure, the PartOfPacket that contains this PartOfPacket + /// In a recoursive structure, the PartOfPacket that contains this PartOfPacket PartOfPacket* previous; char* popName; protected: - //## List of field of part of packet. + /// List of field of part of packet. Field** fields; - //## Dimension in bit of fields. + /// Dimension in bit of fields. word fieldsDimension; - //## Number of fields. + /// Number of fields. word numberOfFields; private: diff --git a/include/PlVersion.h b/include/PlVersion.h index cb0b3c63da88e9e597e716240fc182fb224da414..9ee55c1877d44d2e58af1a35130d7a253fb70d4c 100644 --- a/include/PlVersion.h +++ b/include/PlVersion.h @@ -1 +1 @@ -#define VERSION 1.3.8 +#define VERSION 2.0.1 diff --git a/include/SDFBFBlock.h b/include/SDFBFBlock.h index 55df1d387879112e480f110901670d790d97fca3..883ee5e0ddffb4c7f36a31571c3723361aa09336 100644 --- a/include/SDFBFBlock.h +++ b/include/SDFBFBlock.h @@ -1,9 +1,9 @@ /*************************************************************************** - PartOfPacket.h - description + SDFBFBlock.h - description ------------------- begin : Thu Dec 6 2001 - copyright : (C) 2001 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -14,8 +14,9 @@ * For commercial purpose see appropriate license terms * * * ***************************************************************************/ -#ifndef SDFBFBLOCK_H_HEADER_INCLUDED_8B2C5B89 -#define SDFBFBLOCK_H_HEADER_INCLUDED_8B2C5B89 + +#ifndef _SDFBFBLOCK_H +#define _SDFBFBLOCK_H #include "PacketLibDefinition.h" #include "PartOfPacket.h" @@ -23,13 +24,7 @@ namespace PacketLib { -//##ModelId=3C3480CB0382 -//##Documentation -//## $Date: 2005/03/09 10:57:50 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/SDFBFBlock.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Id: SDFBFBlock.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Revision: 1.2 $ -//## \brief Represent a single block with the number of fields fixed. +/// \brief Represent a single block with the number of fields fixed. class SDFBFBlock : public PartOfPacket { diff --git a/include/SDFBVBlock.h b/include/SDFBVBlock.h index ffb35788e1fd7b8f60654590eab8d2a4a9ee10db..a7963853255d5208b4583e7c73f6fb741ae58d7c 100644 --- a/include/SDFBVBlock.h +++ b/include/SDFBVBlock.h @@ -2,8 +2,8 @@ SDFBVBlock.h - description ------------------- begin : Thu Nov 29 2001 - copyright : (C) 2001 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -14,8 +14,9 @@ * For commercial purpose see appropriate license terms * * * ***************************************************************************/ -#ifndef SDFBVBLOCK_H_INCLUDED_B71C5D6D -#define SDFBVBLOCK_H_INCLUDED_B71C5D6D + +#ifndef _SDFBVBLOCK_H +#define _SDFBVBLOCK_H #include "PacketLibDefinition.h" #include "SDFBVBlockFixed.h" @@ -24,54 +25,34 @@ namespace PacketLib { -//##Documentation -//## $Date: 2005/03/09 10:57:50 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/SDFBVBlock.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Id: SDFBVBlock.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Revision: 1.2 $ -//## \brief Class wich represents a single block with a fixed part and with a variable part. +/// \brief Class wich represents a single block with a fixed part and with a variable part. class SDFBVBlock : public PartOfPacket { public: - //##ModelId=3EADC14203A4 - //##D SDFBVBlockFixed fixed; - //##ModelId=3EADC14203AB SDFBVBlockVariable* variables; - //##ModelId=3EADC14203B1 word getNumberOfFields(); - //##ModelId=3EADC14203B2 Field* getFields(word index); - //##ModelId=3EADC14203B7 - //##Documentation - //## word getFieldValue(word index); void setFieldValue(word index, word value); - //##ModelId=3EADC14203BB dword getDimension(); - //##ModelId=3EADC14203BD - //##Documentation - //## Total max dimension in bytes of block + /// Total max dimension in bytes of block dword getMaxDimension(); - //##ModelId=3EADC14203BF bool setOutputStream(ByteStream* os, dword first); - //##ModelId=3EADC14203C6 ByteStream* generateStream(bool bigendian); - //##ModelId=3EADC1430127 virtual word getNumberOfRealElement(); - //##ModelId=3EADC143012C virtual void setNumberOfRealElement(word value); virtual word getMaxNumberOfElements(); diff --git a/include/SDFBVBlockFixed.h b/include/SDFBVBlockFixed.h index 88a8b8b692b02007a3466b54ea910a3f23135f00..b3e2b8d862a8281eed1754337ad1dacdfac17c2d 100644 --- a/include/SDFBVBlockFixed.h +++ b/include/SDFBVBlockFixed.h @@ -2,8 +2,8 @@ SDFBVBlockFixed.h - description ------------------- begin : Thu Nov 29 2001 - copyright : (C) 2001 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -14,8 +14,9 @@ * For commercial purpose see appropriate license terms * * * ***************************************************************************/ -#ifndef SDFBVBLOCKFIXED_H_INCLUDED_C36FC736 -#define SDFBVBLOCKFIXED_H_INCLUDED_C36FC736 + +#ifndef _SDFBVBLOCKFIXED_H +#define _SDFBVBLOCKFIXED_H #include "PacketLibDefinition.h" #include "PartOfPacket.h" @@ -23,52 +24,34 @@ namespace PacketLib { -//##Documentation -//## $Date: 2005/03/09 10:57:50 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/SDFBVBlockFixed.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Id: SDFBVBlockFixed.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Revision: 1.2 $ -//## \brief Class wich represent the part of block with the number of field fixed. +/// \brief Class wich represent the part of block with the number of field fixed. class SDFBVBlockFixed : public PartOfPacket { private: - //##ModelId=3EADC14203D4 - //##Documentation - //## Represents the index of field which have the number of element in a - //## source data field variable. + /// Represents the index of field which have the number of element in a + /// source data field variable. word indexOfNElement; - //##ModelId=3EADC14203DC - //##Documentation - //## Number to sum for obtaining the numbers of real elements. + /// Number to sum for obtaining the numbers of real elements. unsigned addToNElement; - //##ModelId=3EADC14203E1 - //##Documentation - //## Represents the max number of elements in a source data field variable. + /// Represents the max number of elements in a source data field variable. word maxNumberOfElement; public: - //##ModelId=3EADC1430001 word getNumberOfRealElement() ; - //##ModelId=3EADC1430003 void setNumberOfRealElement(word value); - //##ModelId=3EADC1430008 - void setIndexOfNElement(word index); + void setIndexOfNElement(word index); - //##ModelId=3EADC143000D - //##Documentation - //## Sets the number to sum for obtaining the numbers of real elements. + /// Sets the number to sum for obtaining the numbers of real elements. void setAddToNElement(unsigned num); - //##ModelId=3EADC1430013 void setMaxNumberOfElement(word num); - //##ModelId=3EADC1430018 word getMaxNumberOfElement() const; }; diff --git a/include/SDFBVBlockVariable.h b/include/SDFBVBlockVariable.h index d00495d0dd4cc4604385fbf4c422b66b367b8294..65a0cca99fb42c4b1801e7a92cfc0122f1e224ff 100644 --- a/include/SDFBVBlockVariable.h +++ b/include/SDFBVBlockVariable.h @@ -2,8 +2,8 @@ SDFBVBlockVariable.h - description ------------------- begin : Thu Nov 29 2001 - copyright : (C) 2001 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -14,8 +14,9 @@ * For commercial purpose see appropriate license terms * * * ***************************************************************************/ -#ifndef SDFBVBLOCKVARIABLE_H_INCLUDED_8E35B8DF -#define SDFBVBLOCKVARIABLE_H_INCLUDED_8E35B8DF + +#ifndef _SDFBVBLOCKVARIABLE_H +#define _SDFBVBLOCKVARIABLE_H #include "PacketLibDefinition.h" #include "PartOfPacket.h" @@ -23,14 +24,8 @@ namespace PacketLib { -//##ModelId=3C343C320272 -//##Documentation -//## $Date: 2005/03/09 10:57:50 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/SDFBVBlockVariable.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Id: SDFBVBlockVariable.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Revision: 1.2 $ -//## \brief Class which represents the part of block repeated because the -//## number of fields are variable. +/// \brief Class which represents the part of block repeated because the +/// number of fields are variable. class SDFBVBlockVariable : public PartOfPacket { diff --git a/include/SDFBlockFixed.h b/include/SDFBlockFixed.h index 613b55d8e849952de6fed3c9952e78459e248d1e..c3035bdc80b92c277775ab63796a84c03fce24ec 100644 --- a/include/SDFBlockFixed.h +++ b/include/SDFBlockFixed.h @@ -2,8 +2,8 @@ SDFBlockFixed.h - description ------------------- begin : Thu Nov 29 2001 - copyright : (C) 2001 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -14,8 +14,9 @@ * For commercial purpose see appropriate license terms * * * ***************************************************************************/ -#ifndef SDFBLOCKFIXED_H_INCLUDED_B199A478 -#define SDFBLOCKFIXED_H_INCLUDED_B199A478 + +#ifndef _SDFBLOCKFIXED_H +#define _SDFBLOCKFIXED_H #include "PacketLibDefinition.h" #include "SourceDataField.h" @@ -29,105 +30,73 @@ namespace PacketLib { -//##Documentation -//## $Date: 2005/03/09 10:57:50 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/SDFBlockFixed.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Id: SDFBlockFixed.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Revision: 1.2 $ -//## \brief Represents a source data field structured with blocks but the number of -//## fields for each block are fixed. Layout 2 (see the Interface Control Document). +/// \brief Represents a source data field structured with blocks but the number of +/// fields for each block are fixed. Layout 2 (see the Interface Control Document). class SDFBlockFixed : public SourceDataField { public: - //##ModelId=3EADC1430039 virtual bool loadFields(InputText& fp) throw(PacketException*); - //##ModelId=3EADC143003F SDFBlockFixed(); - //##ModelId=3EADC1430041 virtual ~SDFBlockFixed(); - //##ModelId=3EADC1430043 virtual Field* getFields(word index); - //##ModelId=3EADC1430047 virtual word getNumberOfFields(); - //##ModelId=3EADC143004A virtual bool setByteStream(ByteStream* s); - //##ModelId=3EADC143004F - //##Documentation - //## Prints the value of each field of this part of packet. + /// Prints the value of each field of this part of packet. virtual char** printValue(char* addString = ""); - //##ModelId=3EADC1430054 - //##Documentation - //## Get the number of bytes of this part of packet. + /// Get the number of bytes of this part of packet. virtual dword getDimension(); - //##ModelId=3EADC1430057 - //## Get the number of bytes of a block. + /// Get the number of bytes of a block. virtual dword getDimension(word block); - //##ModelId=3EADC143005C virtual dword getMaxDimension(); - //##ModelId=3EADC143005E virtual dword getMaxDimension(word nblock); - //##ModelId=3EADC1430063 - //##Documentation - //## Prints the structure of this part of packet. + /// Prints the structure of this part of packet. virtual string* printStructure(); - //##ModelId=3EADC1430065 virtual Field* getFields(word block, word index); - //##ModelId=3EADC143006D virtual word getFieldValue(word index); - //##ModelId=3EADC1430072 virtual word getFieldValue(word block, word index); - //##Documentation - //## Get a block - //## \param nblock The index of the block + /// Get a block + /// \param nblock The index of the block virtual SDFBFBlock * getBlock(word nblock); - //##Documentation - //## Sets the value of a field in the list of fields of this part of packet. Remember that - //## if a predefined value is specified in the .stream, this method has not effect and the - //## value contained in the .stream is used. - //## \param index Represent the index in the list. - //## \param value The value must be set. + /// Sets the value of a field in the list of fields of this part of packet. Remember that + /// if a predefined value is specified in the .stream, this method has not effect and the + /// value contained in the .stream is used. + /// \param index Represent the index in the list. + /// \param value The value must be set. virtual void setFieldValue(word index, word value); - //##Documentation - //## Sets the value of a field in the list of fields of this part of packet. Remember that - //## if a predefined value is specified in the .stream, this method has not effect and the - //## value contained in the .stream is used. - //## \param index Represent the index in the list. - //## \param value The value must be set. + /// Sets the value of a field in the list of fields of this part of packet. Remember that + /// if a predefined value is specified in the .stream, this method has not effect and the + /// value contained in the .stream is used. + /// \param index Represent the index in the list. + /// \param value The value must be set. virtual void setFieldValue(word block, word index, word value); - //##ModelId=3EADC143008D virtual bool setOutputStream(ByteStream* os, dword first); - //##ModelId=3EADC1430094 virtual ByteStream* generateStream(bool bigendian); - //##ModelId=3EADC1430099 - //##Documentation - //## Returns the number of fields for each block. + /// Returns the number of fields for each block. virtual word getNumberOfFields(word block); private: - //##ModelId=3EADC143002B SDFBFBlock *block; - //##ModelId=3EADC1430032 ByteStream* tempBlock; }; diff --git a/include/SDFBlockVariable.h b/include/SDFBlockVariable.h index a563fa2a890613681ce309b313788f59d1270305..fe02eac7afb1cd763d07bb37bd418cd269bb4374 100644 --- a/include/SDFBlockVariable.h +++ b/include/SDFBlockVariable.h @@ -2,8 +2,8 @@ SDFBlockVariable.h - description ------------------- begin : Thu Nov 29 2001 - copyright : (C) 2001 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -14,8 +14,9 @@ * For commercial purpose see appropriate license terms * * * ***************************************************************************/ -#ifndef SDFBLOCKVARIABLE_H_INCLUDED_97700169 -#define SDFBLOCKVARIABLE_H_INCLUDED_97700169 + +#ifndef _SDFBLOCKVARIABLE_H +#define _SDFBLOCKVARIABLE_H #include "PacketLibDefinition.h" #include "SourceDataField.h" @@ -27,121 +28,102 @@ namespace PacketLib { -//##Documentation -//## $Date: 2005/03/09 10:57:50 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/SDFBlockVariable.h,v 1.3 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Id: SDFBlockVariable.h,v 1.3 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Revision: 1.3 $ -//## \brief Represents a source data field structered with blocks and with the number -//## of fields for each block variable. Layout 3 (see the Interface Control Document). +/// \brief Represents a source data field structered with blocks and with the number +/// of fields for each block variable. Layout 3 (see the Interface Control Document). class SDFBlockVariable : public SourceDataField { public: - //##ModelId=3EADC14300BA virtual bool loadFields(InputText& fp) throw(PacketException*); - //##ModelId=3EADC14300C0 SDFBlockVariable(); - //##ModelId=3EADC14300C1 virtual ~SDFBlockVariable(); - //##ModelId=3EADC14300C3 virtual Field* getFields(word index); - //##ModelId=3EADC14300C9 + virtual Field* getFields(word block, word index); - //##ModelId=3EADC14300D1 + virtual word getNumberOfFields(); - //##ModelId=3EADC14300D4 + virtual bool setByteStream(ByteStream* s); - //##ModelId=3EADC14300D9 + virtual dword getDimension(); - //##ModelId=3EADC14300DB + virtual dword getDimension(word nblock); - //##ModelId=3EADC14300E0 - //##Documentation - //## Gets the total max dimension in bytes of source data field + + /// Gets the total max dimension in bytes of source data field virtual dword getMaxDimension(); - //##ModelId=3EADC14300E2 + virtual dword getMaxDimension(word nblock); - //##ModelId=3EADC14300E7 - //##Documentation - //## Prints the value of each field of this part of packet + + /// Prints the value of each field of this part of packet virtual char** printValue(char* addString = ""); - //##ModelId=3EADC14300ED - //##Documentation - //## Prints the structure of this part of packet + /// Prints the structure of this part of packet virtual string* printStructure(); - //##ModelId=3EADC14300EF + virtual word getMaxNumberOfElements(word nblock); - //##ModelId=3EADC14300F4 - //##Documentation - //## Returns the number of fields for each block + /// Returns the number of fields for each block virtual word getNumberOfFields(word block); - //##ModelId=3EADC14300FA + virtual word getFieldValue(word index); - //##ModelId=3EADC14300FF + virtual word getFieldValue(word block, word index); - //##Documentation - //## Sets the value of a field in the list of fields of this part of packet. Remember that - //## if a predefined value is specified in the .stream, this method has not effect and the - //## value contained in the .stream is used. - //## \param index Represent the index in the list. - //## \param value The value must be set. + + /// Sets the value of a field in the list of fields of this part of packet. Remember that + /// if a predefined value is specified in the .stream, this method has not effect and the + /// value contained in the .stream is used. + /// \param index Represent the index in the list. + /// \param value The value must be set. virtual void setFieldValue(word index, word value); - //##Documentation - //## Sets the value of a field in the list of fields of this part of packet. Remember that - //## if a predefined value is specified in the .stream, this method has not effect and the - //## value contained in the .stream is used. - //## \param block The index of block. - //## \param index Represent the index in the list. - //## \param value The value must be set. + /// Sets the value of a field in the list of fields of this part of packet. Remember that + /// if a predefined value is specified in the .stream, this method has not effect and the + /// value contained in the .stream is used. + /// \param block The index of block. + /// \param index Represent the index in the list. + /// \param value The value must be set. virtual void setFieldValue(word block, word index, word value); - //##ModelId=3EADC143011A + virtual bool setOutputStream(ByteStream* os, dword first); - //##ModelId=3EADC1430122 + virtual ByteStream* generateStream(bool bigendian); - //##ModelId=3EADC1430127 - //##Documentation - //## Get the number of elements for each block - //## \param block The index of the blocks. + + /// Get the number of elements for each block + /// \param block The index of the blocks. virtual word getNumberOfRealElement(word block); - //##ModelId=3EADC143012C - //##Documentation - //## Set the number of elements for each block. - //## \param block The index of the block. - //## \param value The number of elements. + + /// Set the number of elements for each block. + /// \param block The index of the block. + /// \param value The number of elements. virtual void setNumberOfRealElement(word block, word value); - //##Documentation - //## Get a block - //## \param nblock The index of the block. + + /// Get a block + /// \param nblock The index of the block. virtual SDFBVBlock* getBlock(word block); private: - //##ModelId=3EADC14300AD + SDFBVBlock* blocks; - //##ModelId=3EADC14300B3 ByteStream* tempBlock; }; diff --git a/include/SDFNoBlockFixed.h b/include/SDFNoBlockFixed.h index 475f8eab8de3bf6104bd9c1aa5b626fac57bf211..a9746e53b413399196e96958e75649fd79b77fe1 100644 --- a/include/SDFNoBlockFixed.h +++ b/include/SDFNoBlockFixed.h @@ -2,8 +2,8 @@ SDFNoBlockFixed.h - description ------------------- begin : Thu Nov 29 2001 - copyright : (C) 2001 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -14,8 +14,9 @@ * For commercial purpose see appropriate license terms * * * ***************************************************************************/ -#ifndef SDFNOBLOCKFIXED_H_HEADER_INCLUDED_F6C633EF -#define SDFNOBLOCKFIXED_H_HEADER_INCLUDED_F6C633EF + +#ifndef _SDFNOBLOCKFIXED_H +#define _SDFNOBLOCKFIXED_H #include "PacketLibDefinition.h" #include "SourceDataField.h" @@ -24,41 +25,29 @@ class ConfigurationFile; namespace PacketLib { -//##Documentation -//## $Date: 2005/03/09 10:57:50 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/SDFNoBlockFixed.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Id: SDFNoBlockFixed.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Revision: 1.2 $ -//## \brief Represents a source data field of packet where the structure is noblock -//## and with a fixed dimension. Layout 1 (see Interface Control Document). +/// \brief Represents a source data field of packet where the structure is noblock +/// and with a fixed dimension. Layout 1 (see Interface Control Document). class SDFNoBlockFixed : public SourceDataField { public: - //##ModelId=3EADC1430143 SDFNoBlockFixed(); - //##ModelId=3EADC1430144 virtual ~SDFNoBlockFixed(); - //##ModelId=3EADC1430146 virtual bool loadFields(InputText& fp) throw(PacketException*); - //##ModelId=3EADC1430149 virtual Field* getFields(word index); - //##ModelId=3EADC143014D virtual word getFieldValue(word index); - //##Documentation - //## Sets the value of a field in the list of fields of this part of packet. Remember that - //## if a predefined value is specified in the .stream, this method has not effect and the - //## value contained in the .stream is used. - //## \param index Represent the index in the list. - //## \param value The value must be set. + /// Sets the value of a field in the list of fields of this part of packet. Remember that + /// if a predefined value is specified in the .stream, this method has not effect and the + /// value contained in the .stream is used. + /// \param index Represent the index in the list. + /// \param value The value must be set. virtual void setFieldValue(word index, word value); - //##ModelId=3EADC1430154 virtual dword getMaxDimension(); }; diff --git a/include/SDFRBBlock.h b/include/SDFRBBlock.h index 1ebf74ffd228dd4120f3a58c1ddd4cc0bde7b29b..3da9122112e0e06e8c6824736b044813fd0a4a7c 100644 --- a/include/SDFRBBlock.h +++ b/include/SDFRBBlock.h @@ -1,9 +1,9 @@ /*************************************************************************** - SDFNoBlockFixed.h - description + SDFRBBlock.h - description ------------------- begin : Thu Nov 29 2001 - copyright : (C) 2001 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -14,8 +14,9 @@ * For commercial purpose see appropriate license terms * * * ***************************************************************************/ -#ifndef SDFRBBLOCK_H_HEADER_INCLUDED_806B7DA0 -#define SDFRBBLOCK_H_HEADER_INCLUDED_806B7DA0 + +#ifndef _SDFRBBLOCK_H +#define _SDFRBBLOCK_H #include "PacketException.h" #include "PartOfPacket.h" @@ -33,51 +34,51 @@ public: bool loadType(InputText& fp) throw(PacketException*); - //the name of the InputFile + /// the name of the InputFile char* name; - //## Fixed part present + /// Fixed part present bool fixedPresent; - //## Variable part present + /// Variable part present bool variablePresent; char** rblockFilename; - //## The number of rblock + /// The number of rblock int numberOfRBlocks; //MANAGEMENT OF BLOCKS - //## Represents the type of number of block. If true the number of blocks - //## are fixed, if false the number of blocks are variable + /// Represents the type of number of block. If true the number of blocks + /// are fixed, if false the number of blocks are variable bool* numberOfBlockFixed; - //## Represents the number of blocks (if numberOfBlockFixed is true) or max - //## number of blocks (if numberOfBlockFixed is false) in the structure of - //## source data field. This variable not represent the effective number of - //## block into the stream of data. + /// Represents the number of blocks (if numberOfBlockFixed is true) or max + /// number of blocks (if numberOfBlockFixed is false) in the structure of + /// source data field. This variable not represent the effective number of + /// block into the stream of data. word* maxNumberOfBlock; - //## for variable block, number of level of headers in which is present the field - //## with the number of blocks of the variable part + /// for variable block, number of level of headers in which is present the field + /// with the number of blocks of the variable part word* headerLevelOfNBlockIndex; word* indexOfNBlock; - //## for variable block, valore da sommare per ottenere il numero di eventi (blocchi) reali. + /// for variable block, valore da sommare per ottenere il numero di eventi (blocchi) reali. word* subFromNBlock; - //## apply an operator during the calculation of the number of blocks - //## 0 -> nothing - //## 1 -> / divide for 2 + /// apply an operator during the calculation of the number of blocks + /// 0 -> nothing + /// 1 -> / divide for 2 byte* operatorType; - //## Indicates if an rblock has a fixed or variable number of blocks + /// Indicates if an rblock has a fixed or variable number of blocks bool* rBlockVariable; - //## The max number of blocks + /// The max number of blocks word nblockmax; @@ -85,7 +86,7 @@ public: }; -//##ModelId=405AD49C00E5 +///ModelId=405AD49C00E5 class SDFRBBlock : public PartOfPacket { public: @@ -99,25 +100,25 @@ public: previous = pop; }; - //## Get a block of number nblock of the group of blocks of the rblock - //## with the inndex rBlockIndex. - //## \param nblock the number of the block - //## \param rBlockIndex the number of the rblock + /// Get a block of number nblock of the group of blocks of the rblock + /// with the inndex rBlockIndex. + /// \param nblock the number of the block + /// \param rBlockIndex the number of the rblock virtual SDFRBBlock* getBlock(word nblock, word rBlockIndex); virtual dword getMaxDimension(); virtual dword getDimension(); - //## Set the number of blocks (the number of times that a block of a - //## determinated type is repeated) for each type of rblock present. - //## \param number The number of blocks - //## \param rBlockIndex The number of rblock + /// Set the number of blocks (the number of times that a block of a + /// determinated type is repeated) for each type of rblock present. + /// \param number The number of blocks + /// \param rBlockIndex The number of rblock virtual void setNumberOfRealDataBlock(word number, word rblockIndex = 0) throw (PacketException*); - //## Get the number of blocks (the number of times that a block of a - //## determinated type is repeated) for each type of rblock present. - //## \param rBlockIndex The number of rblock + /// Get the number of blocks (the number of times that a block of a + /// determinated type is repeated) for each type of rblock present. + /// \param rBlockIndex The number of rblock virtual word getNumberOfRealDataBlock(word rblockIndex = 0); virtual void setRBlockType(word rb) @@ -146,43 +147,43 @@ public: virtual bool setByteStream(ByteStream* s); - //## Returns a pointer of a field in the list of fields of the fixed part. - //## \param index Represent the index in the list. + /// Returns a pointer of a field in the list of fields of the fixed part. + /// \param index Represent the index in the list. virtual inline Field* getFields(word index) { return fixed.getFields(index); }; - //## Returns the value of a field in the list of fields of the fixed part. - //## \param index Represent the index in the list. + /// Returns the value of a field in the list of fields of the fixed part. + /// \param index Represent the index in the list. virtual inline word getFieldValue(word index) { return fixed.getFieldValue(index); }; - //## Sets the value of a field in the list of fields of the fixed part. - //## \param index Represent the index in the list. - //## \param value The value must be set. + /// Sets the value of a field in the list of fields of the fixed part. + /// \param index Represent the index in the list. + /// \param value The value must be set. virtual inline void setFieldValue(word index, word value) { fixed.setFieldValue(index, value); }; - //## Returns the number of fields of this block (fixed and variable part). + /// Returns the number of fields of this block (fixed and variable part). virtual inline word getNumberOfFields() { return getTotalNumberOfFields(); }; - //## Returns the number of fields of the overall block + /// Returns the number of fields of the overall block virtual word getTotalNumberOfFields(); - //## Prints the value of each field of this part of packet + /// Prints the value of each field of this part of packet virtual char** printValue(char* addString = ""); virtual void printValueStdout(); - //## Prints the structure of this part of packet + /// Prints the structure of this part of packet virtual string* printStructure(); PartOfPacket fixed; @@ -193,18 +194,16 @@ protected: SDFRBBlock* block; - //## Real number of blocks. + /// Real number of blocks. word* numberOfRealDataBlock; - //##Documentation - //## An index that represent an unique index for each block of a particular rblock. + /// An index that represent an unique index for each block of a particular rblock. word ID; - //## An index that represent the type of rblock (starting from 0). This index - //## is unique into a rblock container. + /// An index that represent the type of rblock (starting from 0). This index + /// is unique into a rblock container. word rBlockType; - //##ModelId=3EADC1440130 bool reset_output_stream; ByteStream* tempBlock; diff --git a/include/SDFRBlock.h b/include/SDFRBlock.h index 12db60f0127f67b2bbd391731c45c4bfa347e039..ee13cdf11a7758853332c77ed4ee73da2fb155fe 100644 --- a/include/SDFRBlock.h +++ b/include/SDFRBlock.h @@ -1,9 +1,9 @@ /*************************************************************************** - SDFNoBlockFixed.h - description + SDFRBlock.h - description ------------------- begin : Thu Nov 29 2001 - copyright : (C) 2001 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -14,8 +14,9 @@ * For commercial purpose see appropriate license terms * * * ***************************************************************************/ -#ifndef SDFRBLOCK_H_HEADER_INCLUDED_89D3066E -#define SDFRBLOCK_H_HEADER_INCLUDED_89D3066E + +#ifndef _SDFRBLOCK_H +#define _SDFRBLOCK_H #include "SourceDataField.h" #include "PacketException.h" #include "PacketExceptionFileFormat.h" @@ -24,13 +25,7 @@ namespace PacketLib { -//##ModelId=3C347FA20329 -//##Documentation -//## $Date: 2005/03/09 10:57:50 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/SDFRBlock.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Id: SDFRBlock.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Revision: 1.2 $ -//## \brief Class which represents the source data field of Layout 4 (see the Interface Control Document). +/// \brief Class which represents the source data field of Layout 4 (see the Interface Control Document). class SDFRBlock : public SourceDataField { public: @@ -41,32 +36,30 @@ public: virtual bool loadFields(InputText& fp) throw(PacketException*); - //##Documentation - //## Get a block of number nblock of the group of blocks of the rblock - //## with the index rBlockIndex. - //## \param nblock the number of the block - //## \param rBlockIndex the number of the rblock + /// Get a block of number nblock of the group of blocks of the rblock + /// with the index rBlockIndex. + /// \param nblock the number of the block + /// \param rBlockIndex the number of the rblock virtual SDFRBBlock* getBlock(word nblock, word rBlockIndex); - //##Documentation - //## Returns a pointer of a field in the fixed part of this source data field. - //## \param index Represent the index in the list. + + /// Returns a pointer of a field in the fixed part of this source data field. + /// \param index Represent the index in the list. virtual Field* getFields(word index); - //##Documentation - //## Returns the value of a field in the fixed part of this source data field. - //## \param index Represent the index in the list. + + /// Returns the value of a field in the fixed part of this source data field. + /// \param index Represent the index in the list. virtual word getFieldValue(word index); - //##Documentation - //## Sets the value of a field in the fixed part of this source data field. - //## \param index Represent the index in the list. - //## \param value The value must be set. + + /// Sets the value of a field in the fixed part of this source data field. + /// \param index Represent the index in the list. + /// \param value The value must be set. virtual void setFieldValue(word index, word value); - //##ModelId=3C187751018C - //##Documentation - //## Returns the number of fields. + + /// Returns the number of fields. virtual word getNumberOfFields(); virtual dword getMaxDimension(); @@ -79,50 +72,49 @@ public: virtual ByteStream* generateStream(bool bigendian); - //##Documentation - //## Set the number of blocks (the number of times that a block of a - //## determinated type is repeated) for each type of rblock present. - //## \param number The number of blocks - //## \param rBlockIndex The number of rblock + + /// Set the number of blocks (the number of times that a block of a + /// determinated type is repeated) for each type of rblock present. + /// \param number The number of blocks + /// \param rBlockIndex The number of rblock void setNumberOfRealDataBlock(word number, word rblockIndex = 0) throw (PacketException*); - //##Documentation - //## Get the number of blocks (the number of times that a block of a - //## determinated type is repeated) for each type of rblock present. - //## \param rBlockIndex The number of rblock + + /// Get the number of blocks (the number of times that a block of a + /// determinated type is repeated) for each type of rblock present. + /// \param rBlockIndex The number of rblock word getNumberOfRealDataBlock(word rblockIndex = 0); - //##Documentation - //## Prints the value of each field of this part of packet + + /// Prints the value of each field of this part of packet virtual char** printValue(char* addString = ""); virtual void printValueStdout(); - //##Documentation - //## Prints the structure of this part of packet + + /// Prints the structure of this part of packet virtual string* printStructure(); protected: - //##ModelId=405AD4BD00C2 SDFRBBlock* block; - //##Documentation - //## The number of rblock + + /// The number of rblock int numberOfRBlocks; - //##Documentation - //## for variable block, number of level of headers in which is present the field - //## with the number of blocks of the variable part + + /// for variable block, number of level of headers in which is present the field + /// with the number of blocks of the variable part word* headerLevelOfNBlockIndex; char** rblockFilename; bool* rBlockVariable; - //##Documentation - //## The max number of blocks + + /// The max number of blocks word nblockmax; }; diff --git a/include/SHM.h b/include/SHM.h index 1cc5de8052de73ec055be54a1d3bf68c4d89c30b..527f78c60b6ca4545b7c6ab56533e7fcdb0dc0bc 100644 --- a/include/SHM.h +++ b/include/SHM.h @@ -2,8 +2,8 @@ SHM.h - description ------------------- begin : Fri Jun 21 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -15,8 +15,8 @@ * * ***************************************************************************/ -#ifndef SHM_H -#define SHM_H +#ifndef _SHM_H +#define _SHM_H #include "PacketLibDefinition.h" #include "Device.h" @@ -27,62 +27,45 @@ namespace PacketLib { -//##ModelId=3C87743F03C1 -//##Documentation -//## $Date: 2005/03/09 10:57:50 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/SHM.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Id: SHM.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Revision: 1.2 $ -//## \brief This class represents generic SHM +/// \brief This class represents generic SHM class SHM : public Device { public: - //##ModelId=3AA649A2005A SHM(bool bigendian); - //##ModelId=3AA649A200A0 virtual ~SHM(); - //##ModelId=3EADC1430288 virtual bool create(long shmkey, dword num_slot, dword slot_dim) throw(PacketExceptionIO*); - //##ModelId=3AA649A200B4 virtual bool open(long shmkey = 0, dword num_slot = 0, dword slot_dim = 0) throw(PacketExceptionIO*); - //##ModelId=3AA649A200FA virtual bool close() throw(PacketExceptionIO*); - //##ModelId=3EADC143038F virtual bool destroy() throw(PacketExceptionIO*); - //##ModelId=3EADC14303AE virtual bool isCreated() const; - //##ModelId=3EADC14303CF virtual void writeSlot(dword n_slot, void* element) throw(PacketExceptionIO*); - //##ModelId=3EADC144005C virtual void* readSlot(dword n_slot) throw(PacketExceptionIO*); protected: + /// id given by shmget + int shmid; - //##ModelId=3EADC14301AD - int shmid; //id restituito dalla shmget + /// key passed by the user + long shmkey; - //##ModelId=3EADC14301D3 - long shmkey; //chiave passata dall'utente + /// number of slots of the shm + dword num_slot; - //##ModelId=3EADC14301FC - dword num_slot; //numero di slot della shm + /// slot dimension + dword slot_dim; - //##ModelId=3EADC1430211 - dword slot_dim; //dimensione di ogni slot - - //##ModelId=3EADC1430224 bool created; - - //##ModelId=3EADC1430250 - byte* shm; //puntatore al primo elemento della shared memory + + /// pointer to the first element of the shared memory + byte* shm; }; } diff --git a/include/Serial.h b/include/Serial.h index 60ed3af384402ba390c3acfe1e789dab7bf6a940..10bc105607184ef9d373edae8472d3e256b507b1 100644 --- a/include/Serial.h +++ b/include/Serial.h @@ -2,8 +2,8 @@ Serial.h - description ------------------- begin : Thu Nov 29 2001 - copyright : (C) 2001 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -14,8 +14,9 @@ * For commercial purpose see appropriate license terms * * * ***************************************************************************/ -#ifndef SERIAL_h_h_ZC2002 -#define SERIAL_h_h_ZC2002 + +#ifndef _SERIAL_H +#define _SERIAL_H #include "PacketLibDefinition.h" #include #include @@ -29,19 +30,13 @@ namespace PacketLib { -//##ModelId=3C0F6BDB0029 -//##Documentation -//## $Date: 2005/03/09 10:57:50 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/Serial.h,v 1.3 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Id: Serial.h,v 1.3 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Revision: 1.3 $ -//## \brief Represent a serial I/O port +/// \brief Represent a serial I/O port class Serial { public: - // Common parameters + /// Common parameters static const int b1200 = 1200, b1800 = 1800, @@ -59,22 +54,25 @@ public: SERIAL2 = 2; static const int - RDO = 0, // Read only - WRO = 1, // Write only - RDWR = 2; // Read & Write + /// Read only + RDO = 0, + /// Write only + WRO = 1, + /// Read & Write + RDWR = 2; - // Construction & Destruction + /// Construction & Destruction Serial(); Serial( char* path, int oflag ); Serial( int dev, int oflag ); ~Serial(); - // Open & Close serial connection + /// Open & Close serial connection int open( char* path, int oflag ); int open( int dev, int oflag ); void close(); - // Svuota il buffer della seriale (ad es. prima dell'acquisizione) + /// Svuota il buffer della seriale (ad es. prima dell'acquisizione) int dump(); int set( speed_t baud ); diff --git a/include/Socket.h b/include/Socket.h index 64e1459332d37cf8115d702d16bfaa1dfcebae73..a3ec92a072b21074b551b9269f6e5b4874346ee5 100644 --- a/include/Socket.h +++ b/include/Socket.h @@ -2,8 +2,8 @@ Socket.h - description ------------------- begin : Thu May 16 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -15,8 +15,8 @@ * * ***************************************************************************/ -#ifndef SOCKET_H -#define SOCKET_H +#ifndef _SOCKET_H +#define _SOCKET_H #include "Device.h" #include @@ -36,52 +36,35 @@ const int MAXRECV = 500; namespace PacketLib { -//##ModelId=3EADC12400B5 -//##Documentation -//## $Date: 2005/03/09 10:57:50 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/Socket.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Id: Socket.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Revision: 1.2 $ -//## \brief This class represents generic socket. +/// \brief This class represents generic socket. class Socket : public Device { public: - //##ModelId=3EADC14400C0 Socket(bool bigendian); - //##ModelId=3EADC14400C2 virtual ~Socket(); - //##ModelId=3EADC14400C4 virtual bool is_valid() const { return m_sock != -1; } - //##ModelId=3EADC14400C8 - //##Documentation - //## Data Transimission + /// Data Transimission virtual bool send ( ByteStream* b ) const throw(PacketExceptionIO*) ; - //##ModelId=3EADC14400CC virtual ByteStream* recv (word dim, int & status) throw(PacketExceptionIO*) ; - //##ModelId=3EADC14400D0 virtual bool connect ( const std::string host, const int port ) throw(PacketExceptionIO*); - //##ModelId=3EADC14400D5 virtual bool create() throw(PacketExceptionIO*) ; - //##ModelId=3EADC14400D7 virtual bool close() throw(PacketExceptionIO*); protected: - //##ModelId=3EADC14400BC int m_sock; - //##ModelId=3EADC14400BE sockaddr_in m_addr; }; diff --git a/include/SocketClient.h b/include/SocketClient.h index 4241a571ba81987dc6738a7da38d90c3f402fa9a..1f5f1c574c8241fa1d47984be25043f09f2b579b 100644 --- a/include/SocketClient.h +++ b/include/SocketClient.h @@ -2,8 +2,8 @@ SocketClient.h - description ------------------- begin : Thu May 16 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -15,10 +15,9 @@ * * ***************************************************************************/ -// Definition of the SocketClient class -#ifndef SocketClient_class -#define SocketClient_class +#ifndef _SOCKETCLIENT_H +#define _SOCKETCLIENT_H #include "Socket.h" #include "ByteStream.h" @@ -26,18 +25,11 @@ namespace PacketLib { -//##ModelId=3EADC12400C3 -//##Documentation -//## $Date: 2005/03/09 10:57:50 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/SocketClient.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Id: SocketClient.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Revision: 1.2 $ -//## \brief This class represents generic client socket. +/// \brief This class represents generic client socket. class SocketClient : public Socket { public: - //##ModelId=3EADC14400E1 SocketClient ( bool bigendian, std::string host, int port ); }; diff --git a/include/SocketServer.h b/include/SocketServer.h index 8a4353160ed4dcf310848ec265f32f29bd6abcff..c5e4da75e83e9c6fae61d87ebe5d8f67a2170159 100644 --- a/include/SocketServer.h +++ b/include/SocketServer.h @@ -2,8 +2,8 @@ SocketServer.h - description ------------------- begin : Thu May 16 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -15,8 +15,8 @@ * * ***************************************************************************/ -#ifndef SocketServer_class -#define SocketServer_class +#ifndef _SOCKETSERVER_H +#define _SOCKETSERVER_H #include "Socket.h" #include @@ -30,35 +30,23 @@ namespace PacketLib { -//##ModelId=3EADC12400D3 -//##Documentation -//## $Date: 2005/03/09 10:57:50 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/SocketServer.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Id: SocketServer.h,v 1.2 2005/03/09 10:57:50 bulgarelli Exp $ -//## $Revision: 1.2 $ -//## \brief This class represents generic client socket. +/// \brief This class represents generic client socket. class SocketServer : public Socket { public: - //##ModelId=3EADC14400F1 SocketServer (bool bigendian); - //##ModelId=3EADC14400F5 + SocketServer (bool bigendian, int port ); - //##ModelId=3EADC14400FC virtual ~SocketServer(); - //##ModelId=3EADC14400FE bool bind ( const int port ) throw(PacketExceptionIO*); - //##ModelId=3EADC1440103 bool listen() const throw(PacketExceptionIO*); - // Client initialization + /// Client initialization - //##ModelId=3EADC1440106 void set_non_blocking ( const bool ); - //##ModelId=3EADC1440109 bool accept ( SocketServer& ) throw(PacketExceptionIO*); }; diff --git a/include/SourceDataField.h b/include/SourceDataField.h index 615295edc42e3d393260e4ebe3f044cc00bc57f7..6897d37669d900d6a9225026f17fa72a478b43ab 100644 --- a/include/SourceDataField.h +++ b/include/SourceDataField.h @@ -2,8 +2,8 @@ SourceDataField.h - description ------------------- begin : Thu Nov 29 2001 - copyright : (C) 2001 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -15,8 +15,8 @@ * * ***************************************************************************/ -#ifndef SOURCEDATAFIELD_H_INCLUDED_F4BDC5A4 -#define SOURCEDATAFIELD_H_INCLUDED_F4BDC5A4 +#ifndef _SOURCEDATAFIELD_H +#define _SOURCEDATAFIELD_H #include "PacketLibDefinition.h" #include "PartOfPacket.h" @@ -24,137 +24,92 @@ namespace PacketLib { -//##ModelId=3C0F6C190376 -//##Documentation -//## $Date: 2012/06/08 15:14:29 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/SourceDataField.h,v 1.10 2012/06/08 15:14:29 bulgarelli Exp $ -//## $Id: SourceDataField.h,v 1.10 2012/06/08 15:14:29 bulgarelli Exp $ -//## $Revision: 1.10 $ -//## \brief A generic source data field. +/// \brief A generic source data field. class SourceDataField : public PartOfPacket { public: - //##ModelId=3EADC1440383 SourceDataField(const char* sdfName = 0); virtual ~SourceDataField(); - //##ModelId=3EADC1450058 - //##Documentation - //## Gets the total max dimension in bytes of source data field + /// Gets the total max dimension in bytes of source data field virtual dword getMaxDimension() = 0; - //##ModelId=3EADC1450316 - //##Documentation - //## Gets the total max dimension in bytes of source data field for each block - //## \param nbloc Number of block + /// Gets the total max dimension in bytes of source data field for each block + /// \param nbloc Number of block virtual dword getMaxDimension(word nblock); - //##ModelId=3C9AEC090051 - //##Documentation - //## Loads the field form .packet file. See PartOfPacket class. + /// Loads the field form .packet file. See PartOfPacket class. virtual bool loadFields(InputText& fp) throw(PacketException*) = 0 ; - //##ModelId=3C301E8A0081 - //##Documentation - //## \return true if this source data field is compounded of blocks. + /// \return true if this source data field is compounded of blocks. virtual bool isBlock(); - //##ModelId=3C347EA003C8 - //##Documentation - //## \return true if the dimension of eache block is fixed. + /// \return true if the dimension of eache block is fixed. virtual bool isFixed(); - //##Documentation - //## \return true if the packet is structured as a recursive block + /// \return true if the packet is structured as a recursive block virtual bool isRBlock() { return rblock; }; - //##ModelId=3C35EF40001F - //##Documentation - //## \return true is the number of block is fixed. + /// \return true is the number of block is fixed. virtual bool isNumberOfBlockFixed(word rblockIndex = 0); - //##ModelId=3C35EF4303B7 - //##Documentation - //## \return Returns the max number of block for this source data field. + /// \return Returns the max number of block for this source data field. virtual word getMaxNumberOfBlock(word rblockIndex = 0); - //##ModelId=3EADC147006C - //##Documentation - //## \return Returns the max number of elements for each block. - //## \param nblock Number of block. + /// \return Returns the max number of elements for each block. + /// \param nblock Number of block. virtual word getMaxNumberOfElements(word nblock); - //##ModelId=3EADC1480173 - //##Documentation - //## Gets the current dimension (in byte) of the source data field. + /// Gets the current dimension (in byte) of the source data field. virtual dword getDimension(); - //##ModelId=3EADC1490095 - //##Documentation - //## Gets the current dimension (in byte) for a single block. - //# \param block Number of block. + /// Gets the current dimension (in byte) for a single block. + /// \param block Number of block. virtual dword getDimension(word block); - //##ModelId=3C35EF3C01C8 - //##Documentation - //## Gets the index of field in the data field header that contains the number of block in the - //## source data field. + /// Gets the index of field in the data field header that contains the number of block in the + /// source data field. virtual word getIndexOfNBlock(word rblockIndex = 0); - //##ModelId=3C9AEC0A01AD - //##Documentation - //## Sets the number of real data block for the current packet. + /// Sets the number of real data block for the current packet. virtual void setNumberOfRealDataBlock(word value, word rblockIndex = 0) throw (PacketException*); - //##ModelId=3C9AEC0B006F virtual word getSubFromNBlock(word rblockIndex = 0); - //##ModelId=3C9AEC0B011F - //##Documentation - //## \return Returns the number of real data block for the current packet. + /// \return Returns the number of real data block for the current packet. virtual word getNumberOfRealDataBlock(word rblockIndex = 0); - //##ModelId=3C9AEC0B01CE - //##Documentation - //## Gets a field of the source data field. - //## \param index The number of field in the source data field. - //## \return The field. + /// Gets a field of the source data field. + /// \param index The number of field in the source data field. + /// \return The field. virtual Field* getFields(word index) = 0; - //##ModelId=3C9AEC0C022B - //##Documentation - //## Gets a field of the source data field. - //## \param block The block that contains the field - //## \param index The number of field in the source data field (into the block). - //## \return The field. + /// Gets a field of the source data field. + /// \param block The block that contains the field + /// \param index The number of field in the source data field (into the block). + /// \return The field. virtual Field* getFields(word block, word index); - //##ModelId=3EADC14B025B - //##Documentation - //## Gets a field value of the source data field. - //## \param index The number of field in the source data field. - //## \return The value of field. + /// Gets a field value of the source data field. + /// \param index The number of field in the source data field. + /// \return The value of field. virtual word getFieldValue(word index) = 0; - //##ModelId=3EADC14D000C - //##Documentation - //## Gets a field value of the source data field. - //## \param block The block that contains the field. - //## \param index The number of field in the source data field (into the block). - //## \return The value of field. + /// Gets a field value of the source data field. + /// \param block The block that contains the field. + /// \param index The number of field in the source data field (into the block). + /// \return The value of field. virtual word getFieldValue(word block, word index); - //##ModelId=3EADC14D000C - //##Documentation - //## Gets a field value of the source data field of PTC=5, PFC=1. See comments on PartOfPacket for more details.. - //## \param block The block that contains the field. - //## \param index The number of field in the source data field (into the block). - //## \return The value of field. + /// Gets a field value of the source data field of PTC=5, PFC=1. See comments on PartOfPacket for more details.. + /// \param block The block that contains the field. + /// \param index The number of field in the source data field (into the block). + /// \return The value of field. virtual float getFieldValue_5_1(word block, word index); virtual float getFieldValue_5_1(word index) @@ -162,12 +117,10 @@ public: return PartOfPacket::getFieldValue_5_1(index); } - //##ModelId=3EADC14D000C - //##Documentation - //## Set a field value of the source data field of PTC=5, PFC=1. See comments on PartOfPacket for more details.. - //## \param block The block that contains the field. - //## \param index The number of field in the source data field (into the block). - //## \param value The float + /// Set a field value of the source data field of PTC=5, PFC=1. See comments on PartOfPacket for more details.. + /// \param block The block that contains the field. + /// \param index The number of field in the source data field (into the block). + /// \param value The float virtual void setFieldValue_5_1(word block, word index, float value); virtual void setFieldValue_5_1(word index, float value) @@ -175,12 +128,10 @@ public: PartOfPacket::setFieldValue_5_1(index, value); } - //##ModelId=3EADC14D000C - //##Documentation - //## Gets a field value of the source data field of PTC=4, PFC=14. See comments on PartOfPacket for more details.. - //## \param block The block that contains the field. - //## \param index The number of field in the source data field (into the block). - //## \return The value of field. + /// Gets a field value of the source data field of PTC=4, PFC=14. See comments on PartOfPacket for more details.. + /// \param block The block that contains the field. + /// \param index The number of field in the source data field (into the block). + /// \return The value of field. virtual signed long getFieldValue_4_14(word block, word index); virtual signed long getFieldValue_4_14(word index) @@ -188,12 +139,11 @@ public: return PartOfPacket::getFieldValue_4_14(index); } - //##ModelId=3EADC14D000C - //##Documentation - //## Set a field value of the source data field of PTC=4, PFC=14. See comments on PartOfPacket for more details.. - //## \param block The block that contains the field. - //## \param index The number of field in the source data field (into the block). - //## \param value The data to be set + + /// Set a field value of the source data field of PTC=4, PFC=14. See comments on PartOfPacket for more details.. + /// \param block The block that contains the field. + /// \param index The number of field in the source data field (into the block). + /// \param value The data to be set virtual void setFieldValue_4_14(word block, word index, signed long value); virtual void setFieldValue_4_14(word index, signed long value) @@ -243,96 +193,67 @@ public: return PartOfPacket::getFieldValue_3_13(index); } - //##ModelId=3EADC14F0099 - //##Documentation - //## Sets a field value of the source data field. - //## \param index The number of field in the source data field. - //## \param value The value must be set. + /// Sets a field value of the source data field. + /// \param index The number of field in the source data field. + /// \param value The value must be set. virtual void setFieldValue(word index, word value) = 0; - //##ModelId=3EADC1510112 - //##Documentation - //## Sets a field value of the source data field. - //## \param block The block that contains the field. - //## \param index The number of field in the source data field (into the block). - //## \param value The value must be set. + /// Sets a field value of the source data field. + /// \param block The block that contains the field. + /// \param index The number of field in the source data field (into the block). + /// \param value The value must be set. virtual void setFieldValue(word block, word index, word value); - //##ModelId=3EADC1540055 - //##Documentation - //## Returns the number of fields for each block. + /// Returns the number of fields for each block. virtual word getNumberOfFields(word block); - //##ModelId=3EADC1550280 - //##Documentation - //## Returns the total number of fields for the source data field. + /// Returns the total number of fields for the source data field. virtual word getNumberOfFields(); - //##ModelId=3EADC1560258 - //##Documentation - //## Sets the number of real elements for each block. - //## \param block Number of block. - //## \value value The value must be set. + /// Sets the number of real elements for each block. + /// \param block Number of block. + /// \value value The value must be set. virtual void setNumberOfRealElement(word block, word value); - //##ModelId=3C9AFF7A0170 - //##Documentation - //## Returns the number of real elements for each block. + /// Returns the number of real elements for each block. virtual word getNumberOfRealElement(word block); - //##ModelId=3EADC1590035 bool get_reset_output_stream() const; - //##ModelId=3EADC15A0015 void set_reset_output_stream(bool value); char* printInHexadecimal(); protected: - //##ModelId=3C347EEA00C1 - //##Documentation - //## This attribute indicates if the source data field is structured in block + /// This attribute indicates if the source data field is structured in block bool isblock; - //##ModelId=3C347EF002A8 - //##Documentation - //## Indicates if the dimension of block is fixed or variable + /// Indicates if the dimension of block is fixed or variable bool fixed; - //##Documentation - //## Indicates if the source data field is a recoursive block structure + /// Indicates if the source data field is a recoursive block structure bool rblock; - //MANAGEMENT OF BLOCKS + /// MANAGEMENT OF BLOCKS - //##ModelId=405AA86B0129 - //##Documentation - //## Represents the type of number of block. If true the number of blocks - //## are fixed, if false the number of blocks are variable + /// Represents the type of number of block. If true the number of blocks + /// are fixed, if false the number of blocks are variable bool* numberOfBlockFixed; - //##ModelId=405AA86B0197 - //##Documentation - //## Represents the number of blocks (if numberOfBlockFixed is true) or max - //## number of blocks (if numberOfBlockFixed is false) in the structure of - //## source data field. This variable not represent the effective number of - //## block into the stream of data. + /// Represents the number of blocks (if numberOfBlockFixed is true) or max + /// number of blocks (if numberOfBlockFixed is false) in the structure of + /// source data field. This variable not represent the effective number of + /// block into the stream of data. word* maxNumberOfBlock; - //##ModelId=405AA86B01B4 - //##Documentation - //## Real number of blocks. + /// Real number of blocks. word* numberOfRealDataBlock; - //##ModelId=405AA86B01A5 word* indexOfNBlock; - //##ModelId=405AA86B01C4 - //##Documentation - //## for variable block, valore da sommare per ottenere il numero di eventi (blocchi) reali. + /// for variable block, valore da sommare per ottenere il numero di eventi (blocchi) reali. word *subFromNBlock; - //##ModelId=3EADC1440130 bool reset_output_stream; }; diff --git a/include/Utility.h b/include/Utility.h index f46e8c3b1f00ffbb996a4d46ee156605a6838d55..f29758eeb2caa457b0d26169a17b6fb8b5d5ce0e 100644 --- a/include/Utility.h +++ b/include/Utility.h @@ -2,8 +2,8 @@ Utility.h - description ------------------- begin : Thu Nov 29 2001 - copyright : (C) 2001 by Andrea Bulgarelli - email : bulgarelli@bo.iasf.cnr.it + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -15,94 +15,68 @@ * * ***************************************************************************/ -#ifndef UTILITY_H -#define UTILITY_H +#ifndef _UTILITY_H +#define _UTILITY_H #include "PacketLibDefinition.h" namespace PacketLib { -//##ModelId=405AA8630391 -//##Documentation -//## $Date: 2005/05/09 12:24:29 $ -//## $Header: /home/repository/cvs/gtb/PacketLib/include/Utility.h,v 1.5 2005/05/09 12:24:29 bulgarelli Exp $ -//## $Id: Utility.h,v 1.5 2005/05/09 12:24:29 bulgarelli Exp $ -//## $Revision: 1.5 $ -//## \brief A class with static method with common functionality. +/// \brief A class with static method with common functionality. class Utility { public: - //##ModelId=405AA86F00B2 static int binaryToInteger(string bin); - //##ModelId=405AA86F00B5 static int convertToInteger(string bin); - //##ModelId=405AA86F00B9 static int convertToInteger(char* bin); - //##ModelId=405AA86F00BC - //##Documentation - //## Restituisce n bit (allineati a destra di x a partire dalla posizione p). - //## Esempio: getbits(x,4,3) restituisce bit 4, 3, 2 (allinemanto a destra) - //## 7 6 5 4 3 2 1 0 */ + + /// It gives n bit (alligned at right of "x" from the p position). + /// Example: getbits(x,4,3) gives bit 4, 3, 2 (alligned at right) + /// 7 6 5 4 3 2 1 0 */ static unsigned getbits(word x, int p, int n); - //##ModelId=405AA86F00C2 static unsigned getbits2(word x, int p, int n); static unsigned getbits32(dword x, int p, int n); - //##ModelId=405AA86F00C7 static string* wordToBinary(word w, byte dim); - //##ModelId=405AA86F00CB static char* wordToBinary2(dword w, unsigned int dim); - //##ModelId=405AA86F00D0 static char* format_output(dword data, bool dec, bool hex, bool bin); - //##ModelId=405AA86F00D8 static char* integerToString(int n); - //##ModelId=405AA86F00DB static char* stringToHexadecimal(byte* s, dword dim, bool bigendian = true, bool addSpace = true); - //##ModelId=405AA86F00E1 static long strlen(char* s); - //##ModelId=405AA86F00E5 static char* byteToHexadecimal(byte b); - //##ModelId=405AA86F00E8 static int hexadecimalToInteger(string hex); - //##ModelId=405AA86F00EB -// static char* ftimeToChar(word MSB, word LSB, word ms); + /// static char* ftimeToChar(word MSB, word LSB, word ms); - //##ModelId=3EADC15C019B -// static char* ftimeToChar(struct tm* res, word ms); + /// static char* ftimeToChar(struct tm* res, word ms); - //##ModelId=3EADC15C0240 static char* integerToString2(int n, char* str); static char* integerToString3(char* str, int n); - //##ModelId=405AA86F00F0 static char* extractFileName(char* path); static char* extractPath(char* filename); - //##ModelId=405AA86F00F3 static char* charcat(char*, char); - //##ModelId=405AA86F00F7 static int getchildpid(int startpid, char* procname, int maxsearch=1000); - //##ModelId=405AA86F00FC static bool getchildpidlive(int pid); }; diff --git a/src/ByteStream.cpp b/src/ByteStream.cpp index 21be02dd22bf20b72946d9de27f01ccfc8da50e3..6b4e117784427b266c2fdaa2b1cf1c06f73e628f 100644 --- a/src/ByteStream.cpp +++ b/src/ByteStream.cpp @@ -1,31 +1,39 @@ -/** - * @(#) ByteStream.cpp - */ +/*************************************************************************** + ByteStream.cpp - description + ------------------- + begin : Thu Nov 29 2001 + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software for non commercial purpose * + * and for public research institutes; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License. * + * For commercial purpose see appropriate license terms * + * * + ***************************************************************************/ + #include "ByteStream.h" #include "PacketLibDemo.h" #include "Utility.h" using namespace PacketLib; -//oggetti che devono deallocare memoria + +/// Objects that deallocate memory dword ByteStream::count_object = 0; -//oggetti che non devono deallocare memoria +/// Objects that do not deallocate memory dword ByteStream::count_object2 = 0; -//##ModelId=3DA3E55D032A dword ByteStream::count_object_deleted = 0; -//##ModelId=3DA3E55E005A dword ByteStream::count_object_deleted2 = 0; -//long ByteStream::count_object_wrong = 0; - -/* - mem_allocation = true indica che presente memoria allocata che deve essere liberata - dal distruttore. - In tutti i metodi costruttori o di tipo set che accettano un byte*, nel caso in cui - memory_sharing=false significa che viene effettuato lo swap. - Nei metodi costruttori e di tipo set che accettano ByteStream* non viene mai - effettuato lo swap. -*/ - -//##ModelId=3C0F6BDB003B + + +/// Returns a pointer of a field in the list of fields of this part of packet. +/// \remarks mem_allocation = true indicates that the allocated memory must be released by the destroyer. +/// \remarks memory_sharing=false In all methods of constructor or set type accepting byte*, it indicates that the swap is applied. +/// In all methods of constructor or set type accepting ByteStream* the swap is never applied. + PacketLib::ByteStream::ByteStream(bool bigendian) { mem_allocation_constructor = true; @@ -39,14 +47,13 @@ PacketLib::ByteStream::ByteStream(bool bigendian) } -//##ModelId=3EADC12501CA PacketLib::ByteStream::ByteStream(dword dim, bool bigendian) { mem_allocation_constructor = true; byteInTheStream = dim; stream = (byte*) new byte[dim]; - //memset(stream, 0, dim); ok + /// memset(stream, 0, dim); ok this->bigendian = bigendian; setMemoryAllocated(true); @@ -54,7 +61,6 @@ PacketLib::ByteStream::ByteStream(dword dim, bool bigendian) } -//##ModelId=3EADC125023B PacketLib::ByteStream::ByteStream(byte* stream, dword dim, bool bigendian, bool memory_sharing) { mem_allocation_constructor = true; @@ -64,17 +70,15 @@ PacketLib::ByteStream::ByteStream(byte* stream, dword dim, bool bigendian, bool this->bigendian = bigendian; if(!memory_sharing) swap(); - //se memory_sharing == false significa che la responsabilit della memoria diviene - //di questo oggetto + /// \remarks memory_sharing == false means that the object is responsible for the memory setMemoryAllocated(!memory_sharing); mem_allocation_constructor = false; } -//##ModelId=3EADC125031B PacketLib::ByteStream::ByteStream(ByteStream* b0, ByteStream* b1, ByteStream* b2) { - //si suppone che gli stream siano gi swappati + /// Streams are swapped dword i = 0; dword dim = 0; if(b0 == 0 && b1 == 0 && b2 == 0) @@ -119,7 +123,7 @@ PacketLib::ByteStream::ByteStream(ByteStream* b0, ByteStream* b1, ByteStream* b2 } -//##ModelId=3C205AF201F8 + PacketLib::ByteStream::~ByteStream() { if(mem_allocation) @@ -136,7 +140,7 @@ PacketLib::ByteStream::~ByteStream() } -//##ModelId=3C0F6BDB0041 + byte PacketLib::ByteStream::getByte( dword byteNumber) { DEMORET0; @@ -147,14 +151,14 @@ byte PacketLib::ByteStream::getByte( dword byteNumber) } -//##ModelId=3C18775001BB long PacketLib::ByteStream::getValue(dword start, word dim) { DEMORET0; byte b1, b2; - //only 1 or 2 bytes + /// only 1 or 2 bytes if(dim <=0 || dim > 2) - return -1; //errore + /// error + return -1; if(bigendian) { b1 = stream[start]; @@ -177,7 +181,7 @@ long PacketLib::ByteStream::getValue(dword start, word dim) { if((start%2) == 0) { - //posto pari + /// even value b1=stream[start+1]; b2=stream[start]; } @@ -192,7 +196,7 @@ long PacketLib::ByteStream::getValue(dword start, word dim) } -//##ModelId=3C301E8800C7 + ByteStream* PacketLib::ByteStream::getSubByteStream(dword first, dword last) { DEMORET0; @@ -205,7 +209,7 @@ ByteStream* PacketLib::ByteStream::getSubByteStream(dword first, dword last) } -//##ModelId=3EADC126003A + ByteStream* PacketLib::ByteStream::getSubByteStreamCopy(dword first, dword last) { DEMORET0; @@ -221,14 +225,13 @@ ByteStream* PacketLib::ByteStream::getSubByteStreamCopy(dword first, dword last) } -//##ModelId=3EADC12503D4 byte* PacketLib::ByteStream::getStream() { return stream; } -//##ModelId=3EADC1260005 + byte* PacketLib::ByteStream::getOutputStream() { swap(); @@ -236,28 +239,26 @@ byte* PacketLib::ByteStream::getOutputStream() } -//##ModelId=3EADC126001E + void PacketLib::ByteStream::endOutputStream() { swap(); } -//##ModelId=3C87744001D8 dword PacketLib::ByteStream::getDimension() { return byteInTheStream; } -//##ModelId=3C87744001EC char* PacketLib::ByteStream::printStreamInHexadecimal() { return Utility::stringToHexadecimal(stream, byteInTheStream); } -//##ModelId=3EADC1260244 + void PacketLib::ByteStream::setStreamCopy(byte* b, dword dim) { deleteStreamMemory(); @@ -271,7 +272,7 @@ void PacketLib::ByteStream::setStreamCopy(byte* b, dword dim) } -//##ModelId=3C87744001F6 + bool PacketLib::ByteStream::setStream(byte* b, dword dim, bool bigendian, bool memory_sharing) { deleteStreamMemory(); @@ -286,7 +287,7 @@ bool PacketLib::ByteStream::setStream(byte* b, dword dim, bool bigendian, bool m } -//##ModelId=3EADC1260157 + bool PacketLib::ByteStream::setStream(ByteStream* b, dword first, dword last) { if(first > last) @@ -306,49 +307,49 @@ bool PacketLib::ByteStream::setStream(ByteStream* b, dword first, dword last) } -//##ModelId=3EADC1270079 + bool PacketLib::ByteStream::getMemAllocation() { return mem_allocation; } -//##ModelId=3EADC127009D bool PacketLib::ByteStream::isBigendian() const { return bigendian; } -//##ModelId=3EADC12603A5 + void PacketLib::ByteStream::setByte(dword start, word value) { stream[start] = value; } -//##ModelId=3EADC12602F1 bool PacketLib::ByteStream::setWord(dword start, word value) { byte b1, b2; - //solo posizioni pari + /// only even positions if(start%2 != 0) return false; - //non deve superare la dimensione dello stream + /// It must not overtake the stream dimension if(start+1 > byteInTheStream) return false; - //estrazione dei byte - b1 = (byte) value; //LSByte - b2 = (byte) (value >> 8); //MSByte + /// Byte extraction + /// \param LSByte + b1 = (byte) value; + /// \param MSByte + b2 = (byte) (value >> 8); if((bigendian && !ARCH_BIGENDIAN) || (!bigendian && ARCH_BIGENDIAN)) { - //swap + /// Swap stream[start] = b2; stream[start+1] = b1; } else { - //no swap per x86 + /// No swap for x86 stream[start] = b1; stream[start+1] = b2; } @@ -357,7 +358,6 @@ bool PacketLib::ByteStream::setWord(dword start, word value) } -//##ModelId=3EADC12700E8 void PacketLib::ByteStream::swap() { if(!bigendian) @@ -365,7 +365,8 @@ void PacketLib::ByteStream::swap() dword dim = byteInTheStream; for(dword i = 0; i< dim; i+=2) { - if((dim - i) != 1) //per dimensioni dispari + /// For odd dimensions + if((dim - i) != 1) { byte btemp = stream[i]; stream[i] = stream[i+1]; @@ -376,7 +377,7 @@ void PacketLib::ByteStream::swap() } -//##ModelId=3EADC127010D + void PacketLib::ByteStream::setMemoryAllocated(bool allocated) { @@ -415,7 +416,7 @@ void PacketLib::ByteStream::setMemoryAllocated(bool allocated) } -//##ModelId=3EADC12701A5 + void PacketLib::ByteStream::deleteStreamMemory() { if(!mem_allocation_constructor && mem_allocation) diff --git a/src/ConfigurationFile.cpp b/src/ConfigurationFile.cpp index e88f32dab52c2339adf3a43749df9ff2ecb15591..0cc01d3bc985602797405e4b330e89c3b723d60a 100644 --- a/src/ConfigurationFile.cpp +++ b/src/ConfigurationFile.cpp @@ -1,9 +1,9 @@ /*************************************************************************** - filepacket.cpp - description + ConfigurationFile.cpp - description ------------------- begin : Thu Nov 29 2001 - copyright : (C) 2001 by Andrea Bulgarelli - email : bulgarelli@tesre.bo.cnr.it + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -21,21 +21,18 @@ using namespace PacketLib; -//##ModelId=3DA3E568008C ConfigurationFile::ConfigurationFile() { currentpwd = 0; } -//##ModelId=3DA3E568008D ConfigurationFile::~ConfigurationFile() { //free(currentpwd); } -//##ModelId=3DA3E568008E bool ConfigurationFile::open(char** parameters) throw(PacketExceptionIO*) { bool ret; @@ -47,7 +44,7 @@ bool ConfigurationFile::open(char** parameters) throw(PacketExceptionIO*) } -//##ModelId=3DA3E56800FD + void ConfigurationFile::close() throw(PacketExceptionIO*) { InputTextFile::close(); @@ -55,7 +52,7 @@ void ConfigurationFile::close() throw(PacketExceptionIO*) } -//##ModelId=3DA3E56800C0 + char* ConfigurationFile::getLine() throw(PacketExceptionIO*) { char* temp; @@ -78,7 +75,7 @@ char* ConfigurationFile::getLine() throw(PacketExceptionIO*) } -//##ModelId=3DA3E56800FA + char* ConfigurationFile::getLine(const char* s) throw(PacketExceptionIO*) { char* line; diff --git a/src/DataFieldHeader.cpp b/src/DataFieldHeader.cpp index 0f02e52754bf846b7c0ccc1ed6b153cbc2fee602..b87e83b739d7aa99ebc09b5d6e1470f44ed12849 100644 --- a/src/DataFieldHeader.cpp +++ b/src/DataFieldHeader.cpp @@ -1,6 +1,20 @@ -/** - * @(#) DataFieldHeader.cpp - */ +/*************************************************************************** + DataFieldHeader.cpp - description + ------------------- + begin : Thu Nov 29 2001 + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software for non commercial purpose * + * and for public research institutes; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License. * + * For commercial purpose see appropriate license terms * + * * + ***************************************************************************/ + #include "DataFieldHeader.h" diff --git a/src/Device.cpp b/src/Device.cpp index 0319455b5c1b9d47a9c26f6e0f32f5ad50802f63..ef4799aa9b5b85cecad75f687c3c5662b0c0ee1d 100644 --- a/src/Device.cpp +++ b/src/Device.cpp @@ -2,8 +2,8 @@ Device.cpp - description ------------------- begin : Mon Mar 4 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@tesre.bo.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -17,7 +17,7 @@ #include "Device.h" using namespace PacketLib; -//##ModelId=3C87744002A0 + Device::Device(bool bigendian) { eof = true; @@ -25,8 +25,6 @@ Device::Device(bool bigendian) this->bigendian = bigendian; } - -//##ModelId=3DC552600182 bool Device::isBigEndian() const { return bigendian; @@ -36,14 +34,12 @@ bool Device::isBigEndian() const /*Device::~Device(){ } */ -//##ModelId=3C87744002A2 bool Device::isClosed() const { return closed; } -//##ModelId=3C87744002AB bool Device::isEOF() const { if(!closed) @@ -53,16 +49,14 @@ bool Device::isEOF() const } -/** Read property of bool endsession. */ -//##ModelId=3ACCD75E031C +/// Read property of bool endsession. const bool& Device::getEndSession() const { return endsession; } -/** Write property of bool endsession. */ -//##ModelId=3ACCD75E02EE +/// Write property of bool endsession. void Device::setEndSession( const bool& _newVal) { endsession = _newVal; diff --git a/src/Field.cpp b/src/Field.cpp index b8ad57437efd8f9efc8f42796d1bc08b93ffa7f4..442aa13870875ca2d3ec4f722325f1633205ca03 100644 --- a/src/Field.cpp +++ b/src/Field.cpp @@ -1,6 +1,20 @@ -/** - * @(#) Field.cpp - */ +/*************************************************************************** + Field.cpp - description + ------------------- + begin : Thu Nov 29 2001 + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software for non commercial purpose * + * and for public research institutes; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License. * + * For commercial purpose see appropriate license terms * + * * + ***************************************************************************/ + #include "Field.h" #include "Utility.h" @@ -10,11 +24,10 @@ using namespace PacketLib; static FieldType** filedTypeList = 0; -//##ModelId=3C0F6C1A0001 Field::Field(char* n, char* dim, char* prVal, int count) : progressiv(count) { value = 0; - //create FieldType list + /// create FieldType list if(filedTypeList == 0) { //cout << "create list" << endl; @@ -60,7 +73,6 @@ Field::Field(char* n, char* dim, char* prVal, int count) : progressiv(count) } -//##ModelId=3ACCD75E036B Field::~Field() { diff --git a/src/File.cpp b/src/File.cpp index 0d3bc08d2fc9f10fb8ef18eaced5a05ab92fb214..703cfdd7622f96671c4e7107ba769ca713e3bb69 100644 --- a/src/File.cpp +++ b/src/File.cpp @@ -1,9 +1,9 @@ /*************************************************************************** - file.cpp - description + File.cpp - description ------------------- begin : Tue Nov 20 2001 - copyright : (C) 2001 by Andrea Bulgarelli - email : bulgarelli@tesre.bo.cnr.it + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -23,15 +23,14 @@ using namespace PacketLib; -//##ModelId=3DA3E56900F0 dword File::byte_read = 0; -//##ModelId=3DA3E56A0078 + dword File::char_read = 0; -//##ModelId=3C0F6C1A0012 File::File() : Device(false) { - // bigendian = false; //si presume che la macchina sia little endian + /// \param bigendian = false; + /// \remarks A little endian machine is assumed startPosition = 0; filename = 0; bookmarkPos =0; @@ -39,10 +38,11 @@ File::File() : Device(false) } -//##ModelId=3C187750028F + File::File(bool b, long startP) : Device(b) { - //bigendian = b; //si specifica il formato endian della macchina + /// \param bigendian = b; + /// The machine endian format is specified startPosition = startP; filename = 0; bookmarkPos =0; @@ -56,7 +56,6 @@ File::~File() //delete[] mode; } -//##ModelId=3C0F6C1A0013 bool File::open(const char* filename, const char* mode) throw(PacketExceptionIO*) { DEMORET0; @@ -85,7 +84,6 @@ bool File::open(const char* filename, const char* mode) throw(PacketExceptionIO* } -//##ModelId=3C0F6C1A0016 int File::getByte() { int c; @@ -108,7 +106,6 @@ int File::getByte() } -//##ModelId=3C0F6C1A0018 ByteStream* File::getNByte(dword N) { dword i = 0; @@ -157,7 +154,6 @@ ByteStream* File::getNByte(dword N) } -//##ModelId=3C0F6C1A001B char* File::getLine() throw(PacketExceptionIO*) { //char* s = new char[500]; @@ -217,7 +213,6 @@ long File::getNumberOfStringLines() return nlines; } -//##ModelId=3C0F6C1A001F void File::close( ) throw(PacketExceptionIO*) { if(!closed) @@ -229,21 +224,18 @@ void File::close( ) throw(PacketExceptionIO*) } -//##ModelId=3C0F6C1A0021 bool File::isClosed() { return closed; } -//##ModelId=3C15F42303C4 char* File::getLastLineRead() { return lastLineRead; } -//##ModelId=3C205AF20278 dword File::setpos(dword offset) throw(PacketExceptionIO*) { dword f; @@ -257,14 +249,13 @@ dword File::setpos(dword offset) throw(PacketExceptionIO*) } -//##ModelId=3C205AF202C3 + dword File::getpos() { return ftell(fp); } -//##ModelId=3C205AF20313 bool File::memBookmarkPos() { if((bookmarkPos = ftell(fp)) != (dword) -1) @@ -274,7 +265,7 @@ bool File::memBookmarkPos() } -//##ModelId=3C205AF20334 + bool File::setLastBookmarkPos() { if(fseek(fp, bookmarkPos, SEEK_SET) == 0) @@ -284,7 +275,7 @@ bool File::setLastBookmarkPos() } -//##ModelId=3A5A30B40368 + bool File::isEOF() { if(!closed) @@ -294,14 +285,13 @@ bool File::isEOF() } -//##ModelId=3C51324A022E + int File::setFirstPos() throw(PacketExceptionIO*) { return setpos(startPosition); } -//##ModelId=3C51324A0299 bool File::fchdir() throw(PacketExceptionIO*) { @@ -324,8 +314,7 @@ bool File::fchdir() throw(PacketExceptionIO*) } -/** No descriptions */ -//##ModelId=3C51324A0304 + long File::find(byte b) throw(PacketExceptionIO*) { byte f; @@ -339,7 +328,6 @@ long File::find(byte b) throw(PacketExceptionIO*) } -//##ModelId=3DA3E56D0244 bool File::writeString(const char* str) throw(PacketExceptionIO*) { if(str != 0) @@ -350,7 +338,7 @@ bool File::writeString(const char* str) throw(PacketExceptionIO*) } -//##ModelId=3DA3E56F00DC + bool File::writeByteStream(ByteStream* b) throw(PacketExceptionIO*) { byte* stream = b->getOutputStream(); diff --git a/src/FileStream.cpp b/src/FileStream.cpp index 5bf6ab57f5fa63f99e4ca9175ea71ed5c3dacd3d..3ff1b550fe1db8bbb1629891f8e0b5b0a4da15c3 100644 --- a/src/FileStream.cpp +++ b/src/FileStream.cpp @@ -1,8 +1,24 @@ +/*************************************************************************** + FileStream.cpp - description + ------------------- + begin : Thu Nov 29 2001 + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software for non commercial purpose * + * and for public research institutes; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License. * + * For commercial purpose see appropriate license terms * + * * + ***************************************************************************/ + #include "FileStream.h" using namespace PacketLib; -//##ModelId=3C1877500365 FileStream::FileStream(bool prefix, bool bigen, word dimprefix, long startposition) : File(bigen, startposition) { @@ -11,7 +27,6 @@ FileStream::FileStream(bool prefix, bool bigen, word dimprefix, long startpositi } -//##ModelId=3C205AF20368 ByteStream* FileStream::readHeader(unsigned int dimHeader) { header = getNByte(dimHeader); @@ -19,7 +34,6 @@ ByteStream* FileStream::readHeader(unsigned int dimHeader) } -//##ModelId=3C205AF2036F ByteStream* FileStream::readDataField(unsigned int dimDataField) { dataField = getNByte(dimDataField); @@ -27,8 +41,6 @@ ByteStream* FileStream::readDataField(unsigned int dimDataField) } -/** No descriptions */ -//##ModelId=3C87744100F3 ByteStream* FileStream::readPrefix() { if(thereIsPrefix) diff --git a/src/FileStreamPointer.cpp b/src/FileStreamPointer.cpp index 86ae96b7b64f711f12c067f68802fe839fc39ba9..4529940dda78c9dd5b271e1b82a7574b596a9750 100644 --- a/src/FileStreamPointer.cpp +++ b/src/FileStreamPointer.cpp @@ -2,8 +2,8 @@ FileStreamPointer.cpp - description ------------------- begin : Mon Jan 14 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@tesre.bo.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -19,13 +19,11 @@ using namespace PacketLib; -//##ModelId=3C877441011B FileStreamPointer::FileStreamPointer() { } -//##ModelId=3C877441011C FileStreamPointer::~FileStreamPointer() { diff --git a/src/Input.cpp b/src/Input.cpp index 79abccefde95122e510ec312c797734fab9b8b83..a3cdf9214d40dfe0f70c2ac85ae506317b6a4066 100644 --- a/src/Input.cpp +++ b/src/Input.cpp @@ -2,8 +2,8 @@ Input.cpp - description ------------------- begin : Sat Oct 26 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@tesre.bo.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -19,7 +19,6 @@ using namespace PacketLib; -//##ModelId=3DBFBFBC01EB Input::Input(bool bigendian) { eof = true; @@ -28,21 +27,18 @@ Input::Input(bool bigendian) } -//##ModelId=3DBFBFBC01ED Input::~Input() { } -//##ModelId=3DBFBFBC025B bool Input::isClosed() { return closed; } -//##ModelId=3DBFBFBC025D bool Input::isEOF() { if( closed) @@ -52,7 +48,6 @@ bool Input::isEOF() } -//##ModelId=3DBFBFBC025F bool Input::isBigendian() { return bigendian; diff --git a/src/InputFile.cpp b/src/InputFile.cpp index 5bc99225f9118a9c49f69ac82eb5c838276a480d..69c93f2ed5b401f7e3725838762a59f77a422d0d 100644 --- a/src/InputFile.cpp +++ b/src/InputFile.cpp @@ -2,8 +2,8 @@ InputFile.cpp - description ------------------- begin : Sat Oct 26 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@tesre.bo.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -19,14 +19,12 @@ using namespace PacketLib; -//##ModelId=3DBFBFBD00D2 InputFile::InputFile(bool bg) : Input(bg) { file = new File(bg, 0); } -//##ModelId=3DBFBFBD00D4 InputFile::~InputFile() { cout << "InputFile::~InputFile()" << endl; @@ -34,7 +32,6 @@ InputFile::~InputFile() } -//##ModelId=3DBFBFBD00D5 bool InputFile::open( char** parameters ) throw(PacketExceptionIO*) { file->open(parameters[0], (char*)"r"); @@ -45,7 +42,6 @@ bool InputFile::open( char** parameters ) throw(PacketExceptionIO*) } -//##ModelId=3DBFBFBD00D8 void InputFile::close() throw(PacketExceptionIO*) { file->close(); @@ -53,7 +49,6 @@ void InputFile::close() throw(PacketExceptionIO*) } -//##ModelId=3DBFBFBD0104 ByteStream* InputFile::readByteStream(dword n_byte) throw(PacketExceptionIO*) { ByteStream* bs; @@ -68,7 +63,6 @@ ByteStream* InputFile::readByteStream(dword n_byte) throw(PacketExceptionIO*) } -//##ModelId=3DBFBFBD0107 char* InputFile::readString() throw(PacketExceptionIO*) { char* c; diff --git a/src/InputPacketStream.cpp b/src/InputPacketStream.cpp index 1a5cfa90ee363a73da0ade067400c0548eb7fc8e..51b95fefad660f5aa72bf180c1fadc5812281634 100644 --- a/src/InputPacketStream.cpp +++ b/src/InputPacketStream.cpp @@ -2,8 +2,8 @@ InputPacketStream.cpp - description ------------------- begin : Sun Oct 27 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@tesre.bo.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -19,32 +19,31 @@ using namespace PacketLib; -//##ModelId=3DA3E5730122 + InputPacketStream::InputPacketStream() : PacketStream() { in = 0; } -//##ModelId=3DA3E57400AA + InputPacketStream::InputPacketStream(const char* fileNameConfig) : PacketStream(fileNameConfig) { in = 0; } -//##ModelId=3DA3E5740118 + InputPacketStream::~InputPacketStream() { } -//##ModelId=3C3AB71401AE int InputPacketStream::detPacketType(ByteStream* prefix, ByteStream* packetHeader, ByteStream* packetDataField) { - // Iterate through list and output each element. - // Il packetType 0 e' il packet not recognized + /// Iterate through list and output each element. + /// The packetType 0 is the packet not recognized for (int i = 1; iin = in; } -//##ModelId=3DBFBFBE00C8 + Packet* InputPacketStream::readPacket() throw(PacketExceptionIO*) { unsigned dimHeader = getHeaderDimension(); diff --git a/src/InputPacketStreamFile.cpp b/src/InputPacketStreamFile.cpp index 019b2b81e8e691a83efab5e9cf24f95ea273127d..0abdb34e087a7e4533e91cf91753ab9b31be27ea 100644 --- a/src/InputPacketStreamFile.cpp +++ b/src/InputPacketStreamFile.cpp @@ -1,6 +1,20 @@ -/** - * @(#) InputPacketStream.cpp - */ +/*************************************************************************** + InputPacketStreamFile.cpp - description + ------------------- + begin : Thu Nov 29 2001 + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software for non commercial purpose * + * and for public research institutes; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License. * + * For commercial purpose see appropriate license terms * + * * + ***************************************************************************/ + #include "InputPacketStreamFile.h" @@ -11,7 +25,7 @@ using namespace PacketLib; -//##ModelId=3DBFBFBE02E5 + InputPacketStreamFile::InputPacketStreamFile(const char* fileNameConfig, const char* fileNameStream, long initialPosition) : InputPacketStream(fileNameConfig) { @@ -25,7 +39,6 @@ InputPacketStreamFile::InputPacketStreamFile(const char* fileNameConfig, const c } -//##ModelId=3DBFBFBE0323 InputPacketStreamFile::InputPacketStreamFile() : InputPacketStream() { this->initialPosition = 0; @@ -38,7 +51,7 @@ InputPacketStreamFile::InputPacketStreamFile() : InputPacketStream() } -//##ModelId=3DBFBFBE0324 + InputPacketStreamFile::~InputPacketStreamFile() { @@ -54,7 +67,7 @@ InputPacketStreamFile::~InputPacketStreamFile() } -//##ModelId=3DBFBFBE0353 + bool InputPacketStreamFile::openInputStream() throw(PacketExceptionIO*) { FileStream* f = new FileStream(prefix, bigendian, dimPrefix, initialPosition); @@ -75,7 +88,6 @@ bool InputPacketStreamFile::openInputStream() throw(PacketExceptionIO*) } -//##ModelId=3DBFBFBE038F bool InputPacketStreamFile::freeRun() throw(PacketExceptionIO*) { ByteStream* b1 = 0, *b2 = 0, *b0 = 0; @@ -148,7 +160,7 @@ bool InputPacketStreamFile::freeRun() throw(PacketExceptionIO*) fsp->pointerEnd = inputStream->getpos() - 1; if(count%FSP_STEP == 0) { - //resize + /// resize FileStreamPointer** lfsp = (FileStreamPointer**)new FileStreamPointer* [count + FSP_STEP]; for(int i=0; igetFileName(); @@ -217,14 +228,14 @@ Packet* InputPacketStreamFile::getPacketFromFileStreamPointer(int index, bool ne } -//##ModelId=3DBFBFBE0354 + void InputPacketStreamFile::closeInputStream() throw(PacketExceptionIO*) { inputStream->close(); } -//##ModelId=3DBFBFBE03C0 + FileStreamPointer* InputPacketStreamFile::getFileStreamPointer(int index) { if(index > numberOfFileStreamPointer) @@ -237,7 +248,7 @@ FileStreamPointer* InputPacketStreamFile::getFileStreamPointer(int index) } -//##ModelId=3DBFBFBE03C2 + void InputPacketStreamFile::setInitialPosition(long p) { if(p>=0) @@ -247,21 +258,21 @@ void InputPacketStreamFile::setInitialPosition(long p) } -//##ModelId=3DBFBFBE0325 + void InputPacketStreamFile::setFileNameStream(char* f) { this->fileNameStream = f; } -//##ModelId=3DBFBFBE038E + long InputPacketStreamFile::getNumberOfFileStreamPointer() { return numberOfFileStreamPointer; } -//##ModelId=3DBFBFBE0356 + Packet* InputPacketStreamFile::getPacketFromStream() throw (PacketExceptionIO * ) { ByteStream* b1 = 0, *b2 = 0, *b0 = 0; @@ -311,7 +322,7 @@ Packet* InputPacketStreamFile::getPacketFromStream() throw (PacketExceptionIO * } -//##ModelId=3DBFBFBE0355 + bool InputPacketStreamFile::isInputStreamEOF() throw(PacketExceptionIO*) { return inputStream->isEOF(); diff --git a/src/InputSerial.cpp b/src/InputSerial.cpp index ca040158b146d9e271e46a8779d0096be2ebcf75..22345590e21bffb819dbbd68511a34b202f7ed7f 100644 --- a/src/InputSerial.cpp +++ b/src/InputSerial.cpp @@ -1,9 +1,9 @@ /*************************************************************************** - InputFile.cpp - description + InputSerial.cpp - description ------------------- begin : Sat Oct 26 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@tesre.bo.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -19,21 +19,20 @@ using namespace PacketLib; -//##ModelId=3DBFBFBD00D2 + InputSerial::InputSerial(bool bg) : Input(bg) { serial = new Serial(); } -//##ModelId=3DBFBFBD00D4 + InputSerial::~InputSerial() { delete serial; } -//##ModelId=3DBFBFBD00D5 bool InputSerial::open( char** parameters ) throw(PacketExceptionIO*) { flag = atoi( parameters[1] ); @@ -48,7 +47,7 @@ bool InputSerial::open( char** parameters ) throw(PacketExceptionIO*) } -//##ModelId=3DBFBFBD00D8 + void InputSerial::close() throw(PacketExceptionIO*) { serial->close(); @@ -56,7 +55,7 @@ void InputSerial::close() throw(PacketExceptionIO*) } -//##ModelId=3DBFBFBD0104 + ByteStream* InputSerial::readByteStream(int n_byte) throw(PacketExceptionIO*) { //cout << "waiting " << n_byte << endl; @@ -91,7 +90,7 @@ ByteStream* InputSerial::readByteStream(int n_byte) throw(PacketExceptionIO*) } -//##ModelId=3DBFBFBD0107 + char* InputSerial::readString() throw(PacketExceptionIO*) { /* char* c; diff --git a/src/InputSocketServer.cpp b/src/InputSocketServer.cpp index 3eb586dada683dd93ffe0f9d12906c8c90bf4331..712a39e66823075cd7061fba9b17fba6fcac26d4 100644 --- a/src/InputSocketServer.cpp +++ b/src/InputSocketServer.cpp @@ -1,9 +1,9 @@ /*************************************************************************** - InputSocket.cpp - description + InputSocketServer.cpp - description ------------------- begin : Sat Oct 26 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@tesre.bo.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -19,7 +19,7 @@ using namespace PacketLib; -//##ModelId=3DBFBFBF00B9 + InputSocketServer::InputSocketServer(bool bg) : Input(bg) { socketserver = 0; @@ -27,14 +27,13 @@ InputSocketServer::InputSocketServer(bool bg) : Input(bg) } -//##ModelId=3DBFBFBF00BB + InputSocketServer::~InputSocketServer() { delete socketserver; } -//##ModelId=3DBFBFBF00F0 bool InputSocketServer::open( char** parameters ) throw(PacketExceptionIO*) { port = atoi(parameters[0]); @@ -48,7 +47,7 @@ bool InputSocketServer::open( char** parameters ) throw(PacketExceptionIO*) } -//##ModelId=3DBFBFBF00F3 + void InputSocketServer::close() throw(PacketExceptionIO*) { socketserver->close(); @@ -57,7 +56,7 @@ void InputSocketServer::close() throw(PacketExceptionIO*) } -//##ModelId=3DBFBFBF00F5 + ByteStream* InputSocketServer::readByteStream(int n_byte) throw(PacketExceptionIO*) { int status = 0; @@ -81,7 +80,7 @@ ByteStream* InputSocketServer::readByteStream(int n_byte) throw(PacketExceptionI } -//##ModelId=3DBFBFBF0122 + char* InputSocketServer::readString() throw(PacketExceptionIO*) { throw new PacketExceptionIO("Method not implemented"); diff --git a/src/InputText.cpp b/src/InputText.cpp index 4c1f06d73f4e1d2e6a37411e6415d30288fd8bbb..794209d08fff5e20f18430b4348b52dd0ea786e5 100644 --- a/src/InputText.cpp +++ b/src/InputText.cpp @@ -2,8 +2,8 @@ InputText.cpp - description ------------------- begin : Mon Mar 4 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@tesre.bo.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -19,7 +19,7 @@ using namespace PacketLib; -//##ModelId=3AA6490E015C + InputText::InputText() { eof = true; @@ -27,20 +27,20 @@ InputText::InputText() } -//##ModelId=3AA6490E016F + InputText::~InputText() { } -//##ModelId=3DC55A8F0075 + bool InputText::isClosed() { return closed; } -//##ModelId=3DC55A8F00E8 + bool InputText::isEOF() { if( closed) diff --git a/src/InputTextFile.cpp b/src/InputTextFile.cpp index 90781d0d2dce4c602a74c59b3957fe3399bac61b..bbc3b308713a941231cbe963e54f9851bcf4cd6b 100644 --- a/src/InputTextFile.cpp +++ b/src/InputTextFile.cpp @@ -2,8 +2,8 @@ InputTextFile.cpp - description ------------------- begin : Mon Mar 4 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@tesre.bo.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -24,10 +24,10 @@ using namespace PacketLib; int InputTextFile::nListOfBuffers = 0; MemoryBuffer** InputTextFile::listOfBuffers = 0; -//##ModelId=3AA64922006A + InputTextFile::InputTextFile() : InputText() { - //create buffer list + /// create buffer list if(InputTextFile::listOfBuffers == 0) { int nb = CONFIG_MAXNUMBER_OFCONFIGILES; @@ -40,14 +40,12 @@ InputTextFile::InputTextFile() : InputText() } -//##ModelId=3AA64922007E InputTextFile::~InputTextFile() { } -//##ModelId=3DA3E57A02F8 bool InputTextFile::fchdir() throw(PacketExceptionIO*) { try @@ -65,15 +63,14 @@ bool InputTextFile::fchdir() throw(PacketExceptionIO*) } -//##ModelId=3AA64922009C bool InputTextFile::open(char** parameters) throw(PacketExceptionIO*) { //cout << "open " << parameters[0] << endl; bool ret; - //check if the file has been already loaded into MemoryBuffer - //find the name of the buffer in the list + /// check if the file has been already loaded into MemoryBuffer + /// find the name of the buffer in the list buffer = 0; @@ -145,7 +142,7 @@ bool InputTextFile::open(char** parameters) throw(PacketExceptionIO*) }; -//##ModelId=3AA6492200F6 + void InputTextFile::close() throw(PacketExceptionIO*) { file.close(); @@ -153,7 +150,7 @@ void InputTextFile::close() throw(PacketExceptionIO*) closed = file.isClosed(); }; -//##ModelId=3AA64922011E + char* InputTextFile::getLine() throw(PacketExceptionIO*) { try @@ -175,7 +172,7 @@ char* InputTextFile::getLine() throw(PacketExceptionIO*) } -//##ModelId=3AA64922013C + char* InputTextFile::getLine(const char* s) throw(PacketExceptionIO*) { char* line; @@ -202,42 +199,37 @@ char* InputTextFile::getLine(const char* s) throw(PacketExceptionIO*) } -//##ModelId=3AA649220196 + char* InputTextFile::getLastLineRead() { return buffer->getlastbuffer(); } -//##ModelId=3AA6492201BE long InputTextFile::getpos() { return buffer->getpos(); } -//##ModelId=3AA6492201DC bool InputTextFile::memBookmarkPos() { return buffer->memBookmarkPos(); } -//##ModelId=3AA64922020E int InputTextFile::setFirstPos() { return buffer->setpos(0); } -//##ModelId=3AA64922022C bool InputTextFile::setLastBookmarkPos() { return buffer->setLastBookmarkPos(); } -//##ModelId=3AA64922025E long InputTextFile::setpos(long offset) throw(PacketExceptionIO*) { long l; diff --git a/src/MSGQ.cpp b/src/MSGQ.cpp index ad963b6a43f2160ad21946c890cbde9a8ec4554e..31133765a7a420f2c58f99041e5aa45e1d2830e2 100644 --- a/src/MSGQ.cpp +++ b/src/MSGQ.cpp @@ -1,9 +1,9 @@ /*************************************************************************** - SHQ.cpp - description + MSGQ.cpp - description ------------------- begin : Wed Dec 4 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@tesre.bo.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -74,7 +74,7 @@ bool MSGQ::open(long msgqkey, long dim) throw(PacketExceptionIO*) DEMORET0; try { - //ottiene la message queue + /// It gets the message queue if(msgqkey != 0) { if((msgqid = msgget(msgqkey, PERMMSGQ)) < 0) diff --git a/src/MemoryBuffer.cpp b/src/MemoryBuffer.cpp index 44bebfdc27df26e85689174d54628212af11bcfd..51c89fcb11958ef38929ff3af15916b21737a88a 100644 --- a/src/MemoryBuffer.cpp +++ b/src/MemoryBuffer.cpp @@ -2,8 +2,8 @@ MemoryBuffer.cpp - description ------------------- begin : Fri Apr 12 2002 -copyright : (C) 2002 by Andrea Bulgarelli -email : bulgarelli@tesre.bo.cnr.it +copyright : (C) 2002, 2013 by Andrea Bulgarelli +email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -23,7 +23,7 @@ email : bulgarelli@tesre.bo.cnr.it using namespace PacketLib; -//##ModelId=3DA3E57B01A4 + MemoryBuffer::MemoryBuffer() { dim = CONFIG_MAXNUMBEROFLINES_OFCONFIGILES; @@ -35,7 +35,7 @@ MemoryBuffer::MemoryBuffer() } -//##ModelId=3DA3E57B01A5 + MemoryBuffer::~MemoryBuffer() { //if(buffer) @@ -56,8 +56,7 @@ void MemoryBuffer::freebuffer() } -/** Read property of char** buffer. */ -//##ModelId=3DA3E57B0245 +/// Read property of char** buffer. char* MemoryBuffer::getbuffer() { if(indexread <= dim) @@ -105,8 +104,7 @@ long MemoryBuffer::setpos(int index) } -/** Read property of char** buffer. */ -//##ModelId=3DA3E57B0280 +/// Read property of char** buffer. char* MemoryBuffer::getbuffer(dword index) { @@ -123,8 +121,7 @@ char* MemoryBuffer::getbuffer(dword index) } -/** Write property of char** buffer. */ -//##ModelId=3DA3E57B01D6 +/// Write property of char** buffer. void MemoryBuffer::setbuffer(char* line) throw (PacketException*) { //copy string @@ -138,8 +135,7 @@ void MemoryBuffer::setbuffer(char* line) throw (PacketException*) } -/** Write property of char** buffer. */ -//##ModelId=3DA3E57B0212 +/// Write property of char** buffer. void MemoryBuffer::setbuffer(char* line, dword index) throw(PacketException*) { if(index > indexwrite) @@ -169,29 +165,27 @@ void MemoryBuffer::setbuffer(char* line, dword index) throw(PacketException*) } -//##ModelId=3DA3E57B02B2 + void MemoryBuffer::readRewind() { indexread = 0; } -//##ModelId=3DA3E57B02B3 + void MemoryBuffer::writeRewind() { indexwrite = 0; } -/** No descriptions */ -//##ModelId=3DA3E57B02B4 + dword MemoryBuffer::getBufferDimension() { return indexwrite; } -//##ModelId=3DA3E57B02EE bool MemoryBuffer::loadBuffer(char* filename) throw(PacketExceptionIO*) { bool ret; @@ -225,7 +219,7 @@ bool MemoryBuffer::loadBuffer(char* filename) throw(PacketExceptionIO*) } -//##ModelId=3DA3E57B0320 + bool MemoryBuffer::saveBuffer(char* filename) throw(PacketExceptionIO*) { bool ret = true; diff --git a/src/Output.cpp b/src/Output.cpp index 7d7a2aaf80e243f0eb49a8907b72b6fcd692ce9f..4ff64016fa474b8517d6b912940b05b5f3d3468a 100644 --- a/src/Output.cpp +++ b/src/Output.cpp @@ -1,8 +1,25 @@ +/*************************************************************************** + Output.cpp - description + ------------------- + begin : Thu Nov 29 2001 + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software for non commercial purpose * + * and for public research institutes; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License. * + * For commercial purpose see appropriate license terms * + * * + ***************************************************************************/ + #include "Output.h" using namespace PacketLib; -//##ModelId=3DA3E57C0082 + Output::Output(bool bigendian) { isclosed = true; @@ -16,7 +33,7 @@ bool Output::isClosed() } -//##ModelId=3DBFBFBF01CC + bool Output::isBigendian() { return bigendian; diff --git a/src/OutputFile.cpp b/src/OutputFile.cpp index d1f93e3d3bc345c74d21842430856318a05b569e..3b3f9e2499e8851784929808b20d888402381521 100644 --- a/src/OutputFile.cpp +++ b/src/OutputFile.cpp @@ -2,8 +2,8 @@ OutputFile.cpp - description ------------------- begin : Mon Apr 29 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@tesre.bo.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -19,21 +19,21 @@ using namespace PacketLib; -//##ModelId=3DA3E57C02A8 + OutputFile::OutputFile(bool bigendian) : Output(bigendian) { file = new File(bigendian, 0); } -//##ModelId=3DA3E57C02DA + OutputFile::~OutputFile() { delete file; } -//##ModelId=3DA3E57C02DC + void OutputFile::close() throw(PacketExceptionIO*) { file->close(); @@ -41,7 +41,7 @@ void OutputFile::close() throw(PacketExceptionIO*) } -//##ModelId=3DA3E57C0317 + bool OutputFile::open(char** parameters) throw(PacketExceptionIO*) { file->open(parameters[0], "w"); @@ -51,7 +51,7 @@ bool OutputFile::open(char** parameters) throw(PacketExceptionIO*) } -//##ModelId=3DA3E57C0348 + bool OutputFile::writeByteStream(ByteStream* b) throw(PacketExceptionIO*) { if(!isclosed) @@ -63,7 +63,7 @@ bool OutputFile::writeByteStream(ByteStream* b) throw(PacketExceptionIO*) } -//##ModelId=3DA3E57C0384 + bool OutputFile::writeString(const char* str) throw(PacketExceptionIO*) { if(!isclosed) diff --git a/src/OutputPacketStream.cpp b/src/OutputPacketStream.cpp index 106c2a547a7817d35b688543c9df44c48351c1c0..9ab1236b471c1c1bac92363b50168c638fc0bd82 100644 --- a/src/OutputPacketStream.cpp +++ b/src/OutputPacketStream.cpp @@ -1,22 +1,38 @@ +/*************************************************************************** + OutputPacketStream.cpp - description + ------------------- + begin : Thu Nov 29 2001 + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software for non commercial purpose * + * and for public research institutes; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License. * + * For commercial purpose see appropriate license terms * + * * + ***************************************************************************/ + #include "OutputPacketStream.h" using namespace PacketLib; -//##ModelId=3DBFBFC0007D + OutputPacketStream::OutputPacketStream() : PacketStream() { out = 0; } -//##ModelId=3DBFBFC000AA + OutputPacketStream::OutputPacketStream(const char* fileNameConfig) : PacketStream(fileNameConfig) { out = 0; } -//##ModelId=3DBFBFC000E6 bool OutputPacketStream::writePacket(Packet* p) throw(PacketExceptionIO*) { ByteStream* bs; @@ -38,7 +54,7 @@ bool OutputPacketStream::writePacket(Packet* p) throw(PacketExceptionIO*) } -//##ModelId=3DBFBFC00118 + void OutputPacketStream::setOutput(Output* out) { this->out = out; diff --git a/src/OutputSerial.cpp b/src/OutputSerial.cpp index 8b1457156a7f806ab7020963239354204eef261b..73d5699dac22d7ac5709728436cd8648d08e7ed2 100644 --- a/src/OutputSerial.cpp +++ b/src/OutputSerial.cpp @@ -2,8 +2,8 @@ OutputSerial.cpp - description ------------------- begin : Mon Apr 29 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@tesre.bo.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -19,21 +19,21 @@ using namespace PacketLib; -//##ModelId=3DA3E57C02A8 + OutputSerial::OutputSerial(bool bigendian) : Output(bigendian) { serial = new Serial(); } -//##ModelId=3DA3E57C02DA + OutputSerial::~OutputSerial() { delete serial; } -//##ModelId=3DA3E57C02DC + void OutputSerial::close() throw(PacketExceptionIO*) { serial->close(); @@ -41,7 +41,7 @@ void OutputSerial::close() throw(PacketExceptionIO*) } -//##ModelId=3DA3E57C0317 + bool OutputSerial::open(char** parameters) throw(PacketExceptionIO*) { flag = atoi( parameters[1] ); @@ -52,7 +52,7 @@ bool OutputSerial::open(char** parameters) throw(PacketExceptionIO*) } -//##ModelId=3DA3E57C0348 + bool OutputSerial::writeByteStream(ByteStream* b) throw(PacketExceptionIO*) { byte* buff = b->getStream(); @@ -68,7 +68,7 @@ bool OutputSerial::writeByteStream(ByteStream* b) throw(PacketExceptionIO*) } -//##ModelId=3DA3E57C0384 + bool OutputSerial::writeString(const char* str) throw(PacketExceptionIO*) { /* if(!isclosed) diff --git a/src/OutputSocketClient.cpp b/src/OutputSocketClient.cpp index 8a28cdd8be7663d2c939257912e6da8f95fe53bc..e06b4f22e31166f0a04858cf175ad112e5dc9fb5 100644 --- a/src/OutputSocketClient.cpp +++ b/src/OutputSocketClient.cpp @@ -1,9 +1,9 @@ /*************************************************************************** - OutputSocket.cpp - description + OutputSocketClient.cpp - description ------------------- begin : Mon May 20 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@tesre.bo.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -19,7 +19,7 @@ using namespace PacketLib; -//##ModelId=3DBFBFC001F5 + OutputSocketClient::OutputSocketClient(bool bigendian) : Output(bigendian) { socketclient = 0; @@ -27,7 +27,7 @@ OutputSocketClient::OutputSocketClient(bool bigendian) : Output(bigendian) } -//##ModelId=3DBFBFC00230 + OutputSocketClient::~OutputSocketClient() { delete socketclient; @@ -35,14 +35,12 @@ OutputSocketClient::~OutputSocketClient() } -//##ModelId=3DBFBFC00232 void OutputSocketClient::close() throw(PacketExceptionIO*) { socketclient->close(); } -//##ModelId=3DBFBFC00262 bool OutputSocketClient::open(char** argv) throw(PacketExceptionIO*) { host = argv[0]; @@ -53,7 +51,7 @@ bool OutputSocketClient::open(char** argv) throw(PacketExceptionIO*) } -//##ModelId=3DBFBFC00265 + bool OutputSocketClient::writeByteStream(ByteStream* b) throw(PacketExceptionIO*) { if(!isclosed) @@ -65,7 +63,7 @@ bool OutputSocketClient::writeByteStream(ByteStream* b) throw(PacketExceptionIO* } -//##ModelId=3DBFBFC00268 + bool OutputSocketClient::writeString(const char* str) throw(PacketExceptionIO*) { throw new PacketExceptionIO("Method not implemented"); diff --git a/src/Packet.cpp b/src/Packet.cpp index dd760b3502fca3a404c61d94018fc0c082069adb..db753a440445d24d8c5d9b9c366c75d48c76acb5 100644 --- a/src/Packet.cpp +++ b/src/Packet.cpp @@ -1,10 +1,27 @@ +/*************************************************************************** + Packet.cpp - description + ------------------- + begin : Thu Nov 29 2001 + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software for non commercial purpose * + * and for public research institutes; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License. * + * For commercial purpose see appropriate license terms * + * * + ***************************************************************************/ + #include "Packet.h" #include "Field.h" #include "PacketLibDemo.h" using namespace PacketLib; -//##ModelId=3C0F6C1A0187 + Packet::Packet(bool bigendian) { header = (PacketHeader*) new PacketHeader(); @@ -18,7 +35,7 @@ Packet::Packet(bool bigendian) packet = 0; packet_output = 0; this->bigendian = bigendian; - //temp + /// temp tempHeader = new ByteStream(); tempDataField = new ByteStream(); tempDataFieldHeader = new ByteStream(); @@ -29,7 +46,7 @@ Packet::Packet(bool bigendian) } -//##ModelId=3DA3E5830032 + Packet::~Packet() { PRINTDEBUG("Delete Packet " << name << "-----"); @@ -58,7 +75,7 @@ Packet::~Packet() } -//##ModelId=3C14BA710151 + bool Packet::createPacketType(char* fileName, bool isprefix, word dimprefix) throw (PacketException*) { DEMORET0; @@ -76,24 +93,24 @@ bool Packet::createPacketType(char* fileName, bool isprefix, word dimprefix) thr if(file.open(argv)) { delete[] argv; - //retrieve name of packet header + /// retrieve name of packet header name = file.getLine(); - //find the PacketHeader section + /// find the PacketHeader section line=file.getLine("[PacketHeader]"); if(strlen(line) != 0) { - //delete[] line; + /// delete[] line; PRINTDEBUG("Found [PacketHeader]"); line = file.getLine(); if(header->loadHeader(line)) { - //delete[] line; - //find the DataFieldHeader section + /// delete[] line; + /// find the DataFieldHeader section line=file.getLine("[DataFieldHeader]"); if(strlen(line) != 0) { - //delete[] line; - //section found + /// delete[] line; + /// section found if(dataField->dataFieldHeader->loadFields(file)) { //cout << (dataField->dataFieldHeader->printStructure())->c_str(); @@ -101,8 +118,8 @@ bool Packet::createPacketType(char* fileName, bool isprefix, word dimprefix) thr char *typeOfPacket = 0; if(strcmp(line, "[SourceDataField]") == 0) { - //delete[] line; - //determinazione del tipo di source data field + /// delete[] line; + /// determination of the source data field type char *block = file.getLine(); bool section_found = false; if(strcmp(block, "noblock") == 0) @@ -150,12 +167,12 @@ bool Packet::createPacketType(char* fileName, bool isprefix, word dimprefix) thr line=file.getLastLineRead(); if(strcmp(line, "[Identifiers]") == 0) { - //section found + /// section found if(loadIdentifiers(file)) { line = file.getLastLineRead(); - //Caricamento della sezione tail + /// Loading of the tail section if(strcmp(line, "[Tail]") == 0) { if(!dataField->tail->loadFields(file)) @@ -165,7 +182,7 @@ bool Packet::createPacketType(char* fileName, bool isprefix, word dimprefix) thr } //TODO: chiudere il file anche negli altri casi file.close(); - //allocate memory for output stream + /// Memory allocation for the output stream dword dimpo = getMaxDimension(); dword dimpr = (isprefix?dimprefix:0); packet_output = new ByteStream(dimpo + dimpr, bigendian); @@ -188,7 +205,7 @@ bool Packet::createPacketType(char* fileName, bool isprefix, word dimprefix) thr } else { - //section not found + /// section not found throw new PacketExceptionFileFormat("SourceDataField section not found"); } } @@ -199,7 +216,7 @@ bool Packet::createPacketType(char* fileName, bool isprefix, word dimprefix) thr } else { - //section not found + /// section not found throw new PacketExceptionFileFormat("DataFieldHeader section not found"); } } @@ -231,7 +248,7 @@ bool Packet::createPacketType(char* fileName, bool isprefix, word dimprefix) thr -//##ModelId=3C1877510044 + bool Packet::loadIdentifiers(ConfigurationFile& fp) { @@ -250,7 +267,8 @@ bool Packet::loadIdentifiers(ConfigurationFile& fp) buffer->setbuffer(line); line = fp.getLine(); } - //delete[] line; //AB + ///delete[] line; + //AB number_of_identifier = buffer->getBufferDimension()/3; if(number_of_identifier != 0) { @@ -273,13 +291,13 @@ bool Packet::loadIdentifiers(ConfigurationFile& fp) } -//##ModelId=3C187751008D + void Packet::printIdentifiers() { - // Create constant iterator for list. - //list::iterator iter; - // Iterate through list and output each element. - //for (iter=identifiers.begin(); iter != identifiers.end(); iter++) + /// Create constant iterator for list. + /// list::iterator iter; + /// Iterate through list and output each element. + /// for (iter=identifiers.begin(); iter != identifiers.end(); iter++) for(unsigned i = 0; i< number_of_identifier; i++) { @@ -290,55 +308,54 @@ void Packet::printIdentifiers() } -//##ModelId=3C301E890023 bool Packet::setPacketValue(ByteStream* prefix, ByteStream* packetHeader, ByteStream* packetDataField) { cout << "@ " << packetDataField->getDimension() << endl; memByteStream(prefix, packetHeader, packetDataField); ByteStream* packet = new ByteStream(packetHeader, packetDataField, 0); memByteStream(prefix, packet); - //1) + /// 1) if(!setPacketValueVerify(prefix, packetHeader, packetDataField)) { PRINTERROR("Error in packet value verify"); return false; } - //2) + /// 2) if(!setPacketValuePrefix(prefix)) { PRINTERROR("Error in set packet value prefix"); return false; } - //3) + /// 3) if(!setPacketValueHeader(packetHeader)) { PRINTERROR("Error in set packet value header"); return false; } - //4) + /// 4) if(!setPacketValueDataFieldHeader(packetDataField)) { PRINTERROR("Error in set packet value data field header"); return false; } - //5) + /// 5) if(!setPacketValueSourceDataField(packetDataField)) { PRINTERROR("Error in set packet value source data field"); return false; } - //6) + /// 6) if(!setPacketValueTail(packetDataField)) { PRINTERROR("Error in set packet value tail"); return false; } - //7) fine + /// 7) end return true; } -//##ModelId=3DA3E5890136 + bool Packet::setPacketValue(ByteStream* prefix, ByteStream* packet) { dword dimHeader = header->getDimension(); @@ -349,7 +366,7 @@ bool Packet::setPacketValue(ByteStream* prefix, ByteStream* packet) } -//##ModelId=3DA3E58A0320 + bool Packet::verifyPacketValue(ByteStream* prefix, ByteStream* packet) { dword dimHeader = header->getDimension(); @@ -360,7 +377,7 @@ bool Packet::verifyPacketValue(ByteStream* prefix, ByteStream* packet) } -//##ModelId=3DA3E58C00AA + bool Packet::verifyPacketValue(ByteStream* prefix, ByteStream* packetHeader, ByteStream* packetDataField) { bool verified = true; @@ -390,7 +407,7 @@ bool Packet::verifyPacketValue(ByteStream* prefix, ByteStream* packetHeader, Byt } - // Iterate through list and verify each element. + /// Iterate through list and verify each element. for(unsigned i = 0; i< number_of_identifier; i++) { @@ -422,7 +439,6 @@ bool Packet::verifyPacketValue(ByteStream* prefix, ByteStream* packetHeader, Byt } -//##ModelId=3DA3E58600B4 bool Packet::setAndVerifyPacketValue(ByteStream* prefix, ByteStream* packet) { dword dimHeader = header->getDimension(); @@ -433,7 +449,6 @@ bool Packet::setAndVerifyPacketValue(ByteStream* prefix, ByteStream* packet) } -//##ModelId=3DA3E5840212 bool Packet::setAndVerifyPacketValue(ByteStream* prefix, ByteStream* packetHeader, ByteStream* packetDataField) { memByteStream(prefix, packetHeader, packetDataField); @@ -444,7 +459,7 @@ bool Packet::setAndVerifyPacketValue(ByteStream* prefix, ByteStream* packetHeade PRINTERROR("Error in verify packet value"); return false; } - //se arrivo qui, allora devo settare il resto + // se arrivo qui, allora devo settare il resto if(type_of_identifier[2] == false) { @@ -486,7 +501,7 @@ bool Packet::setAndVerifyPacketValue(ByteStream* prefix, ByteStream* packetHeade } -//##ModelId=3DA3E58E005A + void Packet::printPacketValue() { char** pr; @@ -511,14 +526,13 @@ void Packet::printPacketValue() } -//##ModelId=3DA3E58E024E + dword Packet::getDimension() { return header->getDimension() + dataField->getDimension(); } -//##ModelId=3DA3E58E0398 dword Packet::getMaxDimension() { dword dimh = header->getDimension(); @@ -527,7 +541,6 @@ dword Packet::getMaxDimension() } -//##ModelId=3DA3E590029E void Packet::generateStream() { word dimHeader = header->getDimension(); @@ -546,7 +559,7 @@ void Packet::generateStream() dataField->sourceDataField->set_reset_output_stream(false); } - //PACKET DIMENSIONE MANAGEMENT + /// PACKET DIMENSIONE MANAGEMENT header->setPacketLength(dataField->getDimension()); //Field* f = header->getFieldWithPacketDimension(); //f->value = dataField->getDimension() - 1; @@ -556,21 +569,21 @@ void Packet::generateStream() } -//##ModelId=3DA3E59600DC + bool Packet::setPacketValueVerify(ByteStream* prefix, ByteStream* packetHeader, ByteStream* packetDataField) { - //1) verifiche - //prima verifica: controlli sui puntatori + /// 1) Checking + /// First check: pointers control if(packetHeader == NULL || packetDataField == NULL) return false; - //seconda verifica: controllo sulle dimensioni + /// Second check: dimension control if(header->getDimension() != packetHeader->getDimension()) return false; return true; } -//##ModelId=3DA3E5940352 + bool Packet::setPacketValuePrefix(ByteStream* prefix) { //2) prefix @@ -579,17 +592,16 @@ bool Packet::setPacketValuePrefix(ByteStream* prefix) } -/** No descriptions */ -//##ModelId=3DA3E599012C + bool Packet::setPacketValueDataFieldHeader(ByteStream* packetDataField) { bool b; dword packetLength; - //4) data field header + /// 4) data field header packetLength = dataField->dataFieldHeader->getDimension(); - //si legge e si setta il data field header + /// Reading and setting the data field header b = tempDataFieldHeader->setStream(packetDataField, 0, packetLength-1); - //libera la memoria da b solamente se va male + /// It releases the memory from b only if it goes wrong if(b) { return dataField->dataFieldHeader->setByteStream(tempDataFieldHeader); @@ -599,16 +611,15 @@ bool Packet::setPacketValueDataFieldHeader(ByteStream* packetDataField) } -//##ModelId=3DA3E59A033E bool Packet::setPacketValueSourceDataField(ByteStream* packetDataField) { bool b; dword packetLength; dword packetLength2; - //5) source data field + /// 5) source data field - //se necessario, si setta il numero di blocchi reali presenti + /// If necessary, it sets the number of real blocks present if(dataField->sourceDataField->isBlock()) { dword nrd = dataField->getNumberOfRealDataBlock(); @@ -664,11 +675,11 @@ bool Packet::setPacketValueTail(ByteStream* packetDataField) -//##ModelId=3DA3E59C0172 + bool Packet::setPacketValueHeader(ByteStream* packetHeader) { - //3) header - //si legge e si setta l'header del pacchetto + /// 3) Header + /// Reading and setting the packet header if(!header->setByteStream(packetHeader)) return false; else @@ -676,7 +687,7 @@ bool Packet::setPacketValueHeader(ByteStream* packetHeader) } -//##ModelId=3DA3E5900046 + void Packet::deleteExternalByteStream() { if(prefix != 0) @@ -706,7 +717,7 @@ void Packet::deleteExternalByteStream() } -//##ModelId=3DA3E5A10140 + void Packet::memByteStream(ByteStream* prefix, ByteStream* packet) { this->prefix = prefix; @@ -714,7 +725,7 @@ void Packet::memByteStream(ByteStream* prefix, ByteStream* packet) } -//##ModelId=3DA3E59D038E + void Packet::memByteStream(ByteStream* prefix, ByteStream* packetHeader, ByteStream* packetDataField) { this->prefix = prefix; @@ -724,7 +735,7 @@ void Packet::memByteStream(ByteStream* prefix, ByteStream* packetHeader, ByteStr } -//##ModelId=3DBFBFC003AC + ByteStream* Packet::getOutputStream() { generateStream(); @@ -740,23 +751,19 @@ ByteStream* Packet::getInputStream() } -/** Read property of byte packetID. */ -//##ModelId=3DBFBFC10370 + const byte& Packet::getPacketID() { return packetID; } -/** Write property of byte packetID. */ -//##ModelId=3DBFBFC1006E void Packet::setPacketID( const byte& _newVal) { packetID = _newVal; } -//##ModelId=3DA3E5930280 bool Packet::thereIsPrefix() { return thereisprefix; diff --git a/src/PacketDataField.cpp b/src/PacketDataField.cpp index cc79f8956c520f654050dd1c75dd1ffabf47af1c..48ce7856279f8be619f6739e10c3c324be1a6823 100644 --- a/src/PacketDataField.cpp +++ b/src/PacketDataField.cpp @@ -1,8 +1,25 @@ +/*************************************************************************** + PacketDataField.cpp - description + ------------------- + begin : Thu Nov 29 2001 + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software for non commercial purpose * + * and for public research institutes; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License. * + * For commercial purpose see appropriate license terms * + * * + ***************************************************************************/ + #include "PacketDataField.h" using namespace PacketLib; -//##ModelId=3DA3E5A4033E + PacketDataField::PacketDataField() : PartOfPacket("Packet Data Field") { dataFieldHeader = (DataFieldHeader*) new DataFieldHeader(); @@ -10,7 +27,7 @@ PacketDataField::PacketDataField() : PartOfPacket("Packet Data Field") sourceDataField = 0; }; -//##ModelId=3DA3E5A4037A + PacketDataField::~PacketDataField() { delete dataFieldHeader; @@ -19,7 +36,7 @@ PacketDataField::~PacketDataField() } -//##ModelId=3DA3E5A500D2 + dword PacketDataField::getDimension() { if(sourceDataField != 0) @@ -29,7 +46,7 @@ dword PacketDataField::getDimension() } -//##ModelId=3DA3E5A5010E + dword PacketDataField::getMaxDimension() { if(sourceDataField != 0) @@ -39,11 +56,11 @@ dword PacketDataField::getMaxDimension() } -//##ModelId=3DA3E5A403AC + word PacketDataField::getNumberOfRealDataBlock() { - //nel caso del packet block, deve essere presente un campo in cui �indicato - //il numero di blocchi presenti, solo se numero di blocchi fissi = false + /// For the packet block case, a field must be present to indicate the number + /// of present blocks, if the number of fixed blocks = false if(sourceDataField->isBlock()) { if(!sourceDataField->isNumberOfBlockFixed()) @@ -54,7 +71,7 @@ word PacketDataField::getNumberOfRealDataBlock() } else { - //se numero di blocchi fissi �true, allora si prende il max + /// If the number of fixed blocks is true, it gets the max value return sourceDataField->getMaxNumberOfBlock(); } } @@ -63,7 +80,7 @@ word PacketDataField::getNumberOfRealDataBlock() } -//##ModelId=3DA3E5A50000 + void PacketDataField::setNumberOfRealDataBlock(word number) { if(number > sourceDataField->getMaxNumberOfBlock()) @@ -80,7 +97,7 @@ void PacketDataField::setNumberOfRealDataBlock(word number) } -//##ModelId=3DA3E5A5017C + bool PacketDataField::setOutputStream(ByteStream* os, word first) { delete outputstream; @@ -97,7 +114,7 @@ bool PacketDataField::setOutputStream(ByteStream* os, word first) } -//##ModelId=3DA3E5A60028 + ByteStream* PacketDataField::generateStream(bool bigendian) { dataFieldHeader->generateStream(bigendian); diff --git a/src/PacketException.cpp b/src/PacketException.cpp index a59b53f11f7a67af4c6bade562a6e6c9db4d2499..a25da934cecddc8918e6fa13eb76175cee9b1ca9 100644 --- a/src/PacketException.cpp +++ b/src/PacketException.cpp @@ -2,8 +2,8 @@ PacketException.cpp - description ------------------- begin : Tue Jan 15 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@tesre.bo.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -19,7 +19,7 @@ using namespace PacketLib; -//##ModelId=3AA649E10191 + PacketException::PacketException(const char* error, int code) { this->error = new string(error); @@ -27,23 +27,21 @@ PacketException::PacketException(const char* error, int code) } -//##ModelId=3AA649E1019B + PacketException::~PacketException() { delete error; } -/** Read property of char* error. */ -//##ModelId=3AA649E1019D +/// Read property of char* error. const char* PacketException::geterror() { return error->c_str(); } -/** No descriptions */ -//##ModelId=3AA649E1019F + void PacketException::add(const char* err) { *error = err + *error; @@ -55,7 +53,7 @@ int PacketException::geterrorcode() const } -//##ModelId=3DEE784300CF + void PacketException::seterrorcode(int errorcode) { this->errorcode = errorcode; diff --git a/src/PacketExceptionFileFormat.cpp b/src/PacketExceptionFileFormat.cpp index 6739bda1db4c22f276ae59e8fe55f9e47a855448..8fa7a5ca17dad738ad300404fb38acd78ac7c239 100644 --- a/src/PacketExceptionFileFormat.cpp +++ b/src/PacketExceptionFileFormat.cpp @@ -2,8 +2,8 @@ PacketExceptionFileFormat.cpp - description ------------------- begin : Tue Jan 15 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@tesre.bo.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -19,13 +19,13 @@ using namespace PacketLib; -//##ModelId=3AA649E50210 + PacketExceptionFileFormat::PacketExceptionFileFormat(const char* error) : PacketException(error) { } -//##ModelId=3AA649E50219 + PacketExceptionFileFormat::~PacketExceptionFileFormat() { diff --git a/src/PacketExceptionIO.cpp b/src/PacketExceptionIO.cpp index 945930c1c7e29a1d28608be4f2e9d41e5a1a6281..45bfe63c73cb098e0a424a67a5edfe50564e6641 100644 --- a/src/PacketExceptionIO.cpp +++ b/src/PacketExceptionIO.cpp @@ -2,8 +2,8 @@ PacketExceptionIO.cpp - description ------------------- begin : Tue Jan 15 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@tesre.bo.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -19,14 +19,14 @@ using namespace PacketLib; -//##ModelId=3AA649E902A2 + PacketExceptionIO::PacketExceptionIO(const char* error) : PacketException(error) { } -//##ModelId=3AA649E902AC + PacketExceptionIO::~PacketExceptionIO() { diff --git a/src/PacketHeader.cpp b/src/PacketHeader.cpp index 50b94a3f2820b7aedc3be88329d4685af66384cd..e74ccc642893ed786c2d6ee42d8a74d329fcf37a 100644 --- a/src/PacketHeader.cpp +++ b/src/PacketHeader.cpp @@ -1,24 +1,41 @@ +/*************************************************************************** + PacketHeader.cpp - description + ------------------- + begin : Thu Nov 29 2001 + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software for non commercial purpose * + * and for public research institutes; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License. * + * For commercial purpose see appropriate license terms * + * * + ***************************************************************************/ + #include "PacketHeader.h" #include "ConfigurationFile.h" using namespace PacketLib; -//##ModelId=3DA3E5A701D6 + PacketHeader::PacketHeader() : PartOfPacket("Packet Header") { name = 0; dimensionOfPacketLenght = 16; } -//##ModelId=3DA3E5A7012C + PacketHeader::~PacketHeader() { delete[] name; } -//##ModelId=3C14980F00F2 + bool PacketHeader::loadHeader(char* fileName) throw(PacketException*) { ConfigurationFile header; @@ -28,12 +45,12 @@ bool PacketHeader::loadHeader(char* fileName) throw(PacketException*) { delete[] argv; char* line = header.getLine(); - //retrieve name of packet header + /// retrieve name of packet header name = line; line = header.getLine(); numberOfFieldWithPacketDimension = atoi(line); - //delete[] line; + /// delete[] line; line = header.getLine(); if(strcmp(line, "[Field]") == 0) @@ -46,9 +63,9 @@ bool PacketHeader::loadHeader(char* fileName) throw(PacketException*) header.setpos(0); - //find the start position of the fields + /// find the start position of the fields line = header.getLine("[Field]"); - //delete[] line; + /// delete[] line; if(loadFields(header)) { @@ -67,13 +84,13 @@ bool PacketHeader::loadHeader(char* fileName) throw(PacketException*) } -//##ModelId=3C15ED930064 + dword PacketHeader::getPacketLength() { if(dimensionOfPacketLenght == 16) { Field* f = getFields(numberOfFieldWithPacketDimension); - //standard ESA Nel packet lenght bisogna aggiungere 1 + /// ESA standard: in the packet length the value 1 must be added return f->value + 1; } else @@ -87,7 +104,7 @@ void PacketHeader::setPacketLength(dword dim) if(dimensionOfPacketLenght == 16) { Field* f = getFields(numberOfFieldWithPacketDimension); - //standard ESA Nel packet lenght bisogna aggiungere 1 + /// ESA standard: in the packet length the value 1 must be added f->value = (word) dim-1; } else @@ -97,7 +114,6 @@ void PacketHeader::setPacketLength(dword dim) } -//##ModelId=3DA3E5A70208 Field * PacketHeader::getFieldWithPacketDimension() { return getFields(numberOfFieldWithPacketDimension); diff --git a/src/PacketIdentifier.cpp b/src/PacketIdentifier.cpp index 80916e8ef9865471506881cd7b58c4c85a99bef3..7e5b09295616a420e3fc956b3835081d704d261b 100644 --- a/src/PacketIdentifier.cpp +++ b/src/PacketIdentifier.cpp @@ -1,8 +1,24 @@ +/*************************************************************************** + PacketIdentifier.cpp - description + ------------------- + begin : Thu Nov 29 2001 + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software for non commercial purpose * + * and for public research institutes; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License. * + * For commercial purpose see appropriate license terms * + * * + ***************************************************************************/ #include "PacketIdentifier.h" using namespace PacketLib; -//##ModelId=3C18775100C8 + PacketIdentifier::PacketIdentifier(int fn, byte t, word v) { fieldNumber = fn; @@ -11,7 +27,7 @@ PacketIdentifier::PacketIdentifier(int fn, byte t, word v) } -//##ModelId=3DA3E5A800F0 + PacketIdentifier::~PacketIdentifier() { // cout << "Delete identifier" << endl; diff --git a/src/PacketNotRecognized.cpp b/src/PacketNotRecognized.cpp index fbfd3a470e7a4b0db397b995032d4116aa4afcc7..69edb79da5b3eb9cd713e4b55d2a75886386c016 100644 --- a/src/PacketNotRecognized.cpp +++ b/src/PacketNotRecognized.cpp @@ -2,8 +2,8 @@ PacketNotRecognized.cpp - description ------------------- begin : Mon Jan 21 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@tesre.bo.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -20,7 +20,7 @@ using namespace PacketLib; -//##ModelId=3AA64A03005D + bool PacketNotRecognized::createPacketType(char* fileName, bool prefix, word dimprefix) throw (PacketException*) { if(header->loadHeader(fileName)) @@ -58,24 +58,23 @@ bool PacketNotRecognized::createPacketType(char* fileName, bool prefix, word dim } -//##ModelId=3AA64A03005A + PacketNotRecognized::PacketNotRecognized(bool bigendian) : Packet(bigendian) { dataField->sourceDataField = 0; } -//##ModelId=3AA64A03005B PacketNotRecognized::~PacketNotRecognized() { // cout << "PacketNotRecognized deleted" << endl; } -//##ModelId=3AA64A030065 + bool PacketNotRecognized::setPacketValue(ByteStream* prefix, ByteStream* packetHeader, ByteStream* packetDataField) { - //si legge e si setta l'header del pacchetto + /// It reads and sets the packet header if(!header->setByteStream(packetHeader)) return false; diff --git a/src/PacketStream.cpp b/src/PacketStream.cpp index 688a48df85d68b70d783ce42b8bebf874640456e..4ab921f5e23bc6c6413a60d9e1febd18144f95ba 100644 --- a/src/PacketStream.cpp +++ b/src/PacketStream.cpp @@ -1,3 +1,20 @@ +/*************************************************************************** + PacketStream.cpp - description + ------------------- + begin : Thu Nov 29 2001 + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software for non commercial purpose * + * and for public research institutes; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License. * + * For commercial purpose see appropriate license terms * + * * + ***************************************************************************/ + #include "PacketStream.h" #include "ConfigurationFile.h" #include "PacketExceptionFileFormat.h" @@ -10,7 +27,7 @@ using namespace PacketLib; -//##ModelId=3DA3E5A90226 + PacketStream::PacketStream(const char* fileNameConfig) { this->filenameConfig = (char*) fileNameConfig; @@ -24,7 +41,7 @@ PacketStream::PacketStream(const char* fileNameConfig) } -//##ModelId=3DA3E5AA0064 + PacketStream::PacketStream() { this->filenameConfig = 0; @@ -38,7 +55,7 @@ PacketStream::PacketStream() } -//##ModelId=3DA3E5AA00A0 + PacketStream::~PacketStream() { for(int i=0; i< numberOfPacketType; i++) @@ -49,7 +66,7 @@ PacketStream::~PacketStream() } -//##ModelId=3DA3E5AA01EA + bool PacketStream::createStreamStructure() throw(PacketException*) { DEMORET0; @@ -65,7 +82,7 @@ bool PacketStream::createStreamStructure() throw(PacketException*) delete[] argv; if(pathFileNameConfig) free(pathFileNameConfig); pathFileNameConfig = getcwd(NULL, 512L); - //prefix + /// prefix line = config.getLine(); if(strcmp(line, "[Configuration]") == 0) { @@ -85,7 +102,7 @@ bool PacketStream::createStreamStructure() throw(PacketException*) } } delete[] line; - //bigendian + /// bigendian line = config.getLine(); if(strcmp(line, "false") == 0) bigendian = false; @@ -99,20 +116,20 @@ bool PacketStream::createStreamStructure() throw(PacketException*) return false; } } - //dimensione of prefix + /// dimensione of prefix delete[] line; line = config.getLine(); dimPrefix = atoi(line); } else throw new PacketExceptionFileFormat("No [Configuration] section found."); - //[Header Format] section + /// [Header Format] section delete[] line; line = config.getLine(); if(strcmp(line, "[Header Format]") == 0) { delete[] line; - // Create headerReference of PacketHeader type. The method reads the structure of header from configuration file (named in filenameConfig) + /// Create headerReference of PacketHeader type. The method reads the structure of header from configuration file (named in filenameConfig) line = config.getLine(); delete headerReference; headerReference = (PacketHeader*) new PacketHeader(); @@ -122,7 +139,7 @@ bool PacketStream::createStreamStructure() throw(PacketException*) throw new PacketExceptionFileFormat("No parameters in file header format"); return false; } - //crea il PACKET NOT RECOGNIZED + /// It creates the PACKET NOT RECOGNIZED PacketNotRecognized* p = new PacketNotRecognized(bigendian); if(!p->createPacketType(line, prefix, dimPrefix)) { @@ -141,7 +158,7 @@ bool PacketStream::createStreamStructure() throw(PacketException*) throw new PacketExceptionFileFormat("No [Header format] section"); return false; } - //[Packet Format] + /// [Packet Format] line = config.getLine(); if(strcmp(line, "[Packet Format]") == 0) { @@ -186,8 +203,6 @@ bool PacketStream::createStreamStructure() throw(PacketException*) } } - -//##ModelId=3DBFBFC30050 word PacketStream::getPrefixDimension() const { if(prefix) @@ -197,7 +212,6 @@ word PacketStream::getPrefixDimension() const } -//##ModelId=3DBFBFC300BE word PacketStream::getHeaderDimension() const { if(headerReference != 0) @@ -207,28 +221,25 @@ word PacketStream::getHeaderDimension() const } -//##ModelId=3DA3E5AB0172 word PacketStream::getNumberOfPacketType() { return numberOfPacketType; } -//##ModelId=3DA3E5AA0258 Packet* PacketStream::getPacketType(int index) { return packetType[index]; } -//##ModelId=3DA3E5AB0096 + bool PacketStream::isBigEndian() { return (bool) this->bigendian; } -//##ModelId=3DA3E5AA00D2 void PacketStream::setFileNameConfig(const char* f) { this->filenameConfig = (char*) f; @@ -236,7 +247,6 @@ void PacketStream::setFileNameConfig(const char* f) } -//##ModelId=3DA3E5AB0104 bool PacketStream::thereIsPrefix() { return prefix; diff --git a/src/PartOfPacket.cpp b/src/PartOfPacket.cpp index d69d5255f2ca31aab7b00cc9169656ffc16dc615..323bb695e911d043e08258c47548b02f2078ac0d 100644 --- a/src/PartOfPacket.cpp +++ b/src/PartOfPacket.cpp @@ -2,8 +2,8 @@ PartOfPacket.cpp - description ------------------- begin : Thu Dec 6 2001 - copyright : (C) 2001 by Andrea Bulgarelli - email : bulgarelli@tesre.bo.cnr.it + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -21,7 +21,7 @@ using namespace PacketLib; word PacketLib::pattern[] = {0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535}; -//##ModelId=3C0F6C1A0223 + PartOfPacket::PartOfPacket(const char* popName) { fieldsDimension = 0; @@ -33,13 +33,12 @@ PartOfPacket::PartOfPacket(const char* popName) } -//##ModelId=3C35860301F9 PartOfPacket::~PartOfPacket() { deleteFields(); - //delete stream; - //Don't deletes the extern ByteStream. The responsibility of this isn't of Packet class; - //But deletes the internal ByteStream + /// delete stream; + /// Don't deletes the extern ByteStream. The responsibility of this isn't of Packet class; + /// But deletes the internal ByteStream // if(stream !=0) AB27Aug2005 // if(!stream->getMemAllocation()) { // delete stream; stream = 0; @@ -47,7 +46,7 @@ PartOfPacket::~PartOfPacket() } -//##ModelId=3CAEAC8B0280 + string* PartOfPacket::printStructure() { bool first = true; @@ -86,10 +85,10 @@ bool PartOfPacket::loadFields(InputText& fp) throw(PacketException*) bool PartOfPacket::loadFields(InputText& fp) throw(PacketException*) { char* name, *dimension, *value; - //chiama la funzione che libera la memoria + /// It calls the function that releases the memory deleteFields(); int count = 0; - //count the number of fields + /// count the number of fields long pos = fp.getpos(); count++; while(strlen(name) != 0) @@ -121,7 +120,7 @@ bool PartOfPacket::loadFields(InputText& fp) throw(PacketException*) fields[numberOfFields] = f; numberOfFields++; name = fp.getLine(); - //legge fino a quando non finisce il buffer + /// It reads until the buffer ends if(name[0] == '[') { break; @@ -131,7 +130,7 @@ bool PartOfPacket::loadFields(InputText& fp) throw(PacketException*) } -//##ModelId=3DA3E5AD0046 + bool PartOfPacket::loadFields(MemoryBuffer* buffer) throw(PacketException*) { char* name; @@ -139,13 +138,13 @@ bool PartOfPacket::loadFields(MemoryBuffer* buffer) throw(PacketException*) char* value; int count = 0; - //chiama la funzione che libera la memoria + /// It calls the function to release the memory deleteFields(); count = buffer->getBufferDimension(); - //si alloca la memoria per i fields + /// It allocates the field memory fields = new Field* [count/3]; - //inizio creazione packet + /// Begin of the packet creation name = buffer->getbuffer(); if(name == 0) { @@ -160,7 +159,7 @@ bool PartOfPacket::loadFields(MemoryBuffer* buffer) throw(PacketException*) fields[numberOfFields] = f; numberOfFields++; name = buffer->getbuffer(); - //legge fino a quando non finisce il buffer + /// It reads until the buffer ends if(name == 0) { return true; @@ -171,7 +170,6 @@ bool PartOfPacket::loadFields(MemoryBuffer* buffer) throw(PacketException*) -//##ModelId=3DA3E5AF0064 MemoryBuffer* PartOfPacket::loadFieldsInBuffer(InputText & fp) { char* name, *dimension, *value; @@ -194,7 +192,7 @@ MemoryBuffer* PartOfPacket::loadFieldsInBuffer(InputText & fp) buffer->setbuffer(value); count++; name = fp.getLine(); - //legge fino a quando non incontra [ + /// It reads until it reaches [ if(name[0] == '[') { //delete[] name; @@ -204,12 +202,12 @@ MemoryBuffer* PartOfPacket::loadFieldsInBuffer(InputText & fp) return buffer; } -//##ModelId=3C18AB2E037F + bool PartOfPacket::setByteStream(ByteStream* s) { Field* ftemp; - //se e' stato passato un NULL si esce + /// If NULL is passed it exits if(s == NULL) return true; if(getDimension() > s->getDimension()) @@ -219,28 +217,28 @@ bool PartOfPacket::setByteStream(ByteStream* s) if(!s->getMemAllocation()) stream->setStream(s->stream, s->getDimension(), s->isBigendian()); - //si assegna lo stream all'header + /// The stream is assigned to the header this->stream = s; - //converto il puntatore a byte in un puntatore a void. La lettura da file ha gia' - //garantito la corretta interpretazione dei dati per macchine big o little endian + /// The pointer is converted from byte to void. The reading from file allows the correct data interpretation + /// for big or little endian machines byte* stream = (byte*) s->stream; - //indica la posizione all'interno della word: + /// It indicates the position inside the word: byte posbit = 0; - //indica la word da analizzare nello stream: + /// It indicates the word to be analyzed inside the stream word posword = 0; - //dimensione del field corrente + /// Dimension nof the current field byte dimbit = 0; - //number of shift for elaboration + /// number of shift for elaboration short numberOfShift = 0; - //number of fields + /// number of fields //unsigned nof = getNumberOfFields(); word nof = numberOfFields; for(word i=0; igetDimension(); - //word temporanea da modificare per le elaborazioni + /// Temporary word to be modified for the elaboration byte bh = *(stream + posword); byte bl = *(stream + posword + 1); //word wordtemp = *(stream + posword); @@ -251,7 +249,8 @@ bool PartOfPacket::setByteStream(ByteStream* s) wordtemp = bl * 256 + bh; numberOfShift = 16 - (posbit + dimbit); //parte nuova - if(numberOfShift < 0) //NB: se non si verifica mai questa condizione, il codice è assolutamente uguale al pre PacketLib 1.3.3 + /// \remarks if the condition is not fulfilled, the code is equal to the versions older than PacketLib 1.3.3 + if(numberOfShift < 0) { short currentDimBit = dimbit + numberOfShift; dimbit = abs(numberOfShift); @@ -280,7 +279,7 @@ bool PartOfPacket::setByteStream(ByteStream* s) wordtemp = wordtemp >> numberOfShift; ftemp->value = wordtemp & pattern[dimbit]; } - //aggiornamento pobit e posword + /// Upgrade of pobit and posword posbit += dimbit; if(posbit >=16) { @@ -292,7 +291,7 @@ bool PartOfPacket::setByteStream(ByteStream* s) } -//##ModelId=3CAEAC8B02FD + char** PartOfPacket::printValue(const char* addString) { //bool first = true; @@ -308,7 +307,7 @@ char** PartOfPacket::printValue(const char* addString) // Create constant iterator for list. //list::iterator iter; - // Iterate through list and output each element. + /// Iterate through list and output each element. index = 0; //for (iter=fields.begin(); iter != fields.end(); iter++) for(unsigned i=0; i> 23); //get the sign + /// get the sign + unsigned long sign = (us.u >> 23); unsigned long wh = us.u & 0x007FFFFF; - //get a long 32 bit + /// get a long 32 bit if(sign == 1) us.u = 0x7F800000 + wh + (sign << 31); else @@ -563,7 +566,8 @@ void PartOfPacket::setFieldValue_4_13(word index, signed long value) throw(Packe { union u_tag { - unsigned long u; //32 bit + /// 32 bit + unsigned long u; signed long s; } us; if(value > U24BITINTGEGERSIGNED_MAX) @@ -572,7 +576,8 @@ void PartOfPacket::setFieldValue_4_13(word index, signed long value) throw(Packe throw new PacketException("setFieldValue_4_13(): the min value of 24 bit signed integer should be -8388607"); us.s = value; unsigned long sign = (us.u >> 31); - unsigned long wh = us.u & 0x007FFFFF; //23 bit + /// 23 bit + unsigned long wh = us.u & 0x007FFFFF; unsigned long value2 = 0; value2 = wh + (sign << 23); setFieldValue_3_14(index, value2); diff --git a/src/SDFBFBlock.cpp b/src/SDFBFBlock.cpp index ceea4df5889cbc1557cd5632be2755ecc5b53be2..c2985f13a54fbd16caa7ce62934ae8000c071d45 100644 --- a/src/SDFBFBlock.cpp +++ b/src/SDFBFBlock.cpp @@ -1,3 +1,19 @@ +/*************************************************************************** + SDFBFBlock.cpp - description + ------------------- + begin : Thu Dec 6 2001 + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software for non commercial purpose * + * and for public research institutes; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License. * + * For commercial purpose see appropriate license terms * + * * + ***************************************************************************/ #include "SDFBFBlock.h" using namespace PacketLib; diff --git a/src/SDFBVBlock.cpp b/src/SDFBVBlock.cpp index 778a59e51e387db2664f445a6e9617c0c4946893..1a2389ff2b463bbcc12fe49d32f6f3e7a76f40e9 100644 --- a/src/SDFBVBlock.cpp +++ b/src/SDFBVBlock.cpp @@ -1,8 +1,25 @@ +/*************************************************************************** + SDFBVBlock.cpp - description + ------------------- + begin : Thu Nov 29 2001 + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software for non commercial purpose * + * and for public research institutes; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License. * + * For commercial purpose see appropriate license terms * + * * + ***************************************************************************/ + #include "SDFBVBlock.h" using namespace PacketLib; -//##ModelId=3C9AED6B007E + Field* SDFBVBlock::getFields(word index) { word n1 = fixed.getNumberOfFields(); @@ -23,14 +40,13 @@ void SDFBVBlock::setFieldValue(word index, word value) f->value = (value & pattern[f->getDimension()]); } -//##ModelId=3DA3E5BF0352 + word SDFBVBlock::getFieldValue(word index) { return getFields(index)->value; } -//##ModelId=3C9AED6B000F word SDFBVBlock::getNumberOfFields() { word nfv = 0; @@ -53,7 +69,7 @@ dword SDFBVBlock::getDimension() } -//##ModelId=3DA3E5C00046 + dword SDFBVBlock::getMaxDimension() { dword nfv = 0; @@ -66,7 +82,7 @@ dword SDFBVBlock::getMaxDimension() } -//##ModelId=3DA3E5C00082 + bool SDFBVBlock::setOutputStream(ByteStream* os, dword first) { fixed.setOutputStream(os, first); @@ -81,7 +97,7 @@ bool SDFBVBlock::setOutputStream(ByteStream* os, dword first) } -//##ModelId=3DA3E5C0026C + ByteStream* SDFBVBlock::generateStream(bool bigendian) { fixed.generateStream(bigendian); diff --git a/src/SDFBVBlockFixed.cpp b/src/SDFBVBlockFixed.cpp index 400400311adf3d0fe80abe1db7bc944a7ac6fa38..4f515c00fd4eff5655dff32ed58c43107275f035 100644 --- a/src/SDFBVBlockFixed.cpp +++ b/src/SDFBVBlockFixed.cpp @@ -1,8 +1,25 @@ +/*************************************************************************** + SDFBVBlockFixed.cpp - description + ------------------- + begin : Thu Nov 29 2001 + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software for non commercial purpose * + * and for public research institutes; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License. * + * For commercial purpose see appropriate license terms * + * * + ***************************************************************************/ + #include "SDFBVBlockFixed.h" using namespace PacketLib; -//##ModelId=3C9AEDA50372 + word SDFBVBlockFixed::getNumberOfRealElement() { Field* f = getFields(indexOfNElement); @@ -10,7 +27,7 @@ word SDFBVBlockFixed::getNumberOfRealElement() } -//##ModelId=3DA3E5C100AA + void SDFBVBlockFixed::setNumberOfRealElement(word value) { Field* f = getFields(indexOfNElement); @@ -18,29 +35,28 @@ void SDFBVBlockFixed::setNumberOfRealElement(word value) } -/** No descriptions */ -//##ModelId=3C9AEDA60002 + void SDFBVBlockFixed::setIndexOfNElement(word index) { indexOfNElement = index; } -//##ModelId=3C9AEDA601CA + void SDFBVBlockFixed::setAddToNElement(unsigned num) { addToNElement = num; } -//##ModelId=3DA3E5C101C2 + void SDFBVBlockFixed::setMaxNumberOfElement(word num) { maxNumberOfElement = num; } -//##ModelId=3DA3E5C102D0 + word SDFBVBlockFixed::getMaxNumberOfElement() const { return maxNumberOfElement; diff --git a/src/SDFBVBlockVariable.cpp b/src/SDFBVBlockVariable.cpp index 30ecfe8c7a8435fd0e3c31c46d983472d9f39adc..c8c2bc1e1c27dbfb35fb2974a9a3dfe992009cc6 100644 --- a/src/SDFBVBlockVariable.cpp +++ b/src/SDFBVBlockVariable.cpp @@ -1,3 +1,20 @@ +/*************************************************************************** + SDFBVBlockVariable.cpp - description + ------------------- + begin : Thu Nov 29 2001 + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software for non commercial purpose * + * and for public research institutes; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License. * + * For commercial purpose see appropriate license terms * + * * + ***************************************************************************/ + #include "SDFBVBlockVariable.h" using namespace PacketLib; diff --git a/src/SDFBlockFixed.cpp b/src/SDFBlockFixed.cpp index ed63b599b663f0a51b411b35efb0bc8ae2f58d91..c7735d4bc4ddfa4c6b24ba5c3270a2fb435173b6 100644 --- a/src/SDFBlockFixed.cpp +++ b/src/SDFBlockFixed.cpp @@ -1,3 +1,19 @@ +/*************************************************************************** + SDFBlockFixed.cpp - description + ------------------- + begin : Thu Nov 29 2001 + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software for non commercial purpose * + * and for public research institutes; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License. * + * For commercial purpose see appropriate license terms * + * * + ***************************************************************************/ #include "SDFBlockFixed.h" #include "ByteStream.h" #include "Field.h" @@ -6,7 +22,7 @@ using namespace PacketLib; -//##ModelId=3C3576890122 + bool SDFBlockFixed::loadFields(InputText& fp) throw(PacketException*) { char* line; @@ -38,7 +54,7 @@ bool SDFBlockFixed::loadFields(InputText& fp) throw(PacketException*) block = (SDFBFBlock*) new SDFBFBlock[maxNumberOfBlock[0]]; - //find the [SourceDataFieldBlock] section + /// find the [SourceDataFieldBlock] section if(strlen(line=fp.getLine("[SourceDataFieldBlock]")) != 0) { PRINTDEBUG("Found [SourceDataFieldBlock]"); @@ -64,7 +80,7 @@ bool SDFBlockFixed::loadFields(InputText& fp) throw(PacketException*) } -//##ModelId=3C357B5F035D + SDFBlockFixed::SDFBlockFixed() : SourceDataField("SDF Block Fixed") { isblock = true; @@ -76,7 +92,7 @@ SDFBlockFixed::SDFBlockFixed() : SourceDataField("SDF Block Fixed") } -//##ModelId=3C357B64026E + SDFBlockFixed::~SDFBlockFixed() { delete tempBlock; @@ -88,7 +104,6 @@ SDFBlockFixed::~SDFBlockFixed() } -//##ModelId=3A54BDDC011D Field* SDFBlockFixed::getFields(word index) { word nblock = getNumberOfRealDataBlock(); @@ -105,7 +120,7 @@ Field* SDFBlockFixed::getFields(word index) } -//##ModelId=3DA3E5C701AE + Field* SDFBlockFixed::getFields(word nblock, word index) { if(nblock < numberOfRealDataBlock[0] && index < block[nblock].getNumberOfFields()) @@ -115,7 +130,7 @@ Field* SDFBlockFixed::getFields(word nblock, word index) } -//##ModelId=3DA3E5C9012C + word SDFBlockFixed::getFieldValue(word index) { Field* f = getFields(index); @@ -126,7 +141,7 @@ word SDFBlockFixed::getFieldValue(word index) } -//##ModelId=3DA3E5CA029E + word SDFBlockFixed::getFieldValue(word block, word index) { Field* f = getFields(block, index); @@ -137,7 +152,7 @@ word SDFBlockFixed::getFieldValue(word block, word index) } -//##ModelId=3DA3E5CC02F8 + void SDFBlockFixed::setFieldValue(word index, word value) { Field* f = getFields(index); @@ -146,7 +161,6 @@ void SDFBlockFixed::setFieldValue(word index, word value) } -//##ModelId=3DA3E5CE0384 void SDFBlockFixed::setFieldValue(word block, word index, word value) { Field* f = getFields(block, index); @@ -155,7 +169,6 @@ void SDFBlockFixed::setFieldValue(word block, word index, word value) } -//##ModelId=3A54BDDC0142 word SDFBlockFixed::getNumberOfFields() { word n_block = getNumberOfRealDataBlock(); @@ -164,14 +177,13 @@ word SDFBlockFixed::getNumberOfFields() -//##ModelId=3A54BDDC0166 bool SDFBlockFixed::setByteStream(ByteStream* s) { bool b; word bytestart=0, bytestop=0; stream = s; word n_block = getNumberOfRealDataBlock(); - //controllo sulla dimensione massima dei blocchi + /// It controls the blocks maximum dimension word n_block_max = getMaxNumberOfBlock(); if(n_block > n_block_max) { @@ -199,7 +211,7 @@ bool SDFBlockFixed::setByteStream(ByteStream* s) } -//##ModelId=3DA3E5C203A2 + char** SDFBlockFixed::printValue(char* addString) { char **c; // = new char[1]; @@ -234,7 +246,6 @@ char** SDFBlockFixed::printValue(char* addString) } -//##ModelId=3A54BDDC01AF dword SDFBlockFixed::getDimension() { dword dimOfEventBlock; //Dimensione di ogni event @@ -244,7 +255,6 @@ dword SDFBlockFixed::getDimension() } -//##ModelId=3DA3E5C30398 dword SDFBlockFixed::getDimension(word nblock) { if(nblock < numberOfRealDataBlock[0]) @@ -254,10 +264,11 @@ dword SDFBlockFixed::getDimension(word nblock) } -//##ModelId=3DA3E5C4038E + dword SDFBlockFixed::getMaxDimension() { - dword dimOfEventBlock; //Dimensione di ogni event + /// Event dimension + dword dimOfEventBlock; if(block != NULL) dimOfEventBlock = block[0].getDimension(); else @@ -268,7 +279,7 @@ dword SDFBlockFixed::getMaxDimension() } -//##ModelId=3DA3E5C5023A + dword SDFBlockFixed::getMaxDimension(word nblock) { if(nblock < numberOfRealDataBlock[0]) @@ -278,14 +289,13 @@ dword SDFBlockFixed::getMaxDimension(word nblock) } -//##ModelId=3DA3E5C602D0 + string* SDFBlockFixed::printStructure() { return new string("string* SDFBlockFixed::printStructure() - TODO"); } -//##ModelId=3DA3E5D10366 bool SDFBlockFixed::setOutputStream(ByteStream* os, dword first) { dword mnb = getNumberOfRealDataBlock(); @@ -301,7 +311,6 @@ bool SDFBlockFixed::setOutputStream(ByteStream* os, dword first) } -//##ModelId=3DA3E5D400E6 ByteStream* SDFBlockFixed::generateStream(bool bigendian) { word mnb = getNumberOfRealDataBlock(); @@ -313,7 +322,6 @@ ByteStream* SDFBlockFixed::generateStream(bool bigendian) } -//##ModelId=3DA3E5D60028 word SDFBlockFixed::getNumberOfFields(word nblock) { if(nblock < numberOfRealDataBlock[0]) diff --git a/src/SDFBlockVariable.cpp b/src/SDFBlockVariable.cpp index fb0f5c2fb8ba0ae585b5aaee7c76dc5fdc99b12b..e89c979c492c0b32e92c419747acbe8ed528ab02 100644 --- a/src/SDFBlockVariable.cpp +++ b/src/SDFBlockVariable.cpp @@ -1,3 +1,20 @@ +/*************************************************************************** + SDFBlockVariable.cpp - description + ------------------- + begin : Thu Nov 29 2001 + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software for non commercial purpose * + * and for public research institutes; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License. * + * For commercial purpose see appropriate license terms * + * * + ***************************************************************************/ + #include "SDFBlockVariable.h" #include "ByteStream.h" #include "Field.h" @@ -7,7 +24,7 @@ using namespace PacketLib; -//##ModelId=3C3576980390 + bool SDFBlockVariable::loadFields(InputText& fp) throw(PacketException*) { try @@ -26,7 +43,7 @@ bool SDFBlockVariable::loadFields(InputText& fp) throw(PacketException*) numberOfBlockFixed[0] = false; //delete line; - //numero massimo di blocchi presenti + /// Maximum number of present blocks line = fp.getLine(); maxNumberOfBlock[0] = atoi(line); //delete line; @@ -34,19 +51,19 @@ bool SDFBlockVariable::loadFields(InputText& fp) throw(PacketException*) if(numberOfBlockFixed[0]) numberOfRealDataBlock[0] = maxNumberOfBlock[0]; - //indice del fields che contiene il numero di blocchi presenti + /// Field index containing the number of present blocks line = fp.getLine(); indexOfNBlock[0] = atoi(line); //delete line; - //valore da sottrarre al valore nel field dell'indice precedente per ottenere il numero reale di blocchi + /// Value to be subtracted to the field value in the previous index to get the real number of blocks line = fp.getLine(); subFromNBlock[0] = atoi(line); //delete line; blocks = (SDFBVBlock*) new SDFBVBlock[maxNumberOfBlock[0]]; - //find the [SourceDataFieldBlock] section + /// find the [SourceDataFieldBlock] section if(strlen(line=fp.getLine("[SourceDataFieldBlockFixed]")) != 0) { if(first1) @@ -58,19 +75,19 @@ bool SDFBlockVariable::loadFields(InputText& fp) throw(PacketException*) //fp.memBookmarkPos(); for(int i=0; igetbuffer(); maxNumberOfElement = atoi(line); // delete line; - //index of field in the [SourceDataFieldBlockFixed] section wich rappresent the number of element (the number of bar) of the block + /// index of field in the [SourceDataFieldBlockFixed] section wich rappresent the number of element (the number of bar) of the block // line = fp.getLine(); line = buffer1->getbuffer(); indexOfNElement = atoi(line); //delete line; - //numero da sommare per ottenere il numero di elements reale + /// Number to sum to get the real number of elements //line = fp.getLine(); line = buffer1->getbuffer(); addToNElements = atoi(line); @@ -90,7 +107,7 @@ bool SDFBlockVariable::loadFields(InputText& fp) throw(PacketException*) if(strcmp(linesection, "[SourceDataFieldBlockVariable]") == 0) { // delete line; - //alloca lo spazio necessario + /// It allocates the required space blocks[i].variables = (SDFBVBlockVariable*) new SDFBVBlockVariable[maxNumberOfElement]; if(first2) @@ -99,7 +116,7 @@ bool SDFBlockVariable::loadFields(InputText& fp) throw(PacketException*) first2 = false; } buffer2->readRewind(); - //memorizza il bookmark + /// It memorizes the bookmark // long pos = fp.getpos(); for(int j=0; j 65535) throw new PacketExceptionFileFormat("Too many number of Rblocks in the packet type."); numberOfRBlocks = nev; - //si alloca la memoria per gestire gli rblock previsti + /// Memory allocation to handle the expected rblock rblockFilename = new char* [nev]; rBlockVariable = new bool[nev]; maxNumberOfBlock = new word[nev]; @@ -95,7 +112,7 @@ bool SDFRBBlockType::loadType(InputText& fp) throw(PacketException*) if(variablePresent) { - //find the [SourceDataFieldBlock] section + /// It finds the [SourceDataFieldBlock] section for(int i=0; i< numberOfRBlocks; i++) { char* linefind = Utility::integerToString3((char*)"[RBlock%d]", i+1); @@ -111,10 +128,10 @@ bool SDFRBBlockType::loadType(InputText& fp) throw(PacketException*) { line = 0; } - //delete[] linefind; + /// delete[] linefind; linefind = 0; - //type of number of block + /// type of number of block line = fp.getLine(); if(strcmp(line, "variable") == 0) { @@ -130,7 +147,7 @@ bool SDFRBBlockType::loadType(InputText& fp) throw(PacketException*) throw new PacketExceptionFileFormat("It's impossibile to identify the type of rblock. Expected fixed or variable keywords."); } - //number of blocks + /// number of blocks line = fp.getLine(); dword nev = atoi(line); if(nev > 65535) @@ -139,15 +156,15 @@ bool SDFRBBlockType::loadType(InputText& fp) throw(PacketException*) - //header level for the index of field + /// header level for the index of field line = fp.getLine(); headerLevelOfNBlockIndex[i] = atoi(line); - //index of field + /// index of field line = fp.getLine(); indexOfNBlock[i] = atoi(line); - //sum value + /// sum value line = fp.getLine(); switch(line[0]) { @@ -164,7 +181,7 @@ bool SDFRBBlockType::loadType(InputText& fp) throw(PacketException*) subFromNBlock[i] = atoi(line); } - //file name of the rblock + /// file name of the rblock rblockFilename[i] = fp.getLine(); // cout << "S " << rblockFilename[i] << endl; } @@ -200,7 +217,7 @@ SDFRBBlock::SDFRBBlock() counter++; //cout << counter << " " << sizeof(SDFRBBlock) << endl; - //create BlockType list + /// create BlockType list if(blockTypeList == 0) { dword nb = CONFIG_MAXNUMBER_OFCONFIGILES; @@ -252,7 +269,7 @@ bool SDFRBBlock::loadFields(InputText& fp) throw (PacketException*) { numberOfRealDataBlock = 0; } - //si carica la fixed part (se presente) + /// It loads the fixed part (if present) if(type->fixedPresent) { fp.setpos(0); @@ -313,8 +330,9 @@ bool SDFRBBlock::loadFields(InputText& fp) throw (PacketException*) //OK dword SDFRBBlock::getMaxDimension() { - dword dim = fixed.getDimension(); //for fixed part - //variable part + /// for fixed part + dword dim = fixed.getDimension(); + ///variable part for(dword i=0; i < type->nblockmax; i++) { @@ -325,7 +343,8 @@ dword SDFRBBlock::getMaxDimension() dword SDFRBBlock::getDimension() { - dword dim = fixed.getDimension(); //for fixed part + /// for fixed part + dword dim = fixed.getDimension(); word bi = 0; word rbi = 0; for(int i=0; i < type->nblockmax; i++) @@ -358,8 +377,9 @@ SDFRBBlock* SDFRBBlock::getBlock(word nblock, word rBlockIndex) void SDFRBBlock::setNumberOfRealDataBlock(word number, word rblockIndex) throw (PacketException*) { - //Nel caso in cui la parte variabile non sia presente oppure rBlockVariable = false, - //non e' presente un field in cui salvare il valore. La dimensione e' fissata + + /// In case the variable part is not present or rBlockVariable = false, + /// the field where to save the value is not present. The dimension is fixed. if(!type->variablePresent || !type->rBlockVariable[rblockIndex]) { throw new PacketException("It is not possible to set setNumberOfRealDataBlock for this rBlock: variable part not present"); @@ -427,7 +447,7 @@ word SDFRBBlock::getCurrentNumberOfBlocks() bool SDFRBBlock::setOutputStream(ByteStream* os, dword first) { dword start = first; - //setta l'output stream per la parte fixed (se presente) + /// It sets the output stream for the fixed part (if present) if(type->fixedPresent) { fixed.setOutputStream(os, start); @@ -445,7 +465,7 @@ bool SDFRBBlock::setOutputStream(ByteStream* os, dword first) rbi = block[i].getRBlockType(); if(bi < getNumberOfRealDataBlock(rbi)) { - //solo per i blocchi validi + /// Only for valid blocks block[i].setOutputStream(os, start); start += block[i].getDimension(); } @@ -471,7 +491,7 @@ ByteStream* SDFRBBlock::generateStream(bool bigendian) rbi = block[i].getRBlockType(); if(bi < getNumberOfRealDataBlock(rbi)) { - //solo per i blocchi validi + /// Only for valid blocks block[i].generateStream(bigendian); } else @@ -488,7 +508,7 @@ bool SDFRBBlock::setByteStream(ByteStream* s) dword bytestop=0; stream = s; //ByteStream* s = new ByteStream(k->stream, k->getDimension(), k->isBigendian()); - //setta l'output stream per la parte fixed (se presente) + // It sets the output stream for the fixed part (if present) if(type->fixedPresent) { bytestop += fixed.getDimension() - 1; @@ -508,13 +528,12 @@ bool SDFRBBlock::setByteStream(ByteStream* s) word nrdb = getNumberOfRealDataBlock(rbi); if(bi < nrdb) { - //solo per i blocchi validi - //1) per prima cosa occorre settare la parte fissa del block[i] - //prima di richiamare block[i].getDimension(), altrimenti ci sono - //solo valori casuali + /// Only for valid blocks + /// 1) first of all the fixed part of block[i] must be set + /// before calling block[i].getDimension(), otherwise only random values are present tempBlock->setStream(s, bytestart, s->getDimension() - 1); block[i].setByteStream(tempBlock); - //2) ora si puo' procedere con il calcolo corretto della dimensione + /// 2) Now the dimension correct computation can be started if(bytestop != 0) bytestop += block[i].getDimension(); else @@ -560,7 +579,7 @@ char** SDFRBBlock::printValue(char* addString) rbi = block[i].getRBlockType(); if(bi < getNumberOfRealDataBlock(rbi)) { - //solo per i blocchi validi + /// Only for valid blocks ct = block[i].printValue(addString); for(int ii=0; ct[ii] != 0; ii++) { @@ -594,7 +613,7 @@ void SDFRBBlock::printValueStdout() rbi = block[i].getRBlockType(); if(bi < getNumberOfRealDataBlock(rbi)) { - //solo per i blocchi validi + /// Only for valid blocks block[i].printValueStdout(); } else @@ -612,7 +631,8 @@ string* SDFRBBlock::printStructure() word SDFRBBlock::getTotalNumberOfFields() { - word dim = fixed.getNumberOfFields(); //for fixed part + /// for fixed part + word dim = fixed.getNumberOfFields(); word bi = 0; word rbi = 0; int j; diff --git a/src/SDFRBlock.cpp b/src/SDFRBlock.cpp index bb049f8848fd99223bbf87360261309e2771ef97..70f62f8464e69c08a927b35203799ce0aa6ad6cd 100644 --- a/src/SDFRBlock.cpp +++ b/src/SDFRBlock.cpp @@ -1,3 +1,20 @@ +/*************************************************************************** + SDFRBlock.cpp - description + ------------------- + begin : Thu Nov 29 2001 + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software for non commercial purpose * + * and for public research institutes; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License. * + * For commercial purpose see appropriate license terms * + * * + ***************************************************************************/ + #include "SDFRBlock.h" using namespace PacketLib; @@ -38,7 +55,8 @@ bool SDFRBlock::loadFields(InputText& fp) throw(PacketException*) block[0].setID(0); block[0].loadFields(fp); fp.setpos(0); - line = fp.getLine("[Identifiers]"); //get the [Identifiers] section + /// It gets the [Identifiers] section + line = fp.getLine("[Identifiers]"); return true; } catch(PacketExceptionIO* e) @@ -66,7 +84,7 @@ dword SDFRBlock::getDimension() void SDFRBlock::setNumberOfRealDataBlock(word number, word rblockIndex) throw (PacketException*) { - //il block[0] e' l'unico block presente + /// The block[0] is the only block present block[0].setNumberOfRealDataBlock(number, rblockIndex); reset_output_stream = true; } @@ -74,7 +92,7 @@ void SDFRBlock::setNumberOfRealDataBlock(word number, word rblockIndex) throw ( word SDFRBlock::getNumberOfRealDataBlock(word rblockIndex) { - //il block[0] e' l'unico block presente + /// The block[0] is the only block present return block[0].getNumberOfRealDataBlock(rblockIndex); } diff --git a/src/SHM.cpp b/src/SHM.cpp index 529eb91296dec89aad3f59342be3dbafc0fa37a4..384af3e3f9565d5f11f004ca1d17c29c47844b27 100644 --- a/src/SHM.cpp +++ b/src/SHM.cpp @@ -2,8 +2,8 @@ SHM.cpp - description ------------------- begin : Fri Jun 21 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@tesre.bo.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -21,14 +21,14 @@ using namespace PacketLib; -//##ModelId=3AA649A2005A + SHM::SHM(bool bigendian) : Device (bigendian) { created = false; } -//##ModelId=3AA649A200A0 + SHM::~SHM() { shmctl(shmid, IPC_RMID, 0); @@ -36,7 +36,7 @@ SHM::~SHM() } -//##ModelId=3DA3E5FC0302 + bool SHM::create(long shmkey, dword num_slot, dword slot_dim) throw(PacketExceptionIO*) { DEMORET0; @@ -71,14 +71,14 @@ bool SHM::create(long shmkey, dword num_slot, dword slot_dim) throw(PacketExcept } -//##ModelId=3AA649A200B4 + bool SHM::open(long shmkey, dword num_slot, dword slot_dim) throw(PacketExceptionIO*) { DEMORET0; //attach try { - //ottiene la memoria condivisa + /// It gets the shared memory if(shmkey != 0) { if((shmid = shmget(shmkey, num_slot*slot_dim, 0)) < 0) @@ -94,7 +94,7 @@ bool SHM::open(long shmkey, dword num_slot, dword slot_dim) throw(PacketExceptio this->num_slot = num_slot; this->slot_dim = slot_dim; } - //connette la memoria condivisa + /// It connects the shared memory if((shm = (byte*) shmat(shmid, 0, 0)) == (byte*) -1) throw new PacketExceptionIO("SHM: it is impossible to connect with the shared memory."); @@ -110,7 +110,7 @@ bool SHM::open(long shmkey, dword num_slot, dword slot_dim) throw(PacketExceptio } -//##ModelId=3AA649A200FA + bool SHM::close() throw(PacketExceptionIO*) { //detach @@ -129,7 +129,7 @@ bool SHM::close() throw(PacketExceptionIO*) } -//##ModelId=3DA3E5FE00BE + bool SHM::destroy() throw(PacketExceptionIO*) { try @@ -148,14 +148,13 @@ bool SHM::destroy() throw(PacketExceptionIO*) } -//##ModelId=3DA3E5FE0168 bool SHM::isCreated() const { return created; } -//##ModelId=3DA3E5FE0244 + void SHM::writeSlot(dword n_slot, void* element) throw(PacketExceptionIO*) { try @@ -175,7 +174,7 @@ void SHM::writeSlot(dword n_slot, void* element) throw(PacketExceptionIO*) } -//##ModelId=3DA3E5FF0122 + void* SHM::readSlot(dword n_slot) throw(PacketExceptionIO*) { try diff --git a/src/Serial.cpp b/src/Serial.cpp index 76cf695271ba7ec45e64e05e54ad2da0bc335ac8..ca507d17d01be840ae45c526c7e7195671fea3ad 100644 --- a/src/Serial.cpp +++ b/src/Serial.cpp @@ -1,3 +1,20 @@ +/*************************************************************************** + Serial.cpp - description + ------------------- + begin : Thu Nov 29 2001 + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software for non commercial purpose * + * and for public research institutes; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License. * + * For commercial purpose see appropriate license terms * + * * + ***************************************************************************/ + using namespace std; #include "Serial.h" @@ -5,11 +22,11 @@ using namespace std; using namespace PacketLib; -//------------------------------------------------------------------------------ -// -// Implementation of class Serial -// -//------------------------------------------------------------------------------ +///------------------------------------------------------------------------------ +/// +/// Implementation of class Serial +/// +///------------------------------------------------------------------------------ Serial::Serial() { @@ -99,7 +116,7 @@ int Serial::set( speed_t speed ) cfsetispeed( &par, speed ); cfsetospeed( &par, speed ); - // Disable software handshacking control + /// Disable software handshacking control par.c_iflag &= ( ~IXOFF); par.c_iflag &= ( ~IXON ); par.c_lflag &= ( ~IEXTEN ); diff --git a/src/Socket.cpp b/src/Socket.cpp index b30219d6f55f07de7c19e1ad1bdd6e5443600e73..c364aa3f36b7d346382635809740b3722f645825 100644 --- a/src/Socket.cpp +++ b/src/Socket.cpp @@ -2,8 +2,8 @@ Socket.cpp - description ------------------- begin : Thu May 16 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@tesre.bo.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -26,7 +26,7 @@ using namespace PacketLib; -//##ModelId=3DA3E600000A + Socket::Socket(bool bigendian) : Device(bigendian), m_sock ( -1 ) { @@ -35,7 +35,7 @@ Socket::Socket(bool bigendian) : Device(bigendian), m_sock ( -1 ) } -//##ModelId=3DA3E600003C + Socket::~Socket() { if ( is_valid() ) @@ -43,7 +43,7 @@ Socket::~Socket() } -//##ModelId=3DA3E6000118 + bool Socket::create() throw(PacketExceptionIO*) { m_sock = socket ( AF_INET, @@ -63,7 +63,7 @@ bool Socket::create() throw(PacketExceptionIO*) } -//##ModelId=3DA3E600011A + bool Socket::close() throw(PacketExceptionIO*) { @@ -74,7 +74,7 @@ bool Socket::close() throw(PacketExceptionIO*) } -//##ModelId=3DA3E6000078 + bool Socket::send ( ByteStream * b ) const throw(PacketExceptionIO*) { byte* stream = b->getOutputStream(); @@ -92,7 +92,7 @@ bool Socket::send ( ByteStream * b ) const throw(PacketExceptionIO*) } -//##ModelId=3DA3E600007B + ByteStream* Socket::recv (word dim, int & status ) throw(PacketExceptionIO*) { //ByteStream* b = new ByteStream(dim, bigendian); diff --git a/src/SocketClient.cpp b/src/SocketClient.cpp index af3d8d597dbff6c17c017e54e4a1bad205367e45..fbe564f3246870cadffaa8ae73863930350afb63 100644 --- a/src/SocketClient.cpp +++ b/src/SocketClient.cpp @@ -2,8 +2,8 @@ SocketClient.cpp - description ------------------- begin : Thu May 16 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@tesre.bo.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -15,14 +15,12 @@ * * ***************************************************************************/ -// Implementation of the SocketClient class - #include "SocketClient.h" #include "PacketExceptionIO.h" using namespace PacketLib; -//##ModelId=3DA3E6000155 + SocketClient::SocketClient ( bool bigendian, std::string host, int port ) : Socket(bigendian) { if ( ! Socket::create() ) diff --git a/src/SocketServer.cpp b/src/SocketServer.cpp index ce682fe073b28cbb06373e53da24e0c2cc6ba5d8..6c1b5817d9c57a03a378181fbd77dbb677771504 100644 --- a/src/SocketServer.cpp +++ b/src/SocketServer.cpp @@ -2,8 +2,8 @@ SocketServer.cpp - description ------------------- begin : Thu May 16 2002 - copyright : (C) 2002 by Andrea Bulgarelli - email : bulgarelli@tesre.bo.cnr.it + copyright : (C) 2002, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -21,7 +21,7 @@ using namespace PacketLib; -//##ModelId=3DA3E6000230 + SocketServer::SocketServer (bool bigendian, int port ) : Socket(bigendian) { if ( ! create() ) @@ -36,20 +36,20 @@ SocketServer::SocketServer (bool bigendian, int port ) : Socket(bigendian) } -//##ModelId=3DA3E60001F5 + SocketServer::SocketServer (bool bigendian) : Socket(bigendian) { }; -//##ModelId=3DA3E6000262 + SocketServer::~SocketServer() { } -//##ModelId=3DA3E6000264 + bool SocketServer::bind ( const int port ) throw(PacketExceptionIO*) { @@ -75,7 +75,7 @@ bool SocketServer::bind ( const int port ) throw(PacketExceptionIO*) } -//##ModelId=3DA3E600029E + bool SocketServer::listen() const throw(PacketExceptionIO*) { if ( ! is_valid() ) @@ -94,7 +94,6 @@ bool SocketServer::listen() const throw(PacketExceptionIO*) } -//##ModelId=3DA3E60002D0 bool SocketServer::accept ( SocketServer& new_socket ) throw(PacketExceptionIO*) { int addr_length = sizeof ( m_addr ); @@ -107,7 +106,7 @@ bool SocketServer::accept ( SocketServer& new_socket ) throw(PacketExceptionIO*) } -//##ModelId=3DA3E60002A0 + void SocketServer::set_non_blocking ( const bool b ) { diff --git a/src/SourceDataField.cpp b/src/SourceDataField.cpp index a163f6a54c54d86597a9c8234d0f005ea5f487a7..e48f648f1c46a01fa817b23e01b69887b8989962 100644 --- a/src/SourceDataField.cpp +++ b/src/SourceDataField.cpp @@ -1,8 +1,25 @@ +/*************************************************************************** + SourceDataField.cpp - description + ------------------- + begin : Thu Nov 29 2001 + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software for non commercial purpose * + * and for public research institutes; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License. * + * For commercial purpose see appropriate license terms * + * * + ***************************************************************************/ + #include "SourceDataField.h" using namespace PacketLib; -//##ModelId=3DA3E603001E + SourceDataField::SourceDataField(const char* sdfName) : PartOfPacket(sdfName) { fixed = false; @@ -40,28 +57,27 @@ char* SourceDataField::printInHexadecimal() return c; } -//##ModelId=3C301E8A0081 + bool SourceDataField::isBlock() { return isblock; } -//##ModelId=3C347EA003C8 + bool SourceDataField::isFixed() { return fixed; } -//##ModelId=3C35EF40001F + bool SourceDataField::isNumberOfBlockFixed(word rblockIndex) { return numberOfBlockFixed[rblockIndex]; } -//##ModelId=3C35EF4303B7 word SourceDataField::getMaxNumberOfBlock(word rblockIndex) { return maxNumberOfBlock[rblockIndex]; @@ -81,7 +97,7 @@ word SourceDataField::getIndexOfNBlock(word rblockIndex) } -//##ModelId=3C9AEC0A01AD + void SourceDataField::setNumberOfRealDataBlock(word number, word rblockIndex) throw (PacketException*) { numberOfRealDataBlock[rblockIndex] = number; @@ -89,20 +105,20 @@ void SourceDataField::setNumberOfRealDataBlock(word number, word rblockIndex) th } -//##ModelId=3C9AEC0B011F + word SourceDataField::getNumberOfRealDataBlock(word rblockIndex) { return numberOfRealDataBlock[rblockIndex]; } -//##ModelId=3DA3E63E0384 + word SourceDataField::getNumberOfFields() { return PartOfPacket::getNumberOfFields(); }; -//##ModelId=3DA3E6380320 + word SourceDataField::getNumberOfFields(word block) { return 0; @@ -115,13 +131,13 @@ dword SourceDataField::getDimension() } -//##ModelId=3C9AFF7A0170 + word SourceDataField::getNumberOfRealElement(word block) { return 0; } -//##ModelId=3DA3E6430082 + void SourceDataField::setNumberOfRealElement(word block, word value) { @@ -146,8 +162,10 @@ float SourceDataField::getFieldValue_5_1(word block, word index) { union u_tag { - unsigned long i; //32 bit - float f; //32 bit single precision + /// 32 bit + unsigned long i; + /// 32 bit single precision + float f; } u; u.i = (getFieldValue(block, index) << 16) | getFieldValue(block, index + 1); return u.f; @@ -157,8 +175,10 @@ void SourceDataField::setFieldValue_5_1(word block, word index, float value) { union u_tag { - unsigned long i; //32 bit - float f; //32 bit single precision + /// 32 bit + unsigned long i; + /// 32 bit single precision + float f; } u; word w; u.f = value; @@ -188,13 +208,15 @@ signed long SourceDataField::getFieldValue_4_13(word block, word index) { union u_tag { - unsigned long u; //32 bit + /// 32 bit + unsigned long u; signed long s; } us; us.u = getFieldValue_3_14(block, index); - unsigned long sign = (us.u >> 23); //get the sign + /// gets the sign + unsigned long sign = (us.u >> 23); unsigned long wh = us.u & 0x007FFFFF; - //get a long 32 bit + /// gets a long 32 bit if(sign == 1) us.u = 0x7F800000 + wh + (sign << 31); else @@ -206,7 +228,8 @@ void SourceDataField::setFieldValue_4_13(word block, word index, signed long va { union u_tag { - unsigned long u; //32 bit + /// 32 bit + unsigned long u; signed long s; } us; if(value > U24BITINTGEGERSIGNED_MAX) @@ -215,7 +238,8 @@ void SourceDataField::setFieldValue_4_13(word block, word index, signed long va throw new PacketException("setFieldValue_4_13(): the min value of 24 bit signed integer should be -8388607"); us.s = value; unsigned long sign = (us.u >> 31); - unsigned long wh = us.u & 0x007FFFFF; //23 bit + /// 23 bit + unsigned long wh = us.u & 0x007FFFFF; unsigned long value2 = 0; value2 = wh + (sign << 23); setFieldValue_3_14(block, index, value2); @@ -256,7 +280,7 @@ void SourceDataField::setFieldValue_3_13(word block, word index, unsigned long v setFieldValue(block, index + 1, w); } -//##ModelId=3DA3E6120276 + dword SourceDataField::getDimension(word block) { return 0; @@ -267,20 +291,20 @@ dword SourceDataField::getMaxDimension(word nblock) return 0; } -//##ModelId=3DA3E60B0064 + word SourceDataField::getMaxNumberOfElements(word nblock) { return 0; } -//##ModelId=3DA3E64B0320 + bool SourceDataField::get_reset_output_stream() const { return reset_output_stream; } -//##ModelId=3DA3E6500168 + void SourceDataField::set_reset_output_stream(bool value) { reset_output_stream = value; diff --git a/src/Utility.cpp b/src/Utility.cpp index 010da6e21a3834de159a5d284f89715e56bdd0ce..560b8a5d3a5b2fbbac30ed75c095f3d46b5574a3 100644 --- a/src/Utility.cpp +++ b/src/Utility.cpp @@ -2,8 +2,8 @@ Utility.cpp - description ------------------- begin : Thu Nov 29 2001 - copyright : (C) 2001 by Andrea Bulgarelli - email : bulgarelli@tesre.bo.cnr.it + copyright : (C) 2001, 2013 by Andrea Bulgarelli + email : bulgarelli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -22,7 +22,6 @@ using namespace PacketLib; -//##ModelId=3C0F6C1A023F int Utility::convertToInteger(string bin) { string::size_type pos; @@ -30,12 +29,12 @@ int Utility::convertToInteger(string bin) pos = bin.find("0b",0); if(pos == 0) { - //is a binary number + /// is a binary number return binaryToInteger(bin); } else { - //is a decimal number + /// is a decimal number return atoi(bin.c_str()); } @@ -47,7 +46,7 @@ char* Utility::extractPath(char* filename) int index; for(index=len-1; index>=0; index--) { - // char c = filename[index]; + //I char c = filename[index]; if(filename[index] == '/') break; } @@ -59,7 +58,6 @@ char* Utility::extractPath(char* filename) } -//##ModelId=3DA3E65401AE int Utility::convertToInteger(char* bin) { string s; @@ -69,15 +67,14 @@ int Utility::convertToInteger(char* bin) } -/** Return the integer or -1 if the string isn't a binary number */ -//##ModelId=3C0F6C1A023C +/// Return the integer or -1 if the string isn't a binary number int Utility::binaryToInteger(string bin) { string::size_type pos; pos = bin.find("0b",0); if(pos == 0) { - //is a binary number + ///is a binary number int size = bin.size(); int pos = 1; int decimal = 0; @@ -99,15 +96,14 @@ int Utility::binaryToInteger(string bin) } -/** Return the integer or -1 if the string isn't a binary number */ -//##ModelId=3DA3E65700AA +/// Return the integer or -1 if the string isn't a binary number int Utility::hexadecimalToInteger(string hex) { string::size_type pos; pos = hex.find("0x",0); if(pos == 0) { - //is a binary number + ///is a binary number int size = hex.size(); int pos = 1; int decimal = 0; @@ -167,10 +163,9 @@ char* Utility::format_output(dword data, bool dec, bool hex, bool bin) } -/** Restituisce n bit (allineati a destra di x a partire dalla posizione p). -Esempio: getbits(x,4,3) restituisce bit 4, 3, 2 (allinemanto a destra) -15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 */ -//##ModelId=3C18775101A5 +/// It gives n bit (alligned at right of "x" from the p position). +/// Example: getbits(x,4,3) gives bit 4, 3, 2 (alligned at right) +/// 7 6 5 4 3 2 1 0 */ unsigned Utility::getbits(word x, int p, int n) { return (x >> (p + 1 - n)) & ~(~0 << n); @@ -181,24 +176,21 @@ unsigned Utility::getbits32(dword x, int p, int n) return (x >> (p + 1 - n)) & ~(~0 << n); } +/// It gives n bit (alligned at right of "x" from the p position). +/// Example: getbits(x,4,3) gives bit 4, 5, 6 (alligned at right but with packet numbering) +/// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 -/** Restituisce n bit (allineati a destra di x a partire dalla posizione p). -Esempio: getbits(x,4,3) restituisce bit 4, 5, 6 (allinemanto a destra ma con numerazione packet) -0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 */ -//##ModelId=3C18775101E6 unsigned Utility::getbits2(word x, int p, int n) { return getbits(x, 15 - p, n); } -/** No descriptions */ -//##ModelId=3DA3E65402F8 string* Utility::wordToBinary(word w, byte dim) { string* temp = new string(""); unsigned valuetemp; - //si parte da LSB + /// It starts from LSB for(int i=0; i