Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
p6crc32.h
Go to the documentation of this file.
1 
10 #ifndef P6CRC32_H__
11 #define P6CRC32_H__ 1
12 
13 #include "p6com.h"
14 
15 namespace P6R {
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
31 const P6CRC32FLAGS P6CRC32_NOFLAGS = 0x00000000;
32 const P6CRC32FLAGS P6CRC32_USEDEFAULTS = 0x00000001;
33 
34 
44 interface p6ICRC32 : p6ICom
45 {
73  P6COMMETHOD initialize( P6CRC32FLAGS flags,
74  P6UINT32 polynomial,
75  P6UINT32 initValue,
76  P6UINT32 finalXOR,
77  P6BOOL reflected
78  ) = 0;
79 
109  P6COMMETHOD reset( P6CRC32FLAGS flags,
110  P6UINT32 polynomial,
111  P6UINT32 initValue,
112  P6UINT32 finalXOR,
113  P6BOOL reflected
114  ) = 0;
115 
133  P6COMMETHOD firstBlock( P6UINT8* pBlock, P6UINT32 blockSize ) = 0;
134 
149  P6COMMETHOD nextBlock( P6UINT8* pBlock, P6UINT32 blockSize ) = 0;
150 
164  P6COMMETHOD getCRC( P6UINT32* pCRC32 ) = 0;
165 };
166 
167 // {D198EA72-F5FF-4bf6-9566-AAD292E0FB12}
168 #define IF_p6ICRC32 {0xd198ea72,0xf5ff,0x4bf6,{0x95,0x66,0xaa,0xd2,0x92,0xe0,0xfb,0x12}}
169 
170 // {90A7DE03-1560-4b7c-83A5-F00899AB04D6}
171 #define COMP_p6CRC32 {0x90a7de03,0x1560,0x4b7c,{0x83,0xa5,0xf0,0x8,0x99,0xab,0x4,0xd6}}
172 
173 #ifdef __cplusplus
174 }
175 #endif
176 
177 } // namespace
178 
179 #endif
180 
181 
182 
183 
184 
unsigned int P6UINT32
Definition: p6types.h:40
P6UINT32 P6CRC32FLAGS
P6CRC32FLAGS.
Definition: p6crc32.h:30
bool P6BOOL
Boolean type.
Definition: p6types.h:101
virtual P6R::P6ERR reset(P6CRC32FLAGS flags, P6UINT32 polynomial, P6UINT32 initValue, P6UINT32 finalXOR, P6BOOL reflected)=0
To reuse this object either with the same or different polynomial this function must be called...
unsigned char P6UINT8
Definition: p6types.h:30
const P6CRC32FLAGS P6CRC32_USEDEFAULTS
Definition: p6crc32.h:32
The base interface all [p6]COM components must derive from and implement.
Definition: p6comdef.h:96
const P6CRC32FLAGS P6CRC32_NOFLAGS
Definition: p6crc32.h:31
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...
Cyclic Redundancy Check 32 bits.
Definition: p6crc32.h:44
#define P6COMMETHOD
Definition: p6types.h:872
virtual P6R::P6ERR initialize(P6CRC32FLAGS flags, P6UINT32 polynomial, P6UINT32 initValue, P6UINT32 finalXOR, P6BOOL reflected)=0
This function ensures that this object is in its proper initial state.
virtual P6R::P6ERR getCRC(P6UINT32 *pCRC32)=0
After all buffers have been feed to the firstBlock(), nextBlock(), ..., nextBlock() functions the CRC...
P6COM definitions and interfaces.
virtual P6R::P6ERR firstBlock(P6UINT8 *pBlock, P6UINT32 blockSize)=0
This object allows the caller to pass one or more buffers into the CRC calculation.