title: Find if object belongs to class in C++
body: <p>I'm trying to make my own CBGE (Component Based Game Engine) in C++ but i am stuck at this question: How to i find if an Object belongs a specific class? Or equivalent with pointers, how do i find if an pointer points to an object of a specific class? Let me give an example:</p>
  
  <p>I have this somewhere in my code:</p>
  
  <pre><code>//ComponentManager.h
  ...
  std::map&lt;rUUID, std::vector&lt;Component*&gt;&gt; bucket;
  ...
  </code></pre>
  
  <p>where rUUID is a class that represents an UUID and Component is an abstract class that
  represents all type of components an Entity can have.</p>
  
  <p>Now how can i get a specific type of Component (e.x. PositionComponent) for a given rUUID?</p>
  
  <p>Also can somebody tell me if this type of design is good or bad practice and if so how
  should it be formed?</p>