title: Overriding a method to extend existing function
body: <p>I have a class <code>Child</code>, inheriting from class <code>Parent</code>. Class <code>Parent</code> has a virtual protected method <code>_parentClassMethod(int a, int b)</code>. This method is used in a method of class <code>Child</code>:</p>
  
  <pre><code>void Child::_childClassMethod(int c, int d)
  {
  //some code
  _parentClassMethod(int a, int b);
  //some more code
  }
  </code></pre>
  
  <p>My problem is: in <code>_parentClassMethod</code>, there is a function call I need to do differently when called from <code>Child</code> class. I am blanking out but is there a better way to do it other than redefining the entire <code>_parentClassMethod</code> in <code>Child</code> class?</p>
  
  <p>Definition of the parentClassMethod:</p>
  
  <pre><code>void Parent::_parentClassMethod(int a, int b){
  //lots of other code
  setSomethingFunction(val1, val2, val3);/*this function cannot be made virtual since it               writes to the eeprom of a device*/
  //lot more code
  }
  </code></pre>