Commit e50435b6 authored by Andrea Bulgarelli's avatar Andrea Bulgarelli
Browse files

chaching for SDFRBBlock (added SDFRBBlockType)

parent 72bf391d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ CC = gcc
CXX      = g++
#Insert the optional parameter to the compiler. The CFLAGS could be changed externally by the user
#- g3
CFLAGS   = -O2 -O0 -g3 -m64
CFLAGS   = -O2 -O0 -g3 -m64 -fPIC
#-O2 -O0 -g3
#Set INCPATH to add the inclusion paths
INCPATH = -I ./include
+0 −2
Original line number Diff line number Diff line
@@ -26,8 +26,6 @@ class FieldType {

	public:
	
		FieldType();
	
		//Dimension of field in bit.
        word dimension;

+2 −0
Original line number Diff line number Diff line
@@ -54,6 +54,8 @@ class File : public Device
        //## \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 ) { this->filename = filename; };
		
        virtual char* getFileName() { return filename;};

        //##ModelId=3C0F6C1A0016
+107 −100
Original line number Diff line number Diff line
@@ -20,7 +20,70 @@
#include "PartOfPacket.h"


namespace PacketLib {
namespace PacketLib
{


class SDFRBBlockType
{

public:

	SDFRBBlockType();

	bool loadType(InputText& fp) throw(PacketException*);

	//the name of the InputFile
	char* name;
	
	//## Fixed part present
    bool fixedPresent;

    //## Variable part present
    bool variablePresent;


    char** rblockFilename;

	//## 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
    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.
    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
    word* headerLevelOfNBlockIndex;

    word* indexOfNBlock;

    //## 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
    byte* operatorType;

    //## Indicates if an rblock has a fixed or variable number of blocks
    bool* rBlockVariable;

    //## The max number of blocks
    word nblockmax;

    


};

//##ModelId=405AD49C00E5
class SDFRBBlock : public PartOfPacket
@@ -31,11 +94,11 @@ class SDFRBBlock : public PartOfPacket

    virtual bool loadFields(InputText& fp) throw(PacketException*);

    virtual void setPreviousPop(PartOfPacket* pop) {
    virtual void setPreviousPop(PartOfPacket* pop)
    {
        previous = pop;
    };

    //##Documentation
    //## 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
@@ -46,26 +109,36 @@ class SDFRBBlock : public PartOfPacket

    virtual dword getDimension();

    //##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
    virtual 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
    virtual word getNumberOfRealDataBlock(word rblockIndex = 0);

    virtual void setRBlockType(word rb) { rBlockType = rb; };
    virtual void setRBlockType(word rb)
    {
        rBlockType = rb;
    };

    virtual inline word getRBlockType() { return rBlockType; };
    virtual inline word getRBlockType()
    {
        return rBlockType;
    };

    virtual void setID(word id) { ID = id; };
    virtual void setID(word id)
    {
        ID = id;
    };

    virtual inline word getID() { return ID; };
    virtual inline word getID()
    {
        return ID;
    };

    virtual bool setOutputStream(ByteStream* os, dword first);

@@ -73,49 +146,42 @@ class SDFRBBlock : public PartOfPacket

    virtual bool setByteStream(ByteStream* s);

    //##ModelId=3C187751015F
    //##Documentation
    //## 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) {
    virtual  inline  Field* getFields(word index)
    {
        return fixed.getFields(index);
    };

    //##ModelId=3EADC13D0294
    //##Documentation
    //## 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) {
    virtual  inline word getFieldValue(word index)
    {
        return fixed.getFieldValue(index);
    };

    //##ModelId=3EADC13E0246
    //##Documentation
    //## 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 setted.
    virtual  inline void setFieldValue(word index, word value) {
    virtual  inline void setFieldValue(word index, word value)
    {
        fixed.setFieldValue(index, value);
    };

    //##ModelId=3C187751018C
    //##Documentation
    //## Returns the number of fields of this block (fixed and variable part).
    virtual inline word getNumberOfFields() {
    virtual inline word getNumberOfFields()
    {
        return getTotalNumberOfFields();
    };

    //##Documentation
    //## Returns the number of fields of the overall block
    virtual word getTotalNumberOfFields();

    //##Documentation
    //## 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
    virtual string* printStructure();

@@ -125,87 +191,28 @@ class SDFRBBlock : public PartOfPacket

    virtual word getCurrentNumberOfBlocks();

    //##ModelId=405AD4BD00C2
    SDFRBBlock* block;



    //##Documentation
    //## The number of rblock
    int numberOfRBlocks;

    //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
    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.
    word* maxNumberOfBlock;

    //##ModelId=405AA86B01B4
    //##Documentation
    //## Real number of blocks.
    word* numberOfRealDataBlock;

    //##Documentation
    //## 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;
    
    //##ModelId=405AA86B01A5
    word* indexOfNBlock;

    //##ModelId=405AA86B01C4
    //##Documentation
    //## for variable block, valore da sommare per ottenere il numero di eventi (blocchi) reali.
    word* subFromNBlock;    
    
    //##Documentation
    //## apply an operator during the calculation of the number of blocks
    //## 0 -> nothing
    //## 1 -> / divide for 2
    byte* operatorType;

    char** rblockFilename;

    //##Documentation
    //## Indicates if an rblock has a fixed or variable number of blocks
    bool* rBlockVariable;

    //##Documentation
    //## The max number of blocks
    word nblockmax;                                                    

    //##Documentation
    //## Fixed part present
    bool fixedPresent;

    //##Documentation
    //## Variable part present
    bool variablePresent;
    //## An index that represent an unique index for each block of a particular rblock.
    word ID;
    
    //##Documentation
    //## An index that represent the type of rblock (starting from 0). This index
    //## is unique into a rblock container.
    word rBlockType;

    //##Documentation
    //## An index that represent an unique index for each block of a particular rblock.
    word ID;

    //##ModelId=3EADC1440130
    bool reset_output_stream;

    ByteStream* tempBlock;
    
    SDFRBBlockType* type;
    
    static long counter;
    
};

}
+1482 −2577

File changed.

Preview size limit exceeded, changes collapsed.

Loading