开发者

c++ design pattern question. single interface multiple implementations? [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:

How do you declare an interface in C++?

Hi,

What's the preferable way to create single interface and multiple implementations in c++?

For example开发者_如何学C, I'd like to implement kqueue for mac and epoll for linux and share the interface.

Thank you


The Strategy Pattern is probably what you are looking for.
The Abstract Factory Pattern can help you fill in the right implementation when starting up.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜