LCOV - code coverage report
Current view: top level - irohad/model - common.hpp (source / functions) Hit Total Coverage
Test: cleared_cor.info Lines: 1 2 50.0 %
Date: 2019-03-07 14:46:43 Functions: 26 26 100.0 %

          Line data    Source code
       1             : /**
       2             :  * Copyright Soramitsu Co., Ltd. All Rights Reserved.
       3             :  * SPDX-License-Identifier: Apache-2.0
       4             :  */
       5             : 
       6             : #ifndef IROHA_COMMON_HPP
       7             : #define IROHA_COMMON_HPP
       8             : 
       9             : #include <memory>
      10             : #include <boost/optional.hpp>
      11             : 
      12             : namespace iroha {
      13             :   namespace model {
      14             :     // Optional over shared pointer
      15             :     template <typename T>
      16             :     using optional_ptr = boost::optional<std::shared_ptr<T>>;
      17             : 
      18             :     template <typename T, typename... Args>
      19             :     optional_ptr<T> make_optional_ptr(Args &&... args) {
      20           8 :       return std::make_shared<T>(std::forward<Args>(args)...);
      21           0 :     }
      22             :   }  // namespace model
      23             : }  // namespace iroha
      24             : 
      25             : #endif  // IROHA_COMMON_HPP

Generated by: LCOV version 1.13