LCOV - code coverage report
Current view: top level - include/as2js - int64.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 23 23 100.0 %
Date: 2014-11-22 Functions: 7 7 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : #ifndef AS2JS_INT64_H
       2             : #define AS2JS_INT64_H
       3             : /* int64.h -- written by Alexis WILKE for Made to Order Software Corp. (c) 2005-2014 */
       4             : 
       5             : /*
       6             : 
       7             : Copyright (c) 2005-2014 Made to Order Software Corp.
       8             : 
       9             : http://snapwebsites.org/project/as2js
      10             : 
      11             : Permission is hereby granted, free of charge, to any
      12             : person obtaining a copy of this software and
      13             : associated documentation files (the "Software"), to
      14             : deal in the Software without restriction, including
      15             : without limitation the rights to use, copy, modify,
      16             : merge, publish, distribute, sublicense, and/or sell
      17             : copies of the Software, and to permit persons to whom
      18             : the Software is furnished to do so, subject to the
      19             : following conditions:
      20             : 
      21             : The above copyright notice and this permission notice
      22             : shall be included in all copies or substantial
      23             : portions of the Software.
      24             : 
      25             : THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
      26             : ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
      27             : LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
      28             : FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
      29             : EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
      30             : LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
      31             : WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
      32             : ARISING FROM, OUT OF OR IN CONNECTION WITH THE
      33             : SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
      34             : SOFTWARE.
      35             : 
      36             : */
      37             : 
      38             : #include    "compare.h"
      39             : 
      40             : #include    <controlled_vars/controlled_vars_auto_init.h>
      41             : 
      42             : 
      43             : namespace as2js
      44             : {
      45             : 
      46             : class Int64
      47             : {
      48             : public:
      49             :     typedef int64_t int64_type;
      50             : 
      51    73351213 :                     Int64()
      52    73351213 :                     {
      53    73351213 :                     }
      54             : 
      55     2499462 :                     Int64(int64_type const rhs)
      56     2499462 :                     {
      57     2499462 :                         f_int = rhs;
      58     2499462 :                     }
      59             : 
      60    14907835 :                     Int64(Int64 const& rhs)
      61    14907835 :                     {
      62    14907835 :                         f_int = rhs.f_int;
      63    14907835 :                     }
      64             : 
      65     5106686 :     Int64&          operator = (Int64 const& rhs)
      66             :                     {
      67     5106686 :                         f_int = rhs.f_int;
      68     5106686 :                         return *this;
      69             :                     }
      70             : 
      71    12307379 :     int64_type      get() const
      72             :                     {
      73    12307379 :                         return f_int;
      74             :                     }
      75             : 
      76      173092 :     void            set(int64_type const new_int)
      77             :                     {
      78      173092 :                         f_int = new_int;
      79      173092 :                     }
      80             : 
      81       32046 :     compare_t       compare(Int64 const& rhs) const
      82             :                     {
      83       32046 :                         return f_int == rhs.f_int ? compare_t::COMPARE_EQUAL
      84       32000 :                              : (f_int < rhs.f_int ? compare_t::COMPARE_LESS
      85       64046 :                                                   : compare_t::COMPARE_GREATER);
      86             :                     }
      87             : 
      88             : private:
      89             :     controlled_vars::auto_init<int64_type>        f_int;
      90             : };
      91             : 
      92             : 
      93             : }
      94             : // namespace as2js
      95             : #endif
      96             : // #ifndef AS2JS_INT64_H
      97             : 
      98             : // vim: ts=4 sw=4 et

Generated by: LCOV version 1.10