The Essential Tools Module provides two implementations of RWCString and RWWString. While these different implementations have the same basic API, each features performance characteristics that are tuned to particular usage scenarios.
Table 7 shows the relationship between the two classes.
Classes | Description |
RWStandardCString RWStandardWString |
|
RWCopyOnWriteCString RWCopyOnWriteWString |
|
While these classes can be used directly and even mixed in the same application, it is generally recommended that you use the RWCString and RWWString aliases in your application. Whether RWCString is an alias for RWStandardCString or RWCopyOnWriteCString (and similarly for RWWString) is determined when building the Essential Tools Module Library. If the needs of your application change, you can rebuild SourcePro specifying a different implementation. See Section 3.6.1.1, "RWCString and RWWString Implementation," in Installing and Building Your SourcePro C++ Products for more details.
As a general rule of thumb, if RWCString/RWWString objects are being copied often but modified rarely, RWCopyOnWriteCString/RWCopyOnWriteWString will likely yield improved performance. Otherwise RWStandardCString/RWStandardWString should be preferred in order to take advantage of implementation-specific optimizations. Ultimately, the right choice is whichever implementation provides the best performance and system resource trade-offs for your application.
Copyright © Rogue Wave Software, Inc. All Rights Reserved.
The Rogue Wave name and logo, and SourcePro, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.