An operator-based approach to topological photonics