XCube Stream Reader SDK
x3c/include/X3cPacket.h
00001 /*
00002  * X3cPacket.h
00003  *
00004  *  Created on: Oct 28, 2010
00005  *      Author: nilham
00006  */
00007 
00008 #ifndef X3CPACKET_H_
00009 #define X3CPACKET_H_
00010 
00011 #include "CX3cFile.h"
00012 //#include "xcTypes.h"
00013 
00014 class X3cPacket
00015 {
00016 public:
00017         /*
00018          * Wrapper class for X3C packets.
00019          * Empty instance is created.
00020          */
00021         X3cPacket();
00022         /*
00023          * Wrapper class for X3C packets.
00024          * Populated instance is created.
00025          *
00026          * Set the flag 'mustClean' to 'true' if the parameters
00027          * shall be deleted when the object is destroyed.
00028          */
00029         X3cPacket(X3C_PACKET_HEADER *packet_header, char *pData, bool mustClean);
00030 
00031     /*
00032      * Wrapper class for X3C packets.
00033      * Populated instance is created.
00034      *
00035      * Same as above but also passes in the packet file position
00036      */
00037     X3cPacket(X3C_PACKET_HEADER *packet_header, char *pData, bool mustClean, UINT64 position);
00038 
00039         /*
00040          * Wrapper class for X3C packets.
00041          * Populated instance is created.
00042          *
00043          * This constructor shall be replaced with the one above.
00044          */
00045         X3cPacket(X3C_PACKET_HEADER *packet_header, char *pData) __attribute__ ((deprecated));
00049         X3cPacket(UINT64 timeStamp);
00050         virtual ~X3cPacket();
00051         /*
00052          * Get the header part of the packet.
00053          */
00054         X3C_PACKET_HEADER *getHeader();
00055         /*
00056          * Get the length of the data in the packet.
00057          * Also available through the header data.
00058          */
00059         UINT32 getLen();
00060         /*
00061          * Get the timestamp for the packet.
00062          */
00063         UINT64 getTimestamp();
00064         /*
00065          * Set timestamp for the packet.
00066          */
00067         void setTimestamp(UINT64 timeStamp);
00068         /*
00069          * Get a pointer to the data in the packet.
00070          */
00071         char *getData();
00072 
00073         /*
00074          * Get the file position for this packet
00075          */
00076         UINT64 getPosition();
00077 
00078 private:
00079         X3C_PACKET_HEADER *xph;
00080         char *data;
00081         UINT64 timeStamp;
00082         bool mustClean;
00083         UINT64 position;
00084 };
00085 
00086 #endif /* X3CPACKET_H_ */
 All Classes Files Functions Variables Typedefs Friends Defines