LCOV - code coverage report
Current view: top level - zeroeq/http - helpers.h (source / functions) Hit Total Coverage
Test: ZeroEQ Lines: 4 4 100.0 %
Date: 2017-12-01 01:44:57 Functions: 9 10 90.0 %

          Line data    Source code
       1             : 
       2             : /* Copyright (c) 2017, Human Brain Project
       3             :  *                     Stefan.Eilemann@epfl.ch
       4             :  */
       5             : 
       6             : #ifndef ZEROEQ_HTTP_HELPERS_H
       7             : #define ZEROEQ_HTTP_HELPERS_H
       8             : 
       9             : #include <zeroeq/http/response.h>
      10             : 
      11             : #include <future>
      12             : 
      13             : namespace zeroeq
      14             : {
      15             : namespace http
      16             : {
      17             : /**
      18             :  * @return ready future wrapping an HTTP Response constructed with
      19             :  *         the values passed.
      20             :  */
      21             : template <typename... Args>
      22         140 : std::future<Response> make_ready_response(Args&&... args)
      23             : {
      24         280 :     std::promise<Response> promise;
      25         140 :     promise.set_value(Response(std::forward<Args>(args)...));
      26         280 :     return promise.get_future();
      27             : }
      28             : }
      29             : }
      30             : 
      31             : #endif

Generated by: LCOV version 1.11