OK, so now, no playing around, show us exactly what the assignment question is, otherwise just green tick and we can all move on.
By the sound of it you have to model AND, OR gates and stuff like that. If that’s the case then nothing so far looks anything like it. 300 lines - no way.
So where’s the official question/assignment please.
Why is Component a template? If it must be a template then shouldn't it be setState(T&) rather than setState(bool)?
Component has two abstract functions: logicFunction() and setState() In class Not, you have defined logicFunction() but not setState(). That's why you got the "invalid new-expression of abstract class type 'Not' " error.
What are members _lh and _hl? Why do you store the previous state? Is it because you need to model propagation delay, setup and hold times?
You assume that a component has just one input and one output. It may be better to make these more general: