Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
p6crc16.h
Go to the documentation of this file.
1 
10 #ifndef P6CRC16_H__
11 #define P6CRC16_H__ 1
12 
13 #include "p6com.h"
14 
15 namespace P6R {
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
31 const P6CRC16FLAGS P6CRC16_NOFLAGS = 0x00000000;
32 const P6CRC16FLAGS P6CRC16_USEDEFAULTS = 0x00000001;
33 
34 
44 interface p6ICRC16 : p6ICom
45 {
72  P6COMMETHOD initialize( P6CRC16FLAGS flags,
73  P6UINT16 polynomial,
74  P6UINT16 initValue,
75  P6UINT16 finalXOR,
76  P6BOOL reflected
77  ) = 0;
78 
107  P6COMMETHOD reset( P6CRC16FLAGS flags,
108  P6UINT16 polynomial,
109  P6UINT16 initValue,
110  P6UINT16 finalXOR,
111  P6BOOL reflected
112  ) = 0;
113 
131  P6COMMETHOD firstBlock( P6UINT8* pBlock, P6UINT32 blockSize ) = 0;
132 
148  P6COMMETHOD nextBlock( P6UINT8* pBlock, P6UINT32 blockSize ) = 0;
149 
163  P6COMMETHOD getCRC( P6UINT16* pCRC16 ) = 0;
164 };
165 
166 
167 // {49EAB11F-F78E-4360-A4FF-F02CEC488F42}
168 #define IF_p6ICRC16 {0x49eab11f,0xf78e,0x4360,{0xa4,0xff,0xf0,0x2c,0xec,0x48,0x8f,0x42}}
169 
170 // {84041833-27D7-4be5-BE40-F90910F1E682}
171 #define COMP_p6CRC16 {0x84041833,0x27d7,0x4be5,{0xbe,0x40,0xf9,0x9,0x10,0xf1,0xe6,0x82}}
172 
173 #ifdef __cplusplus
174 }
175 #endif
176 
177 } // namespace
178 
179 #endif
180 
181 
182 
183 
virtual P6R::P6ERR firstBlock(P6UINT8 *pBlock, P6UINT32 blockSize)=0
This object allows the caller to pass one or more buffers into the CRC calculation.
virtual P6R::P6ERR reset(P6CRC16FLAGS flags, P6UINT16 polynomial, P6UINT16 initValue, P6UINT16 finalXOR, P6BOOL reflected)=0
To reuse this object either with the same or different polynomial this function must be called...
const P6CRC16FLAGS P6CRC16_USEDEFAULTS
Definition: p6crc16.h:32
unsigned int P6UINT32
Definition: p6types.h:40
virtual P6R::P6ERR initialize(P6CRC16FLAGS flags, P6UINT16 polynomial, P6UINT16 initValue, P6UINT16 finalXOR, P6BOOL reflected)=0
This function ensures that this object is in its proper initial state.
bool P6BOOL
Boolean type.
Definition: p6types.h:101
const P6CRC16FLAGS P6CRC16_NOFLAGS
Definition: p6crc16.h:31
Cyclic Redundancy Check 16 bits.
Definition: p6crc16.h:44
unsigned char P6UINT8
Definition: p6types.h:30
unsigned short int P6UINT16
Definition: p6types.h:34
The base interface all [p6]COM components must derive from and implement.
Definition: p6comdef.h:96
virtual P6R::P6ERR getCRC(P6UINT16 *pCRC16)=0
After all buffers have been feed to the firstBlock(), nextBlock(), ..., nextBlock() functions the CRC...
virtual P6R::P6ERR nextBlock(P6UINT8 *pBlock, P6UINT32 blockSize)=0
If computing a CRC over multiple buffers, then this function must be called for the 2nd and all follo...
#define P6COMMETHOD
Definition: p6types.h:872
P6COM definitions and interfaces.
P6UINT32 P6CRC16FLAGS
P6CRC16FLAGS.
Definition: p6crc16.h:30