#include <context_sound.h>
Public Types | |
enum | { JOKER_ARRAY_SIZE = (NbJoker == 0 ? 1 : NbJoker) } |
Public Member Functions | |
CContextMatcher (uint32 *jokersValues, uint32 randomValue) | |
size_t | getHashValue () const |
bool | operator== (const CContextMatcher &other) const |
Data Fields | |
uint32 | HashValue |
uint32 | JokersValues [JOKER_ARRAY_SIZE] |
uint32 | RandomValue |
|
Definition at line 43 of file context_sound.h.
00044 { 00045 // Size of array : special case for 0 joker because we can't declare array of 0 elements 00046 JOKER_ARRAY_SIZE = (NbJoker == 0 ? 1 : NbJoker) 00047 }; |
|
Definition at line 49 of file context_sound.h. References NLSOUND::CContextMatcher< NbJoker, UseRandom, Shift >::HashValue, NLSOUND::CContextMatcher< NbJoker, UseRandom, Shift >::JokersValues, NLSOUND::CContextMatcher< NbJoker, UseRandom, Shift >::RandomValue, uint, and uint32.
00050 : HashValue(0) 00051 { 00052 uint i; 00053 for (i=0; i<NbJoker; ++i) 00054 { 00055 JokersValues[i] = jokersValues[i]; 00056 00057 uint leftShift = (5*i)&0x1f; 00058 HashValue ^= JokersValues[i] << leftShift; 00059 HashValue ^= JokersValues[i] >> (32-leftShift); 00060 } 00061 if (UseRandom) 00062 { 00063 RandomValue = randomValue; 00064 uint leftShift = (5*i)&0x1f; 00065 HashValue ^= randomValue << leftShift; 00066 HashValue ^= randomValue >> (32-leftShift); 00067 } 00068 else 00069 RandomValue = 0; 00070 } |
|
Definition at line 82 of file context_sound.h. References NLSOUND::CContextMatcher< NbJoker, UseRandom, Shift >::HashValue. Referenced by NLSOUND::CContextMatcher< NbJoker, UseRandom, Shift >::CHash::operator()().
00083 {
00084 return size_t(HashValue);
00085 }
|
|
Definition at line 72 of file context_sound.h. References NLSOUND::CContextMatcher< NbJoker, UseRandom, Shift >::HashValue, NLSOUND::CContextMatcher< NbJoker, UseRandom, Shift >::JokersValues, NLSOUND::CContextMatcher< NbJoker, UseRandom, Shift >::RandomValue, and uint32.
00073 { 00074 if (HashValue != other.HashValue) 00075 return false; 00076 else if (UseRandom) 00077 return RandomValue == other.RandomValue && memcmp(JokersValues, other.JokersValues, sizeof(uint32)*NbJoker) == 0; 00078 else 00079 return memcmp(JokersValues, other.JokersValues, sizeof(uint32)*NbJoker) == 0; 00080 } |
|
|
Definition at line 88 of file context_sound.h. Referenced by NLSOUND::CContextMatcher< NbJoker, UseRandom, Shift >::CContextMatcher(), and NLSOUND::CContextMatcher< NbJoker, UseRandom, Shift >::operator==(). |
|
Definition at line 89 of file context_sound.h. Referenced by NLSOUND::CContextMatcher< NbJoker, UseRandom, Shift >::CContextMatcher(), and NLSOUND::CContextMatcher< NbJoker, UseRandom, Shift >::operator==(). |