add anonymous class creation, using interface as template in c++, abstract all defination and access