Bit-based nValid testing.
The bitwise operator AND( &) means a bitwise number, the operator performs a comparison AND. So, if nValid is a byte (8-bit) value, then look at the operation in binary format:
nValue & 0b00000001
If nValue is 42, the operation will look like this:
(nValue = 0b00101010) & 0b00000001 => 0b00000000
(nValue & 0b00000001) == 0b00000001
and for the second ( nValid & 0x2)
(nValue = 0b00101010) & 0b00000010 => 0b00000010
(nValue & 0b00000010) == 0b00000010
; AND OR .
0b00001000 | 0b00000010 | 0b00000001 => 0b00001011