Content Addressable Memories (CAMs) are widely used in nowadays router applications due to their fast bit searching capabilities. However, address loop-up operation cannot still keep up with high data-rate speeds of optical packet payload due to the limited speeds offered by electronic technology, which hardly can reach a few GHz. Despite this limitation, optics has still not managed to penetrate in the area of address look-up and forwarding operations due to the complete lack of optical CAM-based solutions. To the best of our knowledge, the first all-optical binary CAM cell has been only recently experimentally demonstrated by our group using an all-optical monolithically integrated InP Flip-Flop and an optical XOR gate, revealing error-free operation at 10 Gbps for both Content Addressing and Content Writing operations. In this paper, we extend our previous work by presenting for the first time to our knowledge an all-optical Ternary CAM cell architecture that allows also for a third matching state of "X" or "don’t care", thus adding the necessary searching flexibility required by modern CAM-based solutions for supporting subnet-masked addresses. Moreover, we exploit the optical Ternary CAM cell towards deploying a complete CAM row formed by 4 Ternary CAM cells, demonstrating its operation through VPI simulations at 10 Gbps for an indicative 2 bit packet address and for both Content Addressing and Content Writing functionalities. The potential of this memory architecture to allow for up to 40 Gbps operation could presumably lead to fast CAM-based routing applications by enabling all-optical Address Lookup schemes.