Quantum theory of measurement