如何从在遗留代码中使用RogueWave抽象出来? [英] How do I abstract away from using RogueWave in legacy code?

查看:94
本文介绍了如何从在遗留代码中使用RogueWave抽象出来?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的任务是从旧版C ++代码库中删除RogueWave组件.为此,我尝试围绕现有组件构建包装器,确保代码功能相同,然后选择另一个类似boost的库来粘贴包装器.

I have been tasked with removing RogueWave components from a legacy C++ codebase. To do so, I am attempting to build wrappers around the existing components, make sure that the code functions the same, and then choose a different library like boost to stick into the wrappers.

我要面对的问题之一是,许多代码库都希望使用指向RogueWave对象的指针.我可以创建一个指向原始RogueWave对象的虚拟Wrapper Object类,但是当代码需要将可修改的指针指向原始对象时,我无法弄清楚如何正确包装该RW对象,例如迭代器项.

One of the problems I am coming against is that much of the codebase expects pointers to RogueWave objects. I can create a dummy Wrapper Object class that points to the original RogueWave object, but I cannot figure out how to correctly wrap pieces of that RW object, such as iterator items when the code expects a modifiable pointer into the original object.

有什么建议或其他建议吗? (注意:我的C ++有点生锈)

Any suggestions, or advice for alternate approaches? (Note: I am a bit rusty on my C++)

推荐答案

大约10年前,我有一个类似的任务,事实证明,我们使用Roguewave进行的大多数工作都是C ++标准的一部分.在大多数情况下,都有直接的C ++标准数据结构可以代替Roguewave的用法.

I had a similar task about 10 years ago, it turned out most of the stuff we used Roguewave for was part of the standard in C++. In most instances there was a direct C++ standard data structure that was able to replace the Roguewave usage.

如果您不能直接替换并且可能使用另一个第三方库或您自己的库,那么JustBoo提到的模式将是理想的选择.

If you can't do a direct replacement and might use yet another 3rd party library or your own library, the patterns that JustBoo mentioned would be ideal.

这篇关于如何从在遗留代码中使用RogueWave抽象出来?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆