A class for logic gates