A structural approach to detectability for a class of hybrid systems