How to go ahead with methods that only one derived class implements from a common interface?

I have one interface (let’s say in C++) that has been implemented by some derived classes. Let’s suppose that the interface is like this:

class IBase {   virtual bool method_1() = 0;   virtual long method_2(const std::string str) = 0;   // other methods   virtual long method_10(int value) = 0; }; 

and up to now 6 different derived classes (will be more in future) have implemented the interface. In lots of algorithms in my code, I have used this interface polymorphically. e.g:

// some usage obj = getObject(); if (obj->method_1()) {   return obj->method_2("Hello"); } else {   return obj->method_10(12); } 

Over the time, I have found that there would be lots of methods that only one derived class implements them. So, the Q is that is it the right design to put these methods in the interface or should I put them directly in the derived classes? But note that:

  • If I put them in the interface, only one derived class will implement them and for the rest of the derived classes the implementation will be empty.
  • If I put them in the derived classes, my implemented algorithms will not be generic anymore and I need to check the type of the derived class during my algorithm implementation.

What is the right way to go ahead in this case?