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

commenting and tabbing

parent 09dc86f3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -129,10 +129,10 @@ $(shell cut $(INCLUDE_DIR)/$(VER_FILE_NAME) -f 3 > version)

#only for documentation generation
$(DOXY_SOURCE_DIR)/%.h : %.h
	doxyfilter < $< > $@
	cp  $<  $@

$(DOXY_SOURCE_DIR)/%.cpp : %.cpp
	doxyfilter < $< > $@
	cp  $<  $@
	
####### 10) Build rules

+125 −182
Original line number Diff line number Diff line
/***************************************************************************
                          ByteStream.h  -  description
                             -------------------
    begin                : Thu Nov 29 2001
    copyright            : (C) 2001 by Andrea Bulgarelli
    email                : bulgarelli@bo.iasf.cnr.it
@@ -14,191 +12,136 @@
 *   For commercial purpose see appropriate license terms                  *
 *                                                                         *
 ***************************************************************************/
#ifndef ByteStream_h_h_ZC2002
#define ByteStream_h_h_ZC2002
 
#ifndef _BYTESTREAM_H
#define _BYTESTREAM_H

#include "PacketLibDefinition.h"

namespace PacketLib {
namespace PacketLib
{


//##ModelId=3C0F6BDB0029
//##Documentation
//##	$Date: 2005/04/15 14:44:54 $
//##	$Header: /home/repository/cvs/gtb/PacketLib/include/ByteStream.h,v 1.3 2005/04/15 14:44:54 bulgarelli Exp $
//##	$Id: ByteStream.h,v 1.3 2005/04/15 14:44:54 bulgarelli Exp $
//##	$Revision: 1.3 $
//##	\brief Represent a stream of byte.
///	\brief Represent a stream of byte.
class ByteStream
{

public:

        //##ModelId=3C0F6BDB003B
        //##Documentation
        //## The memory of byte* is not allocated

    /// The memory of byte* is not allocated
    /// \param bigendian The byte alignment
    ByteStream(bool bigendian = false);

        //##ModelId=3EADC12501CA
        //##Documentation
        //## The memory of byte* is allocated
    /// The memory of byte* is allocated
    ByteStream(dword size, bool bigendian);

        //##ModelId=3EADC125023B
        //##Documentation
        //## The memory of byte* is not allocated
    /// The memory of byte* is not allocated
    ByteStream(byte* stream, dword dim, bool bigendian, bool memory_sharing = true);

        //##ModelId=3EADC125031B
        //##Documentation
        //## Creates a new ByteStream that it is the sum of one or two or three ByteStream
        //## passed as input.
        //## It's possibile to pass 0 as pointer.
        //## The mamory of byte* is allocated.
    /// Creates a new ByteStream that it is the sum of one or two or three ByteStream
    /// passed as input.
    /// It's possibile to pass 0 as pointer.
    /// The mamory of byte* is allocated.
    ByteStream(ByteStream* b0, ByteStream* b1, ByteStream* b2);

        //##ModelId=3C205AF201F8
    ~ByteStream();

        //##ModelId=3EADC12503D4
    byte* getStream();

        //##ModelId=3EADC1260005
        //##Documentation
        //## Returns a pointer of the stream for output purpose. If there is problems return NULL
        //## \remarks In little endian architecture it is necessary to call endOutputStream()
        //## after the use of the byte* stream in output operations.
    /// Returns a pointer of the stream for output purpose. If there is problems return NULL
    /// \remarks In little endian architecture it is necessary to call endOutputStream()
    /// after the use of the byte* stream in output operations.
    byte* getOutputStream();

        //##ModelId=3EADC126001E
        //##Documentation
        //## This method must be call after the output operation.
    // This method must be called after the output operation.
    void endOutputStream();

        //##ModelId=3C301E8800C7
        //##Documentation
        //## Returns a subset of the current stream. If there is problemas return NULL
        //## \remarks This method don't allocate a new stream structure in memory,
        //## but create only a new ByteStream object that points in the same memory area.
    /// Returns a subset of the current stream. If there is problemas return NULL
    /// \remarks This method don't allocate a new stream structure in memory,
    /// but create only a new ByteStream object that points in the same memory area.
    ByteStream* getSubByteStream(dword first, dword last);

        //##ModelId=3EADC126003A
        //##Documentation
        //## Returns a subset of the current stream. If there is problemas return NULL
        //## \remarks This method allocate a new stream structure in memory.
    /// Returns a subset of the current stream. If there is problemas return NULL
    /// \remarks This method allocate a new stream structure in memory.
    ByteStream* getSubByteStreamCopy(dword first, dword last);

        //##ModelId=3C87744001F6
        //##Documentation
        //## Sets the stream from arguments.
    /// Sets the stream from arguments.
    bool setStream(byte* b, dword dim, bool bigendian, bool memory_sharing = true);

        //##ModelId=3EADC1260157
        //##Documentation
        //## Get the stream from another object of the same type. Don't allocate new memory
    /// Get the stream from another object of the same type. Don't allocate new memory
    bool setStream(ByteStream* b, dword first, dword last);

        //##ModelId=3EADC1260244
        //##Documentation
        //## Copy the stream in argument of dimension dim.
        //## \remarks This method delete old stream and creates a new stream in memory
    /// Copy the stream in argument of dimension dim.
    /// \remarks This method delete old stream and creates a new stream in memory
    void setStreamCopy(byte* b, dword dim);

        //##ModelId=3EADC12602F1
        //##Documentation
        //## Sets a word of the stream with the value of parameter.
    /// Sets a word of the stream with the value of parameter.
    bool setWord(dword start, word value);

        //##ModelId=3EADC12603A5
        //##Documentation
        //## Sets a byte of the stream with the value of parameter.
    /// Sets a byte of the stream with the value of parameter.
    void setByte(dword start, word value);

        //##ModelId=3C0F6BDB0041
        //##Documentation
        //## This method return a byte of the stram in the position byteNumber
    /// This method return a byte of the stram in the position byteNumber
    byte getByte( dword byteNumber );

        //##ModelId=3C18775001BB
        //##Documentation
        //## Get the value in the stream starting from position start and of dim dimension
        //## \param start Start position in the stream of byte
        //## \param dim number of byte (1 oe 2)
        long getValue(dword start, dword dim);
    /// Get the value in the stream starting from position start and of dim dimension
    /// \param start Start position in the stream of byte
    /// \param dim number of byte (1 oe 2)
    long getValue(dword start, word dim);

        //##ModelId=3C87744001D8
        //##Documentation
        //## Gets the dimension of the stream
    /// Gets the dimension of the stream
    dword getDimension();

        //##ModelId=3C87744001EC
    char* printStreamInHexadecimal();

        //##ModelId=3EADC1270079
        //##Documentation
        //## Get type of allocations.
        //## \return True if this ByteStream contains the allocated memory area
        //## for the stream; false if this ByteStream haven't allocated the
        //## memory area but it's only a pointer of this area
    /// Get type of allocations.
    /// \return True if this ByteStream contains the allocated memory area
    /// for the stream; false if this ByteStream haven't allocated the
    /// memory area but it's only a pointer of this area
    bool getMemAllocation();

        //##ModelId=3EADC127009D
    bool isBigendian() const;

        //##ModelId=3EADC12700E8
        //##Documentation
        //## Swap of the stream if the architecture is little endian

    /// Swap of the stream if the architecture is little endian
    void swap();

	//##ModelId=3DC5702E01D1
        //##Documentation
        //## Pointer of the stream
    /// Pointer to the stream
    byte* stream;

	//##ModelId=3EADC125005E
    static dword count_object;

	//##ModelId=3EADC12500B7
    static dword count_object2;

        //##ModelId=3EADC12500CF
    static dword count_object_deleted;

        //##ModelId=3EADC12500F6
    static dword count_object_deleted2;

protected:

        //##ModelId=3EADC127010D
        //##Documentation
        //## Internal use only for memory management
    /// Internal use only for memory management
    void setMemoryAllocated(bool allocated);

        //##ModelId=3EADC12701A5
        //##Documentation
        //## Internal use only for memory management
    /// Internal use only for memory management
    void deleteStreamMemory();

private:

	//##ModelId=3EADC1250121
        //##Documentation
        //## This attribute specifes the number of byte in the stream

    /// This attribute specifes the number of byte in the stream
    dword byteInTheStream;

        //##ModelId=3C877440014B
        //##Documentation
        //## Specifies if the stream is big or little endian
    /// Specifies if the stream is big or little endian
    bool bigendian;

        //##ModelId=3EADC125013B
        //##Documentation
        //## Indicates if there is memory allocated for stream. It could be indicate
        //## that the byte* stream memory area is shared between many ByteStream.
        //## In this case the memory must not be deallocated (when memory_sharing attribute is
        //## true).

    /// Indicates if there is memory allocated for stream. It could be indicate
    /// that the byte* stream memory area is shared between many ByteStream.
    /// In this case the memory must not be deallocated (when memory_sharing attribute is
    /// true).
    bool mem_allocation;

        //##ModelId=3EADC1250171
    bool mem_allocation_constructor;

};
+19 −18
Original line number Diff line number Diff line
@@ -21,7 +21,8 @@
#include "PacketExceptionIO.h"
#include "InputTextFile.h"

namespace PacketLib {
namespace PacketLib
{

//##ModelId=3EADC12201A5
//##Documentation
+5 −4
Original line number Diff line number Diff line
@@ -20,7 +20,8 @@
#include "PacketLibDefinition.h"
#include "PartOfPacket.h"

namespace PacketLib {
namespace PacketLib
{

//##ModelId=3C0F6C1902E3
//##Documentation
+33 −32
Original line number Diff line number Diff line
@@ -18,7 +18,8 @@
#ifndef DEVICE_H
#define DEVICE_H

namespace PacketLib {
namespace PacketLib
{
//##ModelId=3C87743F01CC
//##Documentation
//##	$Date: 2005/03/09 10:57:50 $
Loading