Your implementation is a bit off of the other Entity-Component systems I've seen. I recommend taking a look at EntityX. It should give a good idea of what a working implementation looks like.
You could also read these which may help:
Role of systems in entity systems architectureRole of systems in entity systems architecture
Component - Game Programming Patterns
Understanding Component-Entity-Systems
As for some specific code critiques:
- Using templates to manage your component types, not an
enum. This will make for cleaner code. I'd only use anenum(or any numerical type or string) if you were implementing scripting or any runtime-based component system, but that's a whole different issue. Templates just offer better type safety. - Using
std::unique_ptrinstead ofstd::shared_ptr. If you're making copies of entites for whatever reason, you don't want them to share a pointer to the same component. If you're not copying them, you're wasting performance. - Using an ID for an entity and a central system (that holds components tied to a specific ID) instead of
Entityobjects that hold the components themselves.