开发者

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

开发者 https://www.devze.com 2023-03-02 23:37 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: How do you declare an interface in C++?
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

精彩评论

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

关注公众号