Bitwise OR => to "set" or "turn on" a "flag"
Bitwise AND => used to check the state(0/1) of a flag in your flags variable
Bitwise XOR => used to toggle the flag bits of a MASK in your flags variable
Bitwise NOT => used to toggle the bits
Left Shift => Multiply 2
Right Shift => Divide by 2
ref: