Skip to content
Snippets Groups Projects
Commit 9c1f3f96 authored by Andrea Bulgarelli's avatar Andrea Bulgarelli
Browse files

removed Packet::decompressData. Now Packet::getData() performs the...

removed Packet::decompressData. Now Packet::getData() performs the decompression operation in a transparent way
parent 7d130612
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>AD920CA7-23AA-4A38-B382-B72E4C2959FA</string>
<string>5C866F64-F91E-4DE9-B35A-4CCAE5CEE492</string>
<key>IDESourceControlProjectName</key>
<string>PacketLib</string>
<key>IDESourceControlProjectOriginsDictionary</key>
......
......@@ -84,8 +84,8 @@ public:
///\post the variable part of the "source data field" is compressed and should be sent or stored
virtual ByteStreamPtr compressData(enum CompressionAlgorithms compressionAlgorithm, byte compressionLevel);
///\return decompress the data section without changing the packet (the variable part of the "source data field")
virtual ByteStreamPtr decompressData();
///\return Get the the variable part of the source data field as a ByteStream that contains the data and decompress (if compressed) them without changing the packet (the variable part of the "source data field")
virtual ByteStreamPtr getData();
///Get the compression algorithm used for this packet
virtual enum CompressionAlgorithms getCompressionAlgorithm();
......@@ -124,9 +124,6 @@ public:
///Get the the variable part of the source data field as a ByteStream
ByteStreamPtr getBSSourceDataFieldsVariablePart();
///Get the the variable part of the source data field as a ByteStream that contains the data
ByteStreamPtr getData();
///Get the the source data field as a ByteStream
ByteStreamPtr getBSSourceDataField();
......@@ -242,6 +239,9 @@ public:
protected:
///Get the the variable part of the source data field as a ByteStream that contains the data
ByteStreamPtr getBSData();
/// This is the ByteStream generated with generateStream().
ByteStreamPtr packet_output;
......
......@@ -869,7 +869,7 @@ ByteStreamPtr Packet::getBSSourceDataFieldsVariablePart() {
return sdff;
}
ByteStreamPtr Packet::getData() {
ByteStreamPtr Packet::getBSData() {
return getBSSourceDataFieldsVariablePart();
}
......@@ -1031,7 +1031,7 @@ PartOfPacket* Packet::getPacketTail() {
return dataField->getPacketTail();
}
ByteStreamPtr Packet::decompressData() {
ByteStreamPtr Packet::getData() {
//ALGORITHM FOR AUTOMATIC DECOMPRESSION: NOT IMPLEMENTED NOW. TODO
//decompression algorithm here
//1) get the fixed and variable part of the source data field, get the tail
......@@ -1043,8 +1043,8 @@ ByteStreamPtr Packet::decompressData() {
//DECOMPRESS ONLY THE DATA
if(!isCompressed())
return getData();
ByteStreamPtr compressed = getData();
return getBSData();
ByteStreamPtr compressed = getBSData();
ByteStreamPtr decompressed = compressed->decompress(getCompressionAlgorithm(), getCompressionLevel(), sizeMax());
return decompressed;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment