Go to file
Florent Rougon 46f39d5fbd zlibstream classes: add constructors with sink semantic based on std::unique_ptr
Add an alternate constructor to each of the following classes:
ZlibAbstractIStreambuf, ZlibCompressorIStreambuf,
ZlibDecompressorIStreambuf, ZlibCompressorIStream and
ZlibDecompressorIStream. These new constructors are passed the source
std::istream wrapped inside an std::unique_ptr instead of by reference,
and store the unique_ptr object as an instance member. This ensures that
the source std::istream object is available as long as the
ZlibDecompressorIStreambuf, etc. instance is alive (which is necessary
for its getInputData() method) without any additional work for callers,
and that it is automatically destroyed afterwards.

This is particularly useful when writing functions that create and
return an object 'zobj' whose type is a subclass of
ZlibAbstractIStreambuf, when the source std::istream is only of interest
for its role of feeding data to 'zobj'. For instance:

std::unique_ptr<simgear::ZlibCompressorIStream>
myZlibCompressorIStreamProducer(std::string str)
{
  std::unique_ptr<std::istringstream> iss(new std::istringstream(str));

  return std::unique_ptr<simgear::ZlibCompressorIStream>(
    new simgear::ZlibCompressorIStream(std::move(iss))); // new ctor here
}

Callers of such a function get access to a new ZlibCompressorIStream
instance fed by an std::istringstream object ('iss'), but they don't
even have to know this detail, nor to take any measure to ensure that
'iss' lives at least as long as the ZlibCompressorIStream object. The
std::unique_ptr<std::istream> pointing to 'iss' and stored as a member
of the ZlibCompressorIStream object by its constructor automatically
takes care of this lifetime problem.
2017-02-24 22:51:21 +01:00
3rdparty Fix VS2015 compilation 2016-05-31 13:40:32 +01:00
CMakeModules Add the proper SSE options to Clang too 2016-12-16 11:05:03 +01:00
package Remove plib reference 2012-08-28 13:04:25 +02:00
simgear zlibstream classes: add constructors with sink semantic based on std::unique_ptr 2017-02-24 22:51:21 +01:00
.gitignore Remove temporary file and add to .gitignore 2013-09-07 14:28:46 +02:00
AUTHORS Added Curt to empty Authors file as CVS test. 2001-12-11 22:23:25 +00:00
ChangeLog Let the version number reflect the current state of the release process. 2010-01-21 06:15:18 +01:00
CMakeLists.txt There is still a segmenttion fault issue with the AVX code, disable it until this is sorted out 2017-01-26 14:46:36 +01:00
COPYING Fix rpmlint/Linux packager complaints 2012-05-05 00:30:16 +02:00
Doxyfile Lots of (mostly) doxygen fixes/cleanup. 2014-08-01 00:13:25 +02:00
DoxygenMain.cxx - Tweaks to doxygen main page. 2003-06-11 18:55:36 +00:00
INSTALL Remove plib dep references from documentation files 2012-08-29 12:08:27 +02:00
NEWS Attempt to sort out the version number mess in preparation for a 1.9.0 release. 2008-12-19 20:39:59 +00:00
README Update README/INSTALL documentation. 2012-06-26 22:43:48 +02:00
README.cmake Remove plib dep references from documentation files 2012-08-29 12:08:27 +02:00
README.OpenAL Remove a couple of lingering alut references. 2012-08-21 19:25:33 +01:00
README.OSG Update README/INSTALL documentation. 2012-06-26 22:43:48 +02:00
README.zlib Updates to remove unneeded and old version of zlib source. 2006-03-23 21:59:59 +00:00
SimGear.spec.in For building redhat packages. 2000-03-29 00:00:46 +00:00
SimGearConfig.cmake.in Export the symbol ENABLE_SIMD for FG to build with the same setting. 2017-02-07 00:02:39 +01:00
Thanks SimGear: Typo in Thanks file 2007-07-23 22:00:31 +00:00
version new version: 2017.2.0 2017-02-20 18:52:12 +01:00

SimGear - Simulator Construction Tools
======================================
http://www.flightgear.org

SimGear is a set of open-source libraries designed to be used as building
blocks for quickly assembling 3d simulations, games, and visualization
applications.

SimGear is developed by the FlightGear project and also provides the base
for the FlightGear Flight Simulator.

Source code for SimGear is released under the GNU Library General Public
License (LGPL) - see COPYING for license details.

See INSTALL file for help on building SimGear.