IBoolean.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: Margret Albrecht
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_IBOOLEAN_H
32 #define GENAPI_IBOOLEAN_H
33 
34 #include <GenApi/GenApiDll.h>
35 #include <GenApi/Types.h>
36 #include <GenApi/IValue.h>
37 
38 #ifdef _MSC_VER
39 # pragma warning ( push )
40 # pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY
41 #endif
42 
43 namespace GENAPI_NAMESPACE
44 {
45  //*************************************************************
46  // IBoolean interface
47  //*************************************************************
48 
53  interface GENAPI_DECL_ABSTRACT IBoolean : virtual public IValue
54  {
55  public:
57 
61  virtual void SetValue(bool Value, bool Verify = true) = 0;
62 
64  virtual void operator=(bool Value){ SetValue( Value ); }
65 
67 
72  virtual bool GetValue(bool Verify = false, bool IgnoreCache = false) const = 0;
73 
75  virtual bool operator()() const { return GetValue(); }
76  };
77 
78 
79  //*************************************************************
80  // CBooleanRef class
81  //*************************************************************
82 
83 #ifndef DOXYGEN_IGNORE
84 
89  template <class T>
90  class CBooleanRefT : public CValueRefT<T>
91  {
92  typedef CValueRefT<T> ref;
93 
94  public:
95  /*--------------------------------------------------------*/
96  // IBoolean
97  /*--------------------------------------------------------*/
98 
100  virtual void SetValue(bool Value, bool Verify = true)
101  {
102  if(ref::m_Ptr)
103  return ref::m_Ptr->SetValue(Value, Verify);
104  else
105  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
106 
107  // unused param *JS* (removed warning)
108  GC_UNUSED(Verify);
109  }
110 
112  virtual void operator=(bool Value)
113  {
114  if(ref::m_Ptr)
115  return ref::m_Ptr->operator=(Value);
116  else
117  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
118  }
119 
121  virtual bool GetValue(bool Verify = false, bool IgnoreCache = false) const
122  {
123  if(ref::m_Ptr)
124  return ref::m_Ptr->GetValue(Verify, IgnoreCache);
125  else
126  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
127  }
128 
130  virtual bool operator()() const
131  {
132  if(ref::m_Ptr)
133  return ref::m_Ptr->operator()();
134  else
135  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
136  }
137 
138  };
139 
143 
144 #endif
145 
146 
147 
148 }
149 
150 #ifdef _MSC_VER
151 # pragma warning ( pop )
152 #endif
153 
154 #endif // ifndef GENAPI_IBOOLEAN_H
Common types used in the public GenApi interface.
interface GENAPI_DECL_ABSTRACT IBoolean
Interface for Boolean properties.
Definition: IBoolean.h:61
virtual bool GetValue(bool Verify=false, bool IgnoreCache=false) const =0
Get node value.
virtual void operator=(bool Value)
Set node value.
Definition: IBoolean.h:64
virtual bool operator()() const
Get node value.
Definition: IBoolean.h:75
virtual void operator=(bool Value)
Set node value.
Definition: IBoolean.h:112
virtual bool GetValue(bool Verify=false, bool IgnoreCache=false) const
Get node value.
Definition: IBoolean.h:121
CBooleanRefT< IBoolean > CBooleanRef
Reference to an IBoolean pointer.
Definition: IBoolean.h:142
virtual bool operator()() const
Get node value.
Definition: IBoolean.h:130
virtual void SetValue(bool Value, bool Verify=true)
Set node value.
Definition: IBoolean.h:100
#define ACCESS_EXCEPTION
Fires a access exception, e.g. throw ACCESS_EXCEPTION("Not everybody")
Definition: GCException.h:252
interface GENAPI_DECL_ABSTRACT IValue
Interface for value properties.
Definition: IValue.h:61
interface GENAPI_DECL_ABSTRACT bool Verify
Definition: IBoolean.h:61
declspec&#39;s to be used for GenApi Windows dll
Definition of the interface IValue.
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