STLSoft C++ Libraries

From Wikipedia, the free encyclopedia
  (Redirected from STLSoft)
Jump to: navigation, search
STLSoft C++ Libraries
Stlsoft.png
Stable release 1.9.111 / November 11, 2011; 2 months ago (2011-11-11)
Written in C/C++
Operating system MS-Windows, Unix, partially Cross-platform
Type STL extension, Facades
License BSD-form license
Website http://stlsoft.org/

The STLSoft C++ Libraries are a collection of open source C++ template libraries that extend the functionality of the Standard Template Library (STL) and provide facades that wrap operating-system and technology-specific APIs. STLSoft is licensed under a BSD-form license which allows it to be used with both open and closed source projects. STLSoft aims their library to be lightweight and having high portability, high performance, minimal coupling and high cohesion.[1]

Contents

[edit] History

Over the last half a decade or so,[2]:p.xxxiv Matthew Wilson has been developing the STLSoft open source C++ template libraries to support the creation of both free and commercial software. Many parts of the libraries are derived from proprietary Synesis Software code.[3]:p.565. In 2008 Wilson remained the main author of the STLSoft libraries.[4]

[edit] Implementation

STLSoft is written in C++, but it also contains parts that can be used with C. The libraries use templates and rely on compile-time polymorphism. The STLSoft libraries are header-only: the library code is included in and compiled with the user's code. This makes installation and usage of the libraries relatively easy.

[edit] Supported platforms/compilers

STLSoft libraries cover operating systems such as:

with some of them supported in both 32-bit and 64-bit versions.

STLSoft supports compilers such as:

[edit] Projects and libraries

STLSoft is not a framework. STLSoft components are meant to be used as building blocks for higher level components such as applications, classes, libraries and servers.

STLSoft consists of several projects:

  • ACESTL (applies STL concepts to some components of the Adaptive Communication Environment (ACE) library)
  • ATLSTL (applies the STL concepts to Active Template Library (ATL))
  • COMSTL (provides utilities to work with the Component Object Model (COM) and provides STL-compatible sequence adapters over the COM enumeration and COM collection concepts)
  • .netSTL
  • InetSTL (applies the STL concepts to Internet programming)
  • MFCSTL (makes using the Microsoft Foundation Classes (MFC) more STL-like)
  • PlatformSTL (facilitates writing platform-agnostic code)
  • RangeLib (STLSoft implementation of the range concept)
  • STLSoft (contains most platform- and technology-independent code and code that helps to take care of compiler and standard library differences)
  • UNIXSTL (*)
  • WinSTL (*)
  • WTLSTL (applies the STL concepts to Windows Template Library (WTL))

(*) UNIXSTL and WinSTL provide operating-system and technology-specific components for Unix and Windows operating systems. These two projects have a number of structural conformant components, such as environment_variable, path and thread_mutex that are also placed in the PlatformSTL project (see also subsection Techniques).

Each of projects contains components from many different libraries; there are 30 libraries in STLSoft, including File System Library, Performance Library, and Synchronisation Library.

[edit] Techniques and concepts

Many ideas and techniques that STLSoft uses are described in Imperfect C++[3] and in Extended STL, Volume 1.[2]

[edit] Namespace aliasing

One such technique is namespace aliasing. It is used to reduce the extent to which namespaces must be specified in the library code itself.[2]:p.xxxv.[5]

For example, the COMSTL project's namespace, comstl, is actually an alias for the nested namespace stlsoft::comstl_project. This allows all COMSTL project components to 'see' all STLSoft project components (that are defined within the top-level stlsoft namespace), without having to use them.

[edit] Intersecting conformance

With cross-platform libraries, common approaches to provide identical behavior across different platforms or technology areas are 1) to emulate functionality missing from some platforms and 2) to provide only functionality common to all platforms. STLSoft approaches cross-platform support as follows: where similar behavior across platforms is available, structural conformance is employed in its implementation, but where functionality is different structural conformance is avoided. Wilson names this the principle of intersecting conformance. Thus STLSoft provides a common interface for functionality that is available across platforms or technology areas and at the same time does not limit the functionality when programming for the native system only.[1][2]:pp. 57-64

[edit] Other techniques

Other notable techniques include:

  • Shims and type tunneling, which are used to reduce coupling between and to increase cohesion within the library's components[1][6]
  • Inferred Interface Adaptation, which can be used to correct/enhance a type's member types to allow it to fulfil structural conformance requirements of a template that it can then specialize.[7]
  • zero-performance cost, 1-byte-per-class cost, C++ Properties, described in Chapter 35 of Imperfect C++[3]:pp.530-562.
  • Principle of Irrecoverability, which observes that any failure to adhere to the design of a constituent component of a software system must be interpreted as a failure to adhere to the design of the system as a whole. Systems in such a state must be closed down. The STLSoft component stlsoft::unrecoverable is a base exception class of a family of unrecoverable exceptions - they may be caught and rethrown, but they may not be quenched without causing the process to be terminated
  • Extensive use of efficient utility classes, such as auto_buffer, and scoped_handle help to attain high performance.[1]

[edit] Criticisms

The documentation accompanying the STLSoft libraries consists of Doxygen generated reference documentation that includes a partially completed overview of the library contents and of the concepts, patterns, principles and techniques that it uses. In addition to this, the documentation contains circa twenty example programs that show how to use various components of the library, but that do not contain an explanation of the component's usage.[1] There is no user documentation with a tutorial or a thematic approach (Getting Started guide). Detailed treatment of the design and implementation of several components is contained within both of Wilson's books - Imperfect C++ (2004)[3] and Extended STL, volume 1 (2007)[2] - but the coverage is arbitrary and does not include all the libraries, or all the projects. The necessity to improve the documentation is recognized though.[8]

[edit] Projects that use STLSoft

  • b64 Base-64 conversion library
  • FastFormat C/C++ output/formatting library
  • flecxx abstraction harmonizer library
  • Open-RJ Record-Jar API
  • Pantheios C++ logging API library
  • recls recursive file-system search
  • shwild shell-compatible wildcards
  • VOLE C++ COM/Automation driver
  • xContract a contract enforcement library
  • xCover a code coverage library for C and C++
  • xTests Unit testing framework

[edit] See also

[edit] References

  1. ^ a b c d e Wilson, Matthew (1 October 2008), STLSoft Documentation, http://stlsoft.sourceforge.net/documentation.html, retrieved 01 October 2008 
  2. ^ a b c d e Wilson, Matthew (2007), Extended STL, Volume 1: Collections and Iterators, Addison-Wesley, ISBN 0-321-30550-7 
  3. ^ a b c d Wilson, Matthew (2004), Imperfect C++: Practical Solutions for Real-Life Programming, Addison-Wesley, ISBN 0-321-22877-4 
  4. ^ STLSoft Website
  5. ^ Wilson, Matthew (July 2003), "Open-source Flexibility via Namespace Aliasing", C/C++ User's Journal 21 (7), http://www.ddj.com/cpp/184401677 
  6. ^ Wilson, Matthew (August 2003), "Generalised String Manipulation: Access Shims and Type-tunnelling", C/C++ User's Journal 21 (8), http://www.cuj.com/documents/s=8681/cuj0308wilson/ 
  7. ^ Wilson, Matthew (December 2005), "Adapting Interface-Incomplete Types at Compile Time", C/C++ User's Journal, http://www.ddj.com/cpp/184402050 
  8. ^ "Documentation strategy ... opinions welcome (c++.stlsoft)". www.digitalmars.com. http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=c++.stlsoft&artnum=792. Retrieved 2008-05-20.  .

[edit] External links

Personal tools
Namespaces
Variants
Actions
Navigation
Interaction
Toolbox
Print/export