From c729c1ccb2e7d04d4afe46553bd88dae669d579c Mon Sep 17 00:00:00 2001 From: Daniel Nachbaur Date: Mon, 6 Jul 2015 15:24:29 +0200 Subject: [PATCH] Release 1.11 preparations --- .gitignore | 1 + .gitsubprojects | 2 +- CMake/Lunchbox.spec | 4 +- CMake/LunchboxCPack.cmake | 5 +- CMakeLists.txt | 4 +- LICENSE.txt | 2 +- README.md | 90 +++++++++------ doc/CMakeLists.txt | 2 +- doc/Changelog.md | 65 +++++++++++ doc/DoxygenLayout.xml | 184 ------------------------------- doc/README.Win | 3 - doc/RelNotes.md | 108 ------------------ lunchbox/CMakeLists.txt | 7 +- lunchbox/anySerialization.h | 4 +- lunchbox/bitOperation.h | 4 +- lunchbox/file.h | 2 +- lunchbox/leveldb/persistentMap.h | 6 +- lunchbox/log.h | 7 +- lunchbox/monitor.h | 6 +- lunchbox/persistentMap.cpp | 10 +- lunchbox/persistentMap.h | 16 +-- lunchbox/plugin.h | 9 +- lunchbox/pluginFactory.h | 4 +- lunchbox/pluginRegisterer.h | 4 +- lunchbox/requestHandler.cpp | 5 +- lunchbox/requestHandler.h | 6 +- lunchbox/skv/persistentMap.h | 5 +- lunchbox/stdExt.h | 6 +- lunchbox/types.h | 23 ---- tests/anySerialization.cpp | 2 +- tests/issue1.cpp | 4 +- tests/monitor.cpp | 2 +- tests/pluginFactory.cpp | 14 +-- tests/requestHandler.cpp | 6 +- tests/rng.cpp | 10 +- 35 files changed, 203 insertions(+), 429 deletions(-) create mode 100644 doc/Changelog.md delete mode 100644 doc/DoxygenLayout.xml delete mode 100644 doc/README.Win delete mode 100644 doc/RelNotes.md diff --git a/.gitignore b/.gitignore index b722222a..77326612 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ CMakeLists.txt.user* CMake/common build/ ___* +Servus/ diff --git a/.gitsubprojects b/.gitsubprojects index e081b034..667c6172 100644 --- a/.gitsubprojects +++ b/.gitsubprojects @@ -1,2 +1,2 @@ # -*- mode: cmake -*- -git_subproject(Servus https://github.com/HBPVIS/Servus.git 47ea29d) +git_subproject(Servus https://github.com/HBPVIS/Servus.git 0e1db45) diff --git a/CMake/Lunchbox.spec b/CMake/Lunchbox.spec index 54641228..45785ce4 100644 --- a/CMake/Lunchbox.spec +++ b/CMake/Lunchbox.spec @@ -1,5 +1,5 @@ Name: Lunchbox -Version: 1.12.0 +Version: 1.11.0 Release: 1%{?dist} Summary: Multi-threaded C++ toolbox library for all application developers creating high-performance multi-threaded programs. @@ -7,7 +7,7 @@ Group: Development/Libraries License: LGPL URL: http://www.equalizergraphics.com/ Source0: http://www.equalizergraphics.com/downloads/Lunchbox-%{version}.tar.gz -#Patch0: Lunchbox-1.12.0-build-fix.patch +#Patch0: Lunchbox-1.11.0-build-fix.patch BuildRequires: cmake boost-devel %description diff --git a/CMake/LunchboxCPack.cmake b/CMake/LunchboxCPack.cmake index b46b4f54..d7f879e8 100644 --- a/CMake/LunchboxCPack.cmake +++ b/CMake/LunchboxCPack.cmake @@ -6,8 +6,8 @@ mark_as_advanced(LUNCHBOX_PACKAGE_VERSION) set(CPACK_PACKAGE_VENDOR "www.eyescale.ch") set(CPACK_PACKAGE_CONTACT "Stefan Eilemann ") -set(CPACK_PACKAGE_DESCRIPTION_FILE ${PROJECT_SOURCE_DIR}/doc/RelNotes.md) -set(CPACK_RESOURCE_FILE_README ${PROJECT_SOURCE_DIR}/doc/RelNotes.md) +set(CPACK_PACKAGE_DESCRIPTION_FILE ${PROJECT_SOURCE_DIR}/doc/Changelog.md) +set(CPACK_RESOURCE_FILE_README ${PROJECT_SOURCE_DIR}/README.md) set(CPACK_DEBIAN_PACKAGE_DEPENDS "libstdc++6, libboost-regex-dev, libboost-serialization-dev, libavahi-compat-libdnssd1, libhwloc-dev, libturbojpeg") @@ -16,6 +16,5 @@ set(CPACK_MACPORTS_CATEGORY devel) set(CPACK_MACPORTS_DEPENDS boost) set(CPACK_PACKAGE_LICENSE LGPL) -set(CPACK_PACKAGE_LICENSE "LGPL") include(CommonCPack) include(OSSCPack) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c9bdbd0..b91a8b22 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake include(GitExternal) set(VERSION_MAJOR "1") -set(VERSION_MINOR "12") +set(VERSION_MINOR "11") set(VERSION_PATCH "0") set(VERSION_ABI 4) option(LUNCHBOX_BUILD_V2_API @@ -65,6 +65,8 @@ add_subdirectory(lunchbox) add_subdirectory(tests) add_subdirectory(doc) +set(DOXYGEN_MAINPAGE_MD README.md) +set(DOXYGEN_EXTRA_INPUT ${PROJECT_SOURCE_DIR}/README.md) include(DoxygenRule) # must be after all targets include(LunchboxCPack) include(PackageConfig) diff --git a/LICENSE.txt b/LICENSE.txt index b3fdcab0..0d2502d5 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -2,7 +2,7 @@ LunchBox - a cross-platform C++ library for building multithreaded applications. LunchBox is licensed under the LGPL, unless noted otherwise, e.g., for external dependencies. See file LGPL.txt for the full license. External dependencies are either LGPL or BSD-licensed. See file ACKNOWLEDGEMENTS.txt and AUTHORS.txt for further details. -Copyright (C) 2005-2012, Eyescale Software GmbH and AUTHORS +Copyright (C) 2005-2015, Eyescale Software GmbH and AUTHORS This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. diff --git a/README.md b/README.md index e505ff12..4d26d4b2 100644 --- a/README.md +++ b/README.md @@ -1,41 +1,63 @@ -# Lunchbox +[TOC] -Welcome to Lunchbox, a C++ library for multi-threaded -programming. Lunchbox was formerly known as eq::base or co::base, the -foundation for the Equalizer parallel rendering framework and the Collage -network library. It is intended for all application developers creating -high-performance multi-threaded programs. +# Introduction {#Introduction} -## Features +Welcome to Lunchbox, a C++ library for multi-threaded programming. Lunchbox was +formerly known as eq::base or co::base, the foundation for the +[Equalizer parallel rendering framework](https://github.com/Eyescale/Equalizer) +and the [Collage network library](https://github.com/Eyescale/Collage). It is +intended for all application developers creating high-performance multi-threaded +programs. -Lunchbox provides the following major features to facilitate the -development and deployment of multi-threaded applications: -* OS Abstraction: Utility classes abstracting common operating systems - features, e.g., threads, locks, memory maps, shared library loading - and condition variables. -* High-Performance Primitives: Thread-safe utilities tuned for - performance, e.g., atomic variables, spin locks and lock-free - containers. -* Utility classes: Helper primitives which are not in the standard - library, e.g., logging, pools and random number generation. - -## Downloads - -* [Ubuntu Packages Repository](https://launchpad.net/~eilemann/+archive/equalizer/) -* [API Documentation](http://eyescale.github.com/) -* Building from source: +The +[API documentation](http://eyescale.github.io/Lunchbox-1.11/index.html) can be +found on [eyescale.github.io](http://eyescale.github.io/). As with any open +source project, the available source code, in particular the +[unit tests](https://github.com/Eyescale/Lunchbox/tree/1.11/tests) provide a +reference for developing applications. -``` - git clone https://github.com/Eyescale/Buildyard.git - cd Buildyard - git clone https://github.com/Eyescale/config.git config.eyescale - make Lunchbox -``` +Technical questions can be posted to the Equalizer +[Developer Mailing List](http://www.equalizergraphics.com/cgi-bin/mailman/listinfo/eq-dev), +or directly to +[info@equalizergraphics.com](mailto:info@equalizergraphics.com?subject=Lunchbox%20question). -### Version 1.6 +Commercial support, custom software development and porting services are +available from [Eyescale](http://www.eyescale.ch). Please contact +[info@eyescale.ch](mailto:info@eyescale.ch?subject=Lunchbox%20support) +for further information. -* [Source Code](http://www.equalizergraphics.com/downloads/Lunchbox-1.6.0.tar.gz) +# Features {#Features} -### Version 1.4 - -* [Source Code](http://www.equalizergraphics.com/downloads/Lunchbox-1.4.0.tar.gz) +Lunchbox provides the following major features to facilitate the +development and deployment of multi-threaded applications: +* Operating System Abstraction: lunchbox::Atomic, lunchbox::Condition, + lunchbox::DSO, @ref bitops "bit operations", lunchbox::daemonize(), + (lunchbox::Clock, lunchbox::MemoryMap, lunchbox::PerThread, lunchbox::RNG, + lunchbox::Thread) +* High-Performance Threading Primitives: lunchbox::Buffer, lunchbox::LFQueue, + lunchbox::LFVector, lunchbox::Monitor, lunchbox::MTQueue, + lunchbox::RequestHandler, lunchbox::SpinLock, (lunchbox::Lock, + lunchbox::TimedLock) +* Utility classes: lunchbox::Any, lunchbox::Log, lunchbox::Pool, + lunchbox::UnorderedIntervalSet, lunchbox::Future, lunchbox::PersistentMap, + (lunchbox::ScopedMutex) + +# Building {#Building} + +Lunchbox is a cross-platform library, designed to run on any modern operating +system, including all Unix variants and the Windows operating system. Lunchbox +uses CMake to create a platform-specific build environment. The following +platforms and build environments are tested: + +* Linux: Ubuntu 14.04, RHEL 6.6 (Makefile, Ninja) +* Windows: 7 (Visual Studio 2012) +* Mac OS X: 10.8 (Makefile, Ninja) + +~~~ +git clone https://github.com/Eyescale/Lunchbox.git +cd Lunchbox +mkdir build +cd build +cmake .. +make +~~~ diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index dcc767f9..b948ca25 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -1,5 +1,5 @@ # Copyright (c) 2012 Stefan Eilemann -install(FILES RelNotes.md ../AUTHORS.txt ../ACKNOWLEDGEMENTS.txt ../LGPL.txt +install(FILES Changelog.md ../AUTHORS.txt ../ACKNOWLEDGEMENTS.txt ../LGPL.txt ../LICENSE.txt DESTINATION ${DOC_DIR} COMPONENT doc) diff --git a/doc/Changelog.md b/doc/Changelog.md new file mode 100644 index 00000000..50f42663 --- /dev/null +++ b/doc/Changelog.md @@ -0,0 +1,65 @@ +# Changelog + +# Release 1.11 (07-07-2015) {#Release111} + +* [208](https://github.com/Eyescale/Lunchbox/pull/208), + [207](https://github.com/Eyescale/Lunchbox/pull/207): + Pretty log print and denoise +* [206](https://github.com/Eyescale/Lunchbox/pull/206): + Change log level semantics +* [205](https://github.com/Eyescale/Lunchbox/pull/205): + Clean up lunchbox::RNG impl, removed reseed() +* [204](https://github.com/Eyescale/Lunchbox/pull/204): + Added some power of two MB sizes defines +* [200](https://github.com/Eyescale/Lunchbox/pull/200): + Removed uint128_t, URI and Servus from API V2 to + [Servus library](https://github.com/HBPVIS/Servus) +* [193](https://github.com/Eyescale/Lunchbox/pull/193): + lunchbox::PersistentMap Improvements +* [189](https://github.com/Eyescale/Lunchbox/pull/189): + Fix [187](https://github.com/Eyescale/Lunchbox/pull/187): + Package CMake modules in the release tar-ball +* [0026561](https://github.com/Eyescale/Lunchbox/commit/0026561): + Added lunchbox::OMP::getThreadNum +* [178](https://github.com/Eyescale/Lunchbox/pull/178), + [167](https://github.com/Eyescale/Lunchbox/pull/167), + [156](https://github.com/Eyescale/Lunchbox/pull/156): + lunchbox::PluginFactory, a mechanism to register and load plugins +* [177](https://github.com/Eyescale/Lunchbox/pull/177): + Implement lunchbox::getLibraryPath() +* [173](https://github.com/Eyescale/Lunchbox/pull/173): + Move (de)compressor & up/downloader to + [Pression library](https://github.com/Eyescale/Pression) +* [172](https://github.com/Eyescale/Lunchbox/pull/172): + Fix for lunchbox::demangleTypeID +* [171](https://github.com/Eyescale/Lunchbox/pull/171): + Add log topic to log potential bugs +* [163](https://github.com/Eyescale/Lunchbox/pull/163): + LB_LITTLE/BIGENDIAN defines defines +* [158](https://github.com/Eyescale/Lunchbox/pull/158): + Added new comparison methods to Monitor +* [155](https://github.com/Eyescale/Lunchbox/pull/155): + Add lunchbox::getExecutablePath() to find resources based on installation + folder + +# Release 1.10 (09-10-2014) {#Release110} + +* Added API for continuous browsing to lunchbox::Servus +* Added lunchbox::getHostname function +* Added lunchbox::PersistentMap interface for persistent key-value stores +* Added lunchbox::URI parsing support according to RFC3986 +* Added timeout parameter for the Future::wait function +* Improved lunchbox::Servus implementations, supporting continuous browsing and + using the native Avahi API on Linux +* Improved performance of lunchbox::make_uint128() +* Improved thread logging facilities +* OSX 10.9, Win32 builds improved + +# Known Bugs {#Bugs} + +The following bugs were known at release time. Please file a +[Bug Report](https://github.com/Eyescale/Lunchbox/issues) if you find +any other issue with this release. + +* [6:](https://github.com/Eyescale/Lunchbox/issues/6) +Condition::timedWait does not wait on early RHEL 6.1 versions diff --git a/doc/DoxygenLayout.xml b/doc/DoxygenLayout.xml deleted file mode 100644 index 24eb68a6..00000000 --- a/doc/DoxygenLayout.xml +++ /dev/null @@ -1,184 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/doc/README.Win b/doc/README.Win deleted file mode 100644 index 11e1a8ab..00000000 --- a/doc/README.Win +++ /dev/null @@ -1,3 +0,0 @@ - -The supported zeroconf implementation on Windows is the Bonjour SDK 3.0 -downloadable from http://developer.apple.com/opensource. diff --git a/doc/RelNotes.md b/doc/RelNotes.md deleted file mode 100644 index d42c0d74..00000000 --- a/doc/RelNotes.md +++ /dev/null @@ -1,108 +0,0 @@ -Release Notes {#RelNotes} -============ - -[TOC] - -# Introduction {#Introduction} - -Welcome to Lunchbox, a C++ library for multi-threaded programming. -Lunchbox 1.10 adds URI parsing, persistent map interface for key value -stores, compilation fixes for different platforms and adds minor improvements -of the API. - -Lunchbox 1.10 is a feature release based on the 1.9 Lunchbox API. It is -intended for all application developers creating high-preformance -multi-threaded programs. Lunchbox 1.10 can be retrieved by downloading -the -[source code](http://www.equalizergraphics.com/downloads/Lunchbox-1.10.0.tar.gz) -or any of the -[precompiled packages](http://www.equalizergraphics.com/downloads/major.html). - -## Features {#Features} - -Lunchbox provides the following major features to facilitate the -development and deployment of multi-threaded applications: - -* OS Abstraction: Utility classes abstracting common operating systems - features, e.g., threads, locks, memory maps, shared library loading - and condition variables. -* High-Performance Primitives: Thread-safe utilities tuned for - performance, e.g., atomic variables, spin locks and lock-free - containers. -* Utility classes: Helper primitives which are not in the standard - library, e.g., logging, pools and random number generation. - -# New in this release {#New} - -Lunchbox 1.10 contains the following features, enhancements, bug fixes -and documentation changes over Lunchbox 1.9: - -## New Features {#NewFeatures} - -* lunchbox::URI parsing support according to RFC3986 -* lunchbox::PersistentMap interface for persistent key-value stores -* lunchbox::getHostname and lunchbox::getExecutablePath functions -* lunchbox::PluginFactory, a mechanism to register and load plugins - -## Enhancements {#Enhancements} - -* Added timeout parameter for the Future::wait function -* Improved thread logging facilities -* Added API for continuous browsing to lunchbox::Servus -* Improved lunchbox::Servus implementations, supporting continuous browsing and - using the native Avahi API on Linux - -## Optimizations {#Optimizations} - -* Improved performance of lunchbox::make_uint128() - -## Documentation {#Documentation} - -* [API documentation](http://eyescale.github.io/Lunchbox-1.10/index.html) - of the public Lunchbox API - -## Bug Fixes {#Fixes} - -Lunchbox 1.10 includes various compilation fixes over the 1.9 release, including -the following: - -* OSX 10.9, Win32 builds improved. - -## Known Bugs {#Bugs} - -The following bugs were known at release time. Please file a -[Bug Report](https://github.com/Eyescale/Lunchbox/issues) if you find -any other issue with this release. - -* [6:](https://github.com/Eyescale/Lunchbox/issues/6) -Condition::timedWait does not wait on early RHEL 6.1 versions - -# About {#About} - -Lunchbox is a cross-platform library, designed to run on any modern -operating system, including all Unix variants and the Windows operating -system. Lunchbox uses CMake to create a platform-specific build -environment. The following platforms and build environments are tested: - -* Linux: Ubuntu 12.04, 12.10, 13.04, 13.10, 14.04 RHEL 6 (Makefile, i386, x64) -* Windows: 7 (Visual Studio 2008, i386, x64) -* Mac OS X: 10.8 (Makefile, XCode, i386, x64) - -The -[API documentation](http://eyescale.github.io/Lunchbox-1.8/index.html) -can be found on [eyescale.github.io](http://eyescale.github.io/). As -with any open source project, the available source code, in particular -the [unit tests](https://github.com/Eyescale/Lunchbox/tree/1.8/tests) -provide a reference for developing applications. - -Technical questions can be posted to the Equalizer - [Developer Mailing List](http://www.equalizergraphics.com/cgi-bin/mailman/listinfo/eq-dev), - or directly to - [info@equalizergraphics.com](mailto:info@equalizergraphics.com?subject=Lunchbox%20question). - -Commercial support, custom software development and porting services are -available from [Eyescale](http://www.eyescale.ch). Please contact -[info@eyescale.ch](mailto:info@eyescale.ch?subject=Lunchbox%20support) -for further information. - -# Errata diff --git a/lunchbox/CMakeLists.txt b/lunchbox/CMakeLists.txt index 4fb81106..0fac6582 100644 --- a/lunchbox/CMakeLists.txt +++ b/lunchbox/CMakeLists.txt @@ -3,7 +3,8 @@ include(files.cmake) -list(APPEND LUNCHBOX_LINK_LIBRARIES ${PTHREAD_LIBRARIES} ${Boost_LIBRARIES}) +list(APPEND LUNCHBOX_LINK_LIBRARIES + ${PTHREAD_LIBRARIES} ${Boost_LIBRARIES} ${SERVUS_LIBRARIES}) if(WIN32) list(APPEND LUNCHBOX_LINK_LIBRARIES ws2_32 mswsock imagehlp) endif(WIN32) @@ -34,10 +35,6 @@ if(SKV_FOUND) ${PTHREAD_LIBRARIES}) endif() endif() -if(NOT LUNCHBOX_BUILD_V2_API) - list(APPEND LUNCHBOX_LINK_LIBRARIES ${SERVUS_LIBRARIES}) -endif() - common_library(Lunchbox) diff --git a/lunchbox/anySerialization.h b/lunchbox/anySerialization.h index 337df857..f39cdb0e 100644 --- a/lunchbox/anySerialization.h +++ b/lunchbox/anySerialization.h @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include @@ -46,7 +46,7 @@ typedef boost::mpl::list< int8_t, uint8_t, int32_t, uint32_t, int64_t, uint64_t, float, double, - bool, std::string, uint128_t > podTypes; + bool, std::string, servus::uint128_t > podTypes; /** @cond IGNORE */ /** diff --git a/lunchbox/bitOperation.h b/lunchbox/bitOperation.h index 657fc872..8ccd9697 100644 --- a/lunchbox/bitOperation.h +++ b/lunchbox/bitOperation.h @@ -22,7 +22,7 @@ #include // GCC version #include -#include +#include #ifdef _MSC_VER # pragma warning (push) @@ -176,7 +176,7 @@ template<> inline void byteswap( int64_t& value ) template<> inline void byteswap( double& value ) { byteswap( reinterpret_cast< uint64_t& >( value )); } -template<> inline void byteswap( uint128_t& value ) +template<> inline void byteswap( servus::uint128_t& value ) { byteswap( value.high( )); byteswap( value.low( )); diff --git a/lunchbox/file.h b/lunchbox/file.h index 26ce808c..7f917c27 100644 --- a/lunchbox/file.h +++ b/lunchbox/file.h @@ -54,7 +54,7 @@ LUNCHBOX_API std::string getDirname( const std::string& filename ) /** * @return the absolute path to the current executable. - * @version 1.10 + * @version 1.11 */ LUNCHBOX_API std::string getExecutablePath(); diff --git a/lunchbox/leveldb/persistentMap.h b/lunchbox/leveldb/persistentMap.h index e612aa67..130f8726 100644 --- a/lunchbox/leveldb/persistentMap.h +++ b/lunchbox/leveldb/persistentMap.h @@ -29,7 +29,7 @@ namespace leveldb { namespace { -db::DB* _open( const URI& uri ) +db::DB* _open( const servus::URI& uri ) { db::DB* db = 0; db::Options options; @@ -46,11 +46,11 @@ db::DB* _open( const URI& uri ) class PersistentMap : public detail::PersistentMap { public: - PersistentMap( const URI& uri ) : _db( _open( uri )) {} + PersistentMap( const servus::URI& uri ) : _db( _open( uri )) {} virtual ~PersistentMap() { delete _db; } - static bool handles( const URI& uri ) + static bool handles( const servus::URI& uri ) { return uri.getScheme() == "leveldb"; } bool insert( const std::string& key, const void* data, const size_t size ) diff --git a/lunchbox/log.h b/lunchbox/log.h index d7c06c4b..19946ad9 100644 --- a/lunchbox/log.h +++ b/lunchbox/log.h @@ -50,12 +50,7 @@ enum LogLevel LOG_ALL }; -/** - * The logging topics. - * - * @sa net/log.h, client/log.h - * @version 1.0 - */ +/** The logging topics. @version 1.0 */ enum LogTopic { LOG_EXCEPTION = 0x01, //!< Log exception within LBTHROW diff --git a/lunchbox/monitor.h b/lunchbox/monitor.h index 87baa8c9..3d0af651 100644 --- a/lunchbox/monitor.h +++ b/lunchbox/monitor.h @@ -225,7 +225,7 @@ template< class T > class Monitor * @param value the exact value to monitor. * @param timeout the timeout in milliseconds to wait for not the value. * @return true on success, false on timeout. - * @version 1.3.3 + * @version 1.10 */ bool timedWaitNE( const T& value, const uint32_t timeout ) const { @@ -471,10 +471,10 @@ Monitor< bool >& Monitor< bool >::operator |= ( const bool& value ) } } -#include +#include namespace lunchbox { -template<> inline Monitor< uint128_t >::Monitor() {} +template<> inline Monitor< servus::uint128_t >::Monitor() {} } #endif //LUNCHBOX_MONITOR_H diff --git a/lunchbox/persistentMap.cpp b/lunchbox/persistentMap.cpp index debb665b..d9eed82f 100644 --- a/lunchbox/persistentMap.cpp +++ b/lunchbox/persistentMap.cpp @@ -16,7 +16,7 @@ */ #include "persistentMap.h" -#include "uri.h" +#include namespace lunchbox { @@ -47,7 +47,7 @@ class PersistentMap namespace { -lunchbox::detail::PersistentMap* _newImpl( const lunchbox::URI& uri ) +lunchbox::detail::PersistentMap* _newImpl( const servus::URI& uri ) { // Update handles() below on any change here! #ifdef LUNCHBOX_USE_LEVELDB @@ -76,10 +76,10 @@ lunchbox::detail::PersistentMap* _newImpl( const lunchbox::URI& uri ) namespace lunchbox { PersistentMap::PersistentMap( const std::string& uri ) - : _impl( _newImpl( URI( uri ))) + : _impl( _newImpl( servus::URI( uri ))) {} -PersistentMap::PersistentMap( const URI& uri ) +PersistentMap::PersistentMap( const servus::URI& uri ) : _impl( _newImpl( uri )) {} @@ -88,7 +88,7 @@ PersistentMap::~PersistentMap() delete _impl; } -bool PersistentMap::handles( const URI& uri ) +bool PersistentMap::handles( const servus::URI& uri ) { #ifdef LUNCHBOX_USE_LEVELDB if( lunchbox::leveldb::PersistentMap::handles( uri )) diff --git a/lunchbox/persistentMap.h b/lunchbox/persistentMap.h index 7a368e0e..c7e32342 100644 --- a/lunchbox/persistentMap.h +++ b/lunchbox/persistentMap.h @@ -23,6 +23,7 @@ #include // className #include // LBTHROW #include +#include #include #include @@ -53,7 +54,7 @@ class PersistentMap : public boost::noncopyable * Depending on the URI scheme an implementation backend is chosen. If no * URI is given, a default one is selected. Available implementations are: * * leveldb://path (if LUNCHBOX_USE_LEVELDB is defined) - * * skv://path_to_config#pdsname (if LUNCHBOX_USE_SKV is defined) + * * skv://path_to_config\#pdsname (if LUNCHBOX_USE_SKV is defined) * * @param uri the storage backend and destination. * @throw std::runtime_error if no suitable implementation is found. @@ -66,7 +67,7 @@ class PersistentMap : public boost::noncopyable * Construct a persistent map using an URI. See other ctor for details. * @version 1.9.2 */ - LUNCHBOX_API explicit PersistentMap( const URI& uri ); + LUNCHBOX_API explicit PersistentMap( const servus::URI& uri ); /** Destruct the persistent map. @version 1.9.2 */ LUNCHBOX_API ~PersistentMap(); @@ -75,7 +76,7 @@ class PersistentMap : public boost::noncopyable * @return true if an implementation for the given URI is available. * @version 1.9.2 */ - LUNCHBOX_API static bool handles( const URI& uri ); + LUNCHBOX_API static bool handles( const servus::URI& uri ); /** * Set the maximum number of asynchronous outstanding write operations. @@ -88,6 +89,7 @@ class PersistentMap : public boost::noncopyable * * @return the queue depth chosen by the implementation, smaller or equal to * the given depth. + * @version 1.11 */ LUNCHBOX_API size_t setQueueDepth( const size_t depth ); @@ -143,7 +145,7 @@ class PersistentMap : public boost::noncopyable * * @param key the key to retrieve. * @return the value, or an empty string if the key is not available. - * @version 1.9.2 + * @version 1.11 */ template< class V > V get( const std::string& key ) const { return _get< V >( key ); } @@ -175,17 +177,17 @@ class PersistentMap : public boost::noncopyable * @param key the key to retrieve. * @param sizeHint the size of the value, may be ignored by implementation. * @return false on error, true otherwise. - * @version 1.9.2 + * @version 1.11 */ LUNCHBOX_API bool fetch( const std::string& key, size_t sizeHint = 0 ) const; /** @return true if the key exists. @version 1.9.2 */ LUNCHBOX_API bool contains( const std::string& key ) const; - /** Flush outstanding operations to the backend storage. @version 1.10 */ + /** Flush outstanding operations to the backend storage. @version 1.11 */ LUNCHBOX_API bool flush(); - /** Enable or disable endianness conversion on reads. @version 1.9.2 */ + /** Enable or disable endianness conversion on reads. @version 1.11 */ LUNCHBOX_API void setByteswap( const bool swap ); private: diff --git a/lunchbox/plugin.h b/lunchbox/plugin.h index 8f4ad747..b8615822 100644 --- a/lunchbox/plugin.h +++ b/lunchbox/plugin.h @@ -22,7 +22,7 @@ #ifndef LUNCHBOX_PLUGIN_H #define LUNCHBOX_PLUGIN_H -#include // member +#include // member #include // Plugin functions #include // operator == @@ -44,7 +44,7 @@ namespace lunchbox * * @version 1.11.0 */ -template< class PluginT, class InitDataT = URI > class Plugin +template< class PluginT, class InitDataT = servus::URI > class Plugin { public: /** @@ -67,7 +67,8 @@ template< class PluginT, class InitDataT = URI > class Plugin * @version 1.11.0 */ Plugin( const Constructor& constructor_, const HandlesFunc& handles_ ) - : constructor( constructor_ ), handles( handles_ ), tag( make_UUID( )) {} + : constructor( constructor_ ), handles( handles_ ) + , tag( servus::make_UUID( )) {} /** @return true if the plugins wrap the same plugin. @version 1.11.0 */ bool operator == ( const Plugin& rhs ) const @@ -82,7 +83,7 @@ template< class PluginT, class InitDataT = URI > class Plugin HandlesFunc handles; // Makes Plugin comparable. See http://stackoverflow.com/questions/18665515 - uint128_t tag; + servus::uint128_t tag; }; } diff --git a/lunchbox/pluginFactory.h b/lunchbox/pluginFactory.h index ec0240e1..414b7844 100644 --- a/lunchbox/pluginFactory.h +++ b/lunchbox/pluginFactory.h @@ -27,7 +27,7 @@ #include // LBTHROW #include // used inline #include // searchDirectory() used inline -#include // Default template type +#include // Default template type #include // used inline #include // used inline @@ -55,7 +55,7 @@ namespace lunchbox * * @version 1.11.0 */ -template< class PluginT, class InitDataT = URI > +template< class PluginT, class InitDataT = servus::URI > class PluginFactory : public boost::noncopyable { public: diff --git a/lunchbox/pluginRegisterer.h b/lunchbox/pluginRegisterer.h index 437d2088..c90bf695 100644 --- a/lunchbox/pluginRegisterer.h +++ b/lunchbox/pluginRegisterer.h @@ -37,7 +37,7 @@ namespace lunchbox { /** * Helper class to statically register derived plugin classes. If MyInitDataType - * is not given, default value is lunchbox::URI. + * is not given, default value is servus::URI. * * The following code can be placed in a plugin's cpp file: * @code @@ -55,7 +55,7 @@ namespace lunchbox * public: * typedef MyPluginInterface PluginT; * typedef MyPluginInitData InitDataT; - * ( optional for InitDataT == lunchbox::URI ) + * ( optional for InitDataT == servus::URI ) * } * @endcode * diff --git a/lunchbox/requestHandler.cpp b/lunchbox/requestHandler.cpp index 30c0f318..1c9fc1c3 100644 --- a/lunchbox/requestHandler.cpp +++ b/lunchbox/requestHandler.cpp @@ -170,7 +170,8 @@ bool RequestHandler::waitRequest( const uint32_t requestID, uint32_t& rUint32, return true; } -bool RequestHandler::waitRequest( const uint32_t requestID, uint128_t& rUint128, +bool RequestHandler::waitRequest( const uint32_t requestID, + servus::uint128_t& rUint128, const uint32_t timeout ) { Record::Result result; @@ -260,7 +261,7 @@ void RequestHandler::serveRequest( const uint32_t requestID, bool result ) } void RequestHandler::serveRequest( const uint32_t requestID, - const uint128_t& result ) + const servus::uint128_t& result ) { Record* request = 0; { diff --git a/lunchbox/requestHandler.h b/lunchbox/requestHandler.h index d808ae8a..14452168 100644 --- a/lunchbox/requestHandler.h +++ b/lunchbox/requestHandler.h @@ -21,6 +21,7 @@ #include // LUNCHBOX_API definition #include // thread-safety macros #include +#include namespace lunchbox { @@ -107,7 +108,8 @@ class RequestHandler : public boost::noncopyable LUNCHBOX_API bool waitRequest( const uint32_t requestID, bool& result, const uint32_t timeout = LB_TIMEOUT_INDEFINITE ); /** Wait for a request with an uint128_t result. @version 1.0 */ - LUNCHBOX_API bool waitRequest(const uint32_t requestID, uint128_t& result, + LUNCHBOX_API bool waitRequest( const uint32_t requestID, + servus::uint128_t& result, const uint32_t timeout = LB_TIMEOUT_INDEFINITE ); /** Wait for a request without a result. @version 1.0 */ LUNCHBOX_API bool waitRequest( const uint32_t requestID ); @@ -146,7 +148,7 @@ class RequestHandler : public boost::noncopyable LUNCHBOX_API void serveRequest( const uint32_t requestID, bool result ); /** Serve a request with an uint128_t result. @version 1.0 */ LUNCHBOX_API void serveRequest( const uint32_t requestID, - const uint128_t& result ); + const servus::uint128_t& result ); /** * @return true if this request handler has pending requests. * @version 1.0 diff --git a/lunchbox/skv/persistentMap.h b/lunchbox/skv/persistentMap.h index 5fa03226..e3dda679 100644 --- a/lunchbox/skv/persistentMap.h +++ b/lunchbox/skv/persistentMap.h @@ -43,7 +43,7 @@ namespace skv class PersistentMap : public detail::PersistentMap { public: - PersistentMap( const URI& uri ) + PersistentMap( const servus::URI& uri ) : _maxPendingOps( 0 ) { #ifdef SKV_CLIENT_UNI @@ -79,7 +79,8 @@ class PersistentMap : public detail::PersistentMap LBASSERT( _writes.empty( )); } - static bool handles( const URI& uri ) { return uri.getScheme() == "skv"; } + static bool handles( const servus::URI& uri ) + { return uri.getScheme() == "skv"; } size_t setQueueDepth( const size_t depth ) final { diff --git a/lunchbox/stdExt.h b/lunchbox/stdExt.h index 70bd3a10..662ab2b6 100644 --- a/lunchbox/stdExt.h +++ b/lunchbox/stdExt.h @@ -28,7 +28,11 @@ #include // usort #include -#include +#ifdef LUNCHBOX_USE_V1_API +# include +#else +# include +#endif #include #include diff --git a/lunchbox/types.h b/lunchbox/types.h index f8271421..93c3085e 100644 --- a/lunchbox/types.h +++ b/lunchbox/types.h @@ -20,29 +20,6 @@ * Basic type definitions not provided by the operating system. */ -/** @mainpage Lunchbox API Documentation - * - * Welcome to Lunchbox, a C++ library for multi-threaded programming. Lunchbox - * provides the following functionality: - * - * - Operating System Abstraction: lunchbox::Atomic, lunchbox::Condition, - * lunchbox::DSO, @ref bitops "bit operations", lunchbox::daemonize(), - * (lunchbox::Clock, lunchbox::MemoryMap, lunchbox::PerThread, lunchbox::RNG, - * lunchbox::Thread) - * - High-Performance Threading Primitives: lunchbox::Buffer, lunchbox::LFQueue, - * lunchbox::LFVector, lunchbox::Monitor, lunchbox::MTQueue, - * lunchbox::RequestHandler, lunchbox::SpinLock, (lunchbox::Lock, - * lunchbox::TimedLock) - * - Utility classes: lunchbox::Any, lunchbox::Log, lunchbox::Pool, - * lunchbox::uint128_t, lunchbox::UnorderedIntervalSet, lunchbox::Future, - * lunchbox::Servus, lunchbox::URI, lunchbox::PersistentMap, - * (lunchbox::ScopedMutex) - * - * @ref RelNotes - *
Test Code Coverage - * Report (may be missing from documentation) - */ - /** * @namespace lunchbox * @brief Abstraction layer and common utilities for multi-threaded programming. diff --git a/tests/anySerialization.cpp b/tests/anySerialization.cpp index c14b685f..327f86b4 100644 --- a/tests/anySerialization.cpp +++ b/tests/anySerialization.cpp @@ -36,7 +36,7 @@ int main( int, char** ) testValues.push_back( float( 5.42f )); testValues.push_back( double( 17.56789 )); testValues.push_back( std::string( "blablub" )); - testValues.push_back( lunchbox::uint128_t( lunchbox::make_uint128( "bla"))); + testValues.push_back( servus::uint128_t( servus::make_uint128( "bla"))); Foo foo = {42, 1.5f, false, "blablub"}; testValues.push_back( foo ); diff --git a/tests/issue1.cpp b/tests/issue1.cpp index e1aa34ce..22423502 100644 --- a/tests/issue1.cpp +++ b/tests/issue1.cpp @@ -21,12 +21,12 @@ #include #include #include -#include +#include #include #define NLOOPS 200000 -using lunchbox::uint128_t; +using servus::uint128_t; lunchbox::Monitor< uint128_t > monitor; const uint128_t big( 10, 10 ); diff --git a/tests/monitor.cpp b/tests/monitor.cpp index 56456293..f28f5047 100644 --- a/tests/monitor.cpp +++ b/tests/monitor.cpp @@ -23,7 +23,7 @@ #include #include -using lunchbox::uint128_t; +using servus::uint128_t; lunchbox::Monitor< int64_t > monitor; lunchbox::Monitor< bool > boolMonitor; diff --git a/tests/pluginFactory.cpp b/tests/pluginFactory.cpp index 245eb18b..3d93c300 100644 --- a/tests/pluginFactory.cpp +++ b/tests/pluginFactory.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include @@ -33,7 +33,7 @@ struct InitData { - lunchbox::URI uri; + servus::URI uri; }; namespace boost @@ -64,8 +64,8 @@ class TypedPluginInterface class MyPlugin : public PluginInterface { public: - MyPlugin( const lunchbox::URI& ) {} - static bool handles( const lunchbox::URI& ) { return true; } + MyPlugin( const servus::URI& ) {} + static bool handles( const servus::URI& ) { return true; } int getValue() final { return VALID_VALUE; } }; @@ -80,8 +80,8 @@ class MyTypedPlugin : public TypedPluginInterface class MyDummyPlugin : public PluginInterface { public: - MyDummyPlugin( const lunchbox::URI& ) {} - static bool handles( const lunchbox::URI& ) { return false; } + MyDummyPlugin( const servus::URI& ) {} + static bool handles( const servus::URI& ) { return false; } int getValue() final { return INVALID_VALUE; } }; @@ -103,7 +103,7 @@ typedef boost::scoped_ptr< TypedPluginInterface > TypedPluginInterfacePtr; void tryCreatePlugin( PluginInterfacePtr& plugin ) { MyPluginFactory& factory = MyPluginFactory::getInstance(); - plugin.reset( factory.create( lunchbox::URI( "XYZ" ))); + plugin.reset( factory.create( servus::URI( "XYZ" ))); } void tryCreateTypedPlugin( TypedPluginInterfacePtr& plugin ) diff --git a/tests/requestHandler.cpp b/tests/requestHandler.cpp index f7fa9eb3..f9c51c73 100644 --- a/tests/requestHandler.cpp +++ b/tests/requestHandler.cpp @@ -25,13 +25,13 @@ #include #include #include -#include +#include -using lunchbox::uint128_t; +using servus::uint128_t; lunchbox::RequestHandler handler_; lunchbox::MTQueue< uint32_t > requestQ_; -const uint128_t uuid = lunchbox::make_UUID(); +const uint128_t uuid = servus::make_UUID(); class Thread : public lunchbox::Thread { diff --git a/tests/rng.cpp b/tests/rng.cpp index 86765ff0..3011c64a 100644 --- a/tests/rng.cpp +++ b/tests/rng.cpp @@ -1,15 +1,15 @@ -/* Copyright (c) 2007-2012, Stefan Eilemann +/* Copyright (c) 2007-2012, Stefan Eilemann * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License version 2.1 as published * by the Free Software Foundation. - * + * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. - * + * * You should have received a copy of the GNU Lesser General Public License * along with this library; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -22,7 +22,7 @@ #include #include #include -#include +#include #define MAXLOOPS 100000 @@ -82,7 +82,7 @@ int main( int argc, char **argv ) testSpeed< uint16_t >(); testSpeed< uint32_t >(); testSpeed< uint64_t >(); - testSpeed< lunchbox::uint128_t >(); + testSpeed< servus::uint128_t >(); TEST( lunchbox::exit( )); return EXIT_SUCCESS;