Design and investigation of semiconductor waveguide structures with grating couplers used as all-optical switches