14 #ifndef P6IOBUFFER_H__
15 #define P6IOBUFFER_H__ 1
160 #define IF_p6IIoBuffer {0x49DD087D,0x5C56,0x49F1,{0xA7,0x6C,0x5E,0x71,0x7E,0x88,0x04,0x8A}}
162 #define P6PKTCUROFFSET ((P6UINT32) -1)
578 #define IF_p6IPacket {0xBDD25E55,0xFEE7,0x4115,{0xAB,0xB2,0xD5,0xA9,0x18,0xD1,0x94,0x50}}
582 static const P6IOBFFLAGS P6IOBF_NOFLAGS = 0x00000000;
583 static const P6IOBFFLAGS P6IOBF_USEHEAP = 0x00000001;
584 static const P6IOBFFLAGS P6IOBF_ZEROMEM = 0x00000002;
585 static const P6IOBFFLAGS P6IOBF_SETFREEMEM = 0x00000004;
586 static const P6IOBFFLAGS P6IOBF_ENABLEFENCES = 0x00000008;
660 #define IF_p6IIoBufferFactory {0x56ABFCAE,0xFCBD,0x438F,{0xBD,0x94,0x04,0x67,0x70,0x0B,0xDF,0xA1}}
663 #define COMP_p6IoBufferFactory {0x5A234D2E,0xFFA9,0x4022,{0xA3,0x7E,0x4E,0xF5,0x76,0xF1,0x10,0xEA}}
virtual P6R::P6ERR getUsed(P6R::P6UINT32 *pcBytesInUse)=0
Retrieves the number of bytes in-use in the packet buffer.
virtual P6R::P6ERR setDestAddr(P6R::P6NETADDR *pAddr)=0
Stores the specified P6NETADDR in the packet as the destination address meta-data.
virtual P6R::P6ERR set64(const P6R::P6UINT64 val, const P6R::P6UINT32 nOffset, P6R::P6UINT32 *pUsed)=0
Writes or appends a 64 bit value into the packet.
virtual P6R::P6ERR consume(P6R::P6UINT32 cSize)=0
Consumes the specified number of bytes of data, adjusting the reported amount of data used accordingl...
P6R::P6UINT32 P6IOBFFLAGS
virtual P6R::P6ERR appendStr(const P6R::P6CHAR *pszString, const P6R::P6UINT32 nOffset, P6R::P6UINT32 *pUsed)=0
Appends the specified NULL terminated narrow ascii string to the the I/O buffer, begining at the curr...
virtual P6R::P6ERR initialize(const P6R::P6WCHAR *pwszFactoryName, P6R::P6UINT32 cBufferSize, P6R::P6UINT32 cInitial, P6R::P6UINT32 cGrowby, P6R::P6IOBFFLAGS fFlags)=0
Initialized the factory for use.
virtual P6R::P6ERR append(const P6R::P6UINT8 *pBuffer, P6R::P6UINT32 cBuffer, const P6R::P6UINT32 nOffset, P6R::P6UINT32 *pUsed)=0
Appends the specified data to the packet, begining at the current packet offset and increments the cu...
virtual P6R::P6ERR set8(const P6R::P6UINT8 val, const P6R::P6UINT32 nOffset, P6R::P6UINT32 *pUsed)=0
Writes or appends an 8 bit value into the packet.
virtual P6R::P6ERR getUsed(P6R::P6UINT32 *pcBytesInUse)=0
Returns the number of bytes in the buffer which are taken up by data.
virtual P6R::P6ERR get8(P6R::P6UINT8 *pVal, const P6R::P6UINT32 nOffset)=0
Gets an 8 bit value from the specified offset or from the current offset.
This factory interface is responsible for creating and managing memory pooled Io Buffers (p6IIoBuffer...
virtual P6R::P6ERR set32(const P6R::P6UINT32 val, const P6R::P6UINT32 nOffset, P6R::P6UINT32 *pUsed)=0
Writes or appends a 32 bit value into the packet.
virtual P6R::P6ERR setSourceAddr(P6R::P6NETADDR *pAddr)=0
Stores the specified P6NETADDR in the packet as the source address meta-data.
virtual P6R::P6ERR getBufPtr(P6R::P6UINT8 **ppBuffer, P6R::P6UINT32 *pcSize, P6R::P6UINT32 *pcUsed)=0
Returns a pointer to the p6IIoBuffer's internal buffer.
virtual P6R::P6ERR set16(const P6R::P6UINT16 val, const P6R::P6UINT32 nOffset, P6R::P6UINT32 *pUsed)=0
Writes or appends a 16 bit value into the packet.
virtual P6R::P6ERR size(P6R::P6UINT32 *pcSize)=0
Returns the total size of the buffer in bytes.
virtual P6R::P6ERR size(P6R::P6UINT32 *pcSize)=0
Retrieves the size of packet buffer in bytes.
unsigned short int P6UINT16
P6COM runtime interfaces definitions.
wchar_t P6WCHAR
Wide character type see p6i18n.h.
virtual P6R::P6ERR setUsed(P6R::P6UINT32 cBytesInUse)=0
This method sets the number of bytes in-use in the buffer.
virtual P6R::P6ERR alloc(P6R::p6IIoBuffer **ppBuffer)=0
This method allocates a p6IIoBuffer from the pool and returns it to the caller.
The base interface all [p6]COM components must derive from and implement.
P6COM base interface definitions.
virtual P6R::P6ERR getDestAddr(P6R::P6NETADDR *pAddr)=0
Gets the destination address meta-data frok the packet.
p6IErrorInfo interface definition
virtual P6R::P6ERR getStats(P6R::P6UINT32 *pcBlock, P6R::P6UINT32 *pcActual, P6R::P6UINT32 *pcInitial, P6R::P6UINT32 *pcGrowby, P6R::P6UINT32 *pcTotal, P6R::P6UINT32 *pcFree, P6R::P6UINT32 *pcHighWater)=0
Retrieves current statistical information for the buffer factories underlying memory pool...
virtual P6R::P6ERR setUsed(P6R::P6UINT32 cBytesInUse)=0
Set the number of bytes taken up by data in the buffer.
virtual P6R::P6ERR appendStr(const P6R::P6CHAR *pszString, const P6R::P6UINT32 nOffset, P6R::P6UINT32 *pUsed)=0
Appends the specified NULL terminated narrow ascii string to the the I/O buffer, begining at the curr...
virtual P6R::P6ERR reset()=0
Resets the current packet offset back to the begining.
virtual P6R::P6ERR get64(P6R::P6UINT64 *pVal, const P6R::P6UINT32 nOffset)=0
Gets a 64 bit value from the specified offset or from the current offset.
virtual P6R::P6ERR getSourceAddr(P6R::P6NETADDR *pAddr)=0
Gets the source address meta-data frok the packet.
virtual P6R::P6ERR append(const P6R::P6UINT8 *pBuffer, P6R::P6UINT32 cBuffer, const P6R::P6UINT32 nOffset, P6R::P6UINT32 *pUsed)=0
Appends the specified data to the packet, begining at the current packet offset and increments the cu...
virtual P6R::P6ERR consume(P6R::P6UINT32 cSize)=0
Consumes the specified number of bytes of data, adjusting the reported amount of data used accordingl...
virtual P6R::P6ERR extract(P6R::P6UINT8 *pBuffer, P6R::P6UINT32 cBuffer, const P6R::P6UINT32 nOffset)=0
Gets the specified number of bytes from the packet and stores them in the provided buffer...
virtual P6R::P6ERR get16(P6R::P6UINT16 *pVal, const P6R::P6UINT32 nOffset)=0
Gets a 16 bit value from the specified offset or from the current offset.
P6R Component runtime helper macros, templated, etc.
A generic memory-pooled binary packet component.
virtual P6R::P6ERR seek(P6R::P6UINT32 nOffset)=0
This method changes the packets current offset to the specified offset.
virtual P6R::P6ERR get32(P6R::P6UINT32 *pVal, const P6R::P6UINT32 nOffset)=0
Gets a 32 bit value from the specified offset or from the current offset.
char P6CHAR
Narrow character type.
virtual P6R::P6ERR copyData(P6R::p6IPacket *pSourcePacket, P6R::P6UINT32 nSourceOffset, P6R::P6UINT32 cSourceLength)=0
This method is used to copy bytes into the current packet, starting at the current offset from the sp...