Counter.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 // (c) 2006 by Basler Vision Technologies
3 // Section: Vision Components
4 // Project: GenApi
5 // Author: Alexander Happe
6 // $Header$
7 //
8 // License: This file is published under the license of the EMVA GenICam Standard Group.
9 // A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'.
10 // If for some reason you are missing this file please contact the EMVA or visit the website
11 // (http://www.genicam.org) for a full copy.
12 //
13 // THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS"
14 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP
17 // OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
20 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
21 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
23 // POSSIBILITY OF SUCH DAMAGE.
24 //-----------------------------------------------------------------------------
31 #ifndef GENAPI_COUNTER_H
32 #define GENAPI_COUNTER_H
33 
34 namespace GENAPI_NAMESPACE {
35 
36  class Counter
37  {
38  public:
40  {
41  }
42 
43  unsigned int GetValue() const
44  { return m_value; }
45 
46  unsigned int operator++() // prefix
47  {
48  return ++m_value;
49  }
50 
51  unsigned int operator++(int) // postfix
52  {
53  return m_value++;
54  }
55 
56  unsigned int operator--(int) // postfix
57  {
58  assert( m_value > 0);
59  return m_value--;
60  }
61 
62  unsigned int operator--() // prefix
63  {
64  assert( m_value > 0);
65  return --m_value;
66  }
67 
68  operator unsigned int()
69  {
70  return m_value;
71  }
72 
73  bool IsZero()
74  {
75  return m_value == 0;
76  }
77 
78  private:
79  unsigned int m_value;
80  };
81 }
82 
83 #endif // GENAPI_COUNTER_H
84 
unsigned int operator--(int)
Definition: Counter.h:56
unsigned int operator--()
Definition: Counter.h:62
unsigned int operator++(int)
Definition: Counter.h:51
unsigned int GetValue() const
Definition: Counter.h:43
unsigned int operator++()
Definition: Counter.h:46
unsigned int m_value
Definition: Counter.h:79
Part of the generic device API.
Definition: Autovector.h:48


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Thu Jun 6 2019 19:10:54