LCOV - code coverage report
Current view: top level - include - BInteger.h (source / functions) Hit Total Coverage
Test: cpp-bencoding code coverage Lines: 1 1 100.0 %
Date: 2018-04-21 15:28:44 Functions: 2 2 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /**
       2             : * @file      BInteger.h
       3             : * @copyright (c) 2014 by Petr Zemek (s3rvac@gmail.com) and contributors
       4             : * @license   BSD, see the @c LICENSE file for more details
       5             : * @brief     Representation of an integer.
       6             : */
       7             : 
       8             : #ifndef BENCODING_BINTEGER_H
       9             : #define BENCODING_BINTEGER_H
      10             : 
      11             : #include <cstdint>
      12             : #include <memory>
      13             : 
      14             : #include "BItem.h"
      15             : 
      16             : namespace bencoding {
      17             : 
      18             : /**
      19             : * @brief Representation of an integer.
      20             : *
      21             : * Use create() to create instances of the class.
      22             : */
      23         126 : class BInteger: public BItem {
      24             : public:
      25             :     /// Type of the underlying integral value.
      26             :     using ValueType = int64_t;
      27             : 
      28             : public:
      29             :     static std::unique_ptr<BInteger> create(ValueType value);
      30             : 
      31             :     ValueType value() const;
      32             :     void setValue(ValueType value);
      33             : 
      34             :     /// @name BItemVisitor Support
      35             :     /// @{
      36             :     virtual void accept(BItemVisitor *visitor) override;
      37             :     /// @}
      38             : 
      39             : private:
      40             :     explicit BInteger(ValueType value);
      41             : 
      42             : private:
      43             :     ValueType _value;
      44             : };
      45             : 
      46             : } // namespace bencoding
      47             : 
      48             : #endif

Generated by: LCOV version 1.13