Is there any way to get the Derived Class Name from static Keyword ? What I actually want to do is.
Make a Reflection of the Derived Class
Check Wheather it implements the Specified Class or not
I've a static method the Base Class say its named Base::check()
I want Base::check()
will check for the existence of the Interface Implementation.
the check() method knows the name of the interface.so I don't need to tell it from outer world.
But if there is no way to get DerivedClassName from static Keyword I need to pass the Class Name to the method from the outer world. Which is not a good Coding Principle.
Another Alternative I can do is. I can make an ::instance()
static method that returns the this
and I can do a get_class from its return. But this also tweeks my Application Principle.
So is the first method really possible ? or I need to go for some alternative of this kind ? Or Do you have any other kind of Alternatives ?