Physics of All-Optical Switching Devices