LCOV - code coverage report
Current view: top level - eq/fabric - swapBarrier.h (source / functions) Hit Total Coverage
Test: Equalizer Lines: 12 12 100.0 %
Date: 2017-12-16 05:07:20 Functions: 10 10 100.0 %

          Line data    Source code
       1             : 
       2             : /* Copyright (c) 2006-2012, Stefan Eilemann <eile@equalizergraphics.com>
       3             :  *
       4             :  * This library is free software; you can redistribute it and/or modify it under
       5             :  * the terms of the GNU Lesser General Public License version 2.1 as published
       6             :  * by the Free Software Foundation.
       7             :  *
       8             :  * This library is distributed in the hope that it will be useful, but WITHOUT
       9             :  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
      10             :  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
      11             :  * details.
      12             :  *
      13             :  * You should have received a copy of the GNU Lesser General Public License
      14             :  * along with this library; if not, write to the Free Software Foundation, Inc.,
      15             :  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
      16             :  */
      17             : 
      18             : #ifndef EQFABRIC_SWAPBARRIER_H
      19             : #define EQFABRIC_SWAPBARRIER_H
      20             : 
      21             : #include <eq/fabric/api.h>
      22             : #include <iostream>
      23             : #include <lunchbox/referenced.h> // base class
      24             : 
      25             : namespace eq
      26             : {
      27             : namespace fabric
      28             : {
      29             : /**
      30             :  * A swapbarrier is set on a Compound to synchronize the swap buffer between
      31             :  * windows.
      32             :  *
      33             :  * Swap barriers with the same name are linked together, that is, all
      34             :  * compounds holding a swap barrier with the same name synchronize their
      35             :  * window's swap command.
      36             :  */
      37         872 : class SwapBarrier : public lunchbox::Referenced
      38             : {
      39             : public:
      40             :     /**
      41             :      * Constructs a new SwapBarrier.
      42             :      */
      43         436 :     SwapBarrier()
      44         436 :         : _nvSwapGroup(0)
      45         436 :         , _nvSwapBarrier(0)
      46             :     {
      47         436 :     }
      48             : 
      49             :     /** @name Data Access. */
      50             :     //@{
      51         436 :     void setName(const std::string& name) { _name = name; }
      52         744 :     const std::string getName() const { return _name; }
      53           4 :     uint32_t getNVSwapGroup() const { return _nvSwapGroup; }
      54           8 :     void setNVSwapGroup(uint32_t nvGroup) { _nvSwapGroup = nvGroup; }
      55           4 :     uint32_t getNVSwapBarrier() const { return _nvSwapBarrier; }
      56           8 :     void setNVSwapBarrier(uint32_t nvBarrier) { _nvSwapBarrier = nvBarrier; }
      57         236 :     bool isNvSwapBarrier() const { return (_nvSwapBarrier || _nvSwapGroup); }
      58             :     //@}
      59             : 
      60             : private:
      61             :     std::string _name;
      62             : 
      63             :     uint32_t _nvSwapGroup;
      64             :     uint32_t _nvSwapBarrier;
      65             : };
      66             : 
      67             : EQFABRIC_API std::ostream& operator<<(std::ostream&, const SwapBarrier&);
      68             : }
      69             : }
      70             : #endif // EQFABRIC_SWAPBARRIER_H

Generated by: LCOV version 1.11