diff --git a/include/ByteStream.h b/include/ByteStream.h index afbc92fa4f97fddee65a3bb9205768840a4d978b..5d4b43615f8ca63c1cd5e83d1df68e6bb87c2b60 100644 --- a/include/ByteStream.h +++ b/include/ByteStream.h @@ -2,8 +2,9 @@ ByteStream.h ------------------- begin : Thu Nov 29 2001 - copyright : (C) 2001, 2013 by Andrea Bulgarelli - email : bulgarelli@iasfbo.inaf.it + copyright : (C) 2001-2013 by Andrea Bulgarelli + 2013-2014 by Andrea Bulgarelli, Andrea Zoli + email : bulgarelli@iasfbo.inaf.it, zoli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** diff --git a/include/Packet.h b/include/Packet.h index dd08f0c21accb9e046da307f66f37d63ac07a854..33739376f269911ff07524013e2e9bbf5cd78b69 100644 --- a/include/Packet.h +++ b/include/Packet.h @@ -2,8 +2,9 @@ Packet.h - description ------------------- begin : Thu Nov 29 2001 - copyright : (C) 2001, 2013 by Andrea Bulgarelli - email : bulgarelli@iasfbo.inaf.it + copyright : (C) 2001-2013 by Andrea Bulgarelli + 2013-2014 by Andrea Bulgarelli, Andrea Zoli + email : bulgarelli@iasfbo.inaf.it, zoli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** diff --git a/src/ByteStream.cpp b/src/ByteStream.cpp index 7b8568582c832b2612cd7275a6c205708753298c..14615e6fbe9e37912b30eede5c65ed63a5fd44fe 100644 --- a/src/ByteStream.cpp +++ b/src/ByteStream.cpp @@ -2,8 +2,9 @@ ByteStream.cpp - description ------------------- begin : Thu Nov 29 2001 - copyright : (C) 2001, 2013 by Andrea Bulgarelli - email : bulgarelli@iasfbo.inaf.it + copyright : (C) 2001-2013 by Andrea Bulgarelli + 2013-2914 by Andrea Bulgarelli, Andrea Zoli + email : bulgarelli@iasfbo.inaf.it, zoli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -30,39 +31,28 @@ using namespace PacketLib; /// In all methods of constructor or set type accepting ByteStreamPtr the swap is never applied. PacketLib::ByteStream::ByteStream(bool bigendian) + : stream(0), byteInTheStream(0), bigendian(bigendian) { mem_allocation_constructor = true; - - byteInTheStream = 0; - this->stream = 0; - this->bigendian = bigendian; - setMemoryAllocated(false); mem_allocation_constructor = false; } PacketLib::ByteStream::ByteStream(dword dim, bool bigendian) + : byteInTheStream(dim), bigendian(bigendian) { mem_allocation_constructor = true; - - byteInTheStream = dim; stream = (byte*) new byte[dim]; - /// memset(stream, 0, dim); ok - this->bigendian = bigendian; - setMemoryAllocated(true); mem_allocation_constructor = false; } PacketLib::ByteStream::ByteStream(byte* stream, dword dim, bool bigendian, bool memory_sharing) + : stream(stream), byteInTheStream(dim), bigendian(bigendian) { mem_allocation_constructor = true; - - byteInTheStream = dim; - this->stream = stream; - this->bigendian = bigendian; //if(!memory_sharing) // swapWordIfStreamIsLittleEndian(); /// \remarks memory_sharing == false means that the object is responsible for the memory diff --git a/src/Packet.cpp b/src/Packet.cpp index 564eb5eb9aaa17dd08fd99b8b4d0463f540b9ebd..2ffa6fe69d3f976f4634a653fb0987126caf4339 100644 --- a/src/Packet.cpp +++ b/src/Packet.cpp @@ -2,8 +2,9 @@ Packet.cpp - description ------------------- begin : Thu Nov 29 2001 - copyright : (C) 2001, 2013 by Andrea Bulgarelli - email : bulgarelli@iasfbo.inaf.it + copyright : (C) 2001-2013 by Andrea Bulgarelli + 2013-2014 by Andrea Bulgarelli, Andrea Zoli + email : bulgarelli@iasfbo.inaf.it, zoli@iasfbo.inaf.it ***************************************************************************/ /*************************************************************************** @@ -24,24 +25,24 @@ using namespace PacketLib; #define DECODETYPE 2 Packet::Packet(bool bigendian) - : decodedPacketDataFieldHeader(false) + : prefix(0), packet(0), stream(0), packetID(0), name(0), identifiers(0), + number_of_identifiers(0), bigendian(bigendian), thereisprefix(false), + filename(0), first_output_stream_setted(false), dimPrefix(0), + dimPacketHeader(0), dimPacketDataFieldHeader(0), + dimPacketSourceDataFieldFixed(0), dimPacketTail(0), + dimPacketStartingFixedPart(0), decodedPacketHeader(false), + decodedPacketDataFieldHeader(false), decodedPacketSourceDataField(false), + decodedPacketTail(false), compressionAlgorithmsSection(0), + compressionAlgorithmsIndex(0), compressionLevelSection(0), + compressionLevelIndex(0), compressible(false) { header = (PacketHeader*) new PacketHeader(); dataField = (PacketDataField*) new PacketDataField(); - name = 0; -// tail = new PartOfPacket(); - number_of_identifier = 0; - identifiers = 0; - this->bigendian = bigendian; - /// temp tempHeader = ByteStreamPtr(new ByteStream); tempDataField = ByteStreamPtr(new ByteStream); tempDataFieldHeader = ByteStreamPtr(new ByteStream); tempPacketDataField = ByteStreamPtr(new ByteStream); tempTail = ByteStreamPtr(new ByteStream); - first_output_stream_setted = false; - compressible = false; - }