Commit 70470aaa authored by Andrea Bulgarelli's avatar Andrea Bulgarelli
Browse files

ByteStream::stream new access rules

parent 2110d603
Loading
Loading
Loading
Loading
+31 −18
Original line number Diff line number Diff line
2013-08-29
tag v2.0.5

2013-08-29  bulgarelli  <bulgarelli@tesp28.local>
2013-09-12  Andrea Bulgarelli <bulgarelli@iasfbo.inaf.it>
TAG v2.0.6

Bug resolved (http://redmine.iasfbo.inaf.it/issues/983): the ByteStream::stream do not contain the correct point to the stream
* src/SDFRBBlock.cpp (SDFRBBlock::setByteStream): 
	this->stream->setStream(s, 0, s->getDimension() - 1);
* src/PartOfPacket.cpp (PartOfPacket::setByteStream):
	//this->stream = s; <- OLD
    this->stream->setStream(s, 0, s->getDimension() - 1); <- NEW
* include/PartOfPacket.h (PartOfPacket): 
	** new method: virtual void deleteByteStream();
	** new method: virtual void memByteStream(ByteStream* stream);
	** stream moved into protected section
* include/SDFRBBlock.h: added deleteByteStream() and memByteStrem()
* changes on Packet.cpp,  PacketNotRecognized.cpp for new methods on PartOfPacket

2013-08-29 Andrea Bulgarelli <bulgarelli@iasfbo.inaf.it>
TAG v2.0.5

* include/ByteStream.h (ByteStream): void swapWordIfStreamIsBigEndian();

2013-08-28  bulgarelli  <bulgarelli@tesp28.local>

* include/ByteStream.h (ByteStream): renamed swap() in swapWord()
* include/ByteStream.h (ByteStream): void swapWordIfStreamIsLittleEndian();
* include/ByteStream.h (ByteStream): void swapWordIfStreamIsBigEndian();

25 July 2003
v2.0.3 on git
2013-07-25 Andrea Bulgarelli <bulgarelli@iasfbo.inaf.it>
TAG v2.0.3

* 32 bit packet length

+ 32 bit packet length
Example of .header format

-- name of header
Header CTA
-- number of field with dimension of packet (or first field if dim of packet is stored in a 32 bit field)
@@ -58,8 +71,8 @@ none

If the field '-- 16 or 32 bit size dimension of the packet lenght' is set to 16 or it is absent, the packet lenght is 16 bit.

+ Field::value management (set predefined value=0 and during output stream generation

* Field::value management (set predefined value=0 and during output stream generation
* Migration to git repository

15 July 2013
TAG CVS: PACKETLIB_1_4_0
+1 −1
Original line number Diff line number Diff line
@@ -166,7 +166,7 @@ HIDE_UNDOC_RELATIONS = YES
INCLUDE_GRAPH          = YES
INCLUDED_BY_GRAPH      = YES
GRAPHICAL_HIERARCHY    = YES
DOT_IMAGE_FORMAT       = gif
DOT_IMAGE_FORMAT       = png
DOT_PATH               = 
DOTFILE_DIRS           = 
MAX_DOT_GRAPH_WIDTH    = 1024
+13 −2
Original line number Diff line number Diff line
@@ -245,8 +245,16 @@ public:
    /// 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.
    ByteStream* stream;
    /// Get the current ByteStream
    virtual ByteStream* getByteStream()
    {
    	return stream;
    }

    /// Delete the current ByteStream
    virtual void deleteByteStream();

    virtual void memByteStream(ByteStream* stream);

    /// Represent current stream writes to output.
    ByteStream* outputstream;
@@ -264,6 +272,9 @@ public:

protected:

    /// Represent current stream reads from input.
    ByteStream* stream;

    /// List of field of part of packet.
    Field** fields;

+7 −2
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ public:

};

///ModelId=405AD49C00E5
///The core of the variable packet structure
class SDFRBBlock : public PartOfPacket
{
public:
@@ -147,6 +147,11 @@ public:

    virtual bool setByteStream(ByteStream* s);

    virtual ByteStream* getByteStream()
    {
        return stream;
    }

    /// 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)
@@ -206,7 +211,7 @@ protected:

    bool reset_output_stream;

    ByteStream* tempBlock;
    ByteStream* tempBlock1;

    SDFRBBlockType* type;

+14 −15
Original line number Diff line number Diff line
@@ -313,7 +313,7 @@ void Packet::printIdentifiers()

bool Packet::setPacketValue(ByteStream* prefix, ByteStream* packetHeader, ByteStream* packetDataField)
{
    cout << "@ " << packetDataField->getDimension() << endl;
    //cout << "@ " << packetDataField->getDimension() << endl;
    memByteStream(prefix, packetHeader, packetDataField);
    ByteStream* packet = new ByteStream(packetHeader, packetDataField, 0);
    memByteStream(prefix, packet);
@@ -705,17 +705,16 @@ void Packet::deleteExternalByteStream()
            delete packet;
            packet = 0;
        }
    if(dataField->stream != 0)
        if(dataField->stream->getMemAllocation())
    if(dataField->getByteStream() != 0)
        if(dataField->getByteStream()->getMemAllocation())
        {
            delete dataField->stream;
            dataField->stream = 0;
            dataField->deleteByteStream();

        }
    if(header->stream != 0)
        if(header->stream->getMemAllocation())
    if(header->getByteStream() != 0)
        if(header->getByteStream()->getMemAllocation())
        {
            delete header->stream;
            header->stream = 0;
            header->deleteByteStream();
        }
}

@@ -733,8 +732,8 @@ void Packet::memByteStream(ByteStream* prefix, ByteStream* packetHeader, ByteStr
{
    this->prefix = prefix;
    //this->packet = 0;
    this->header->stream = packetHeader;
    this->dataField->stream = packetDataField;
    this->header->memByteStream(packetHeader);
    this->dataField->memByteStream(packetDataField);
}


@@ -749,7 +748,7 @@ ByteStream* Packet::getOutputStream()
ByteStream* Packet::getInputStream()
{
    if(packet == 0)
        packet = new ByteStream(header->stream, dataField->stream, 0);
        packet = new ByteStream(header->getByteStream(), dataField->getByteStream(), 0);
    return packet;
}

@@ -787,7 +786,7 @@ char** Packet::printHeaderValue()

char* Packet::printHeaderStream()
{
    return (char*)header->stream->printStreamInHexadecimal();
    return (char*)header->getByteStream()->printStreamInHexadecimal();
}

char** Packet::printDataFieldHeaderValue()
@@ -797,7 +796,7 @@ char** Packet::printDataFieldHeaderValue()

char* Packet::printDataFieldHeaderStream()
{
    return (char*)dataField->dataFieldHeader->stream->printStreamInHexadecimal();
    return (char*)dataField->dataFieldHeader->getByteStream()->printStreamInHexadecimal();
}

char** Packet::printSourceDataFieldValue()
@@ -821,7 +820,7 @@ char** Packet::printTailValue()
char* Packet::printTailStream()
{
    if(dataField->tail->getDimension() != 0)
        return dataField->tail->stream->printStreamInHexadecimal();
        return dataField->tail->getByteStream()->printStreamInHexadecimal();

    else
        return 0;
Loading