At first, MAP inference can have many implementations. I was thinking two ways: One is let all implementations inherit from MAPInference, and user call derived class. Another way is keeping a CMAPInferImpl pointer in MAPInference, and create implementation instance according to user's input, i.e. "TreeMaxProduct".

And because in implementation class, I may want to use STL, so I'd like MAPInfernece keep an opaque pointer CMAPInferImpl* , and hide implementation in other files. 

Do you think this is the right way to handle this?