All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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  GENICAM_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 IBoolean& operator=(bool Value)
65  {
66  SetValue( Value );
67  return *this;
68  }
69 
71 
76  virtual bool GetValue(bool Verify = false, bool IgnoreCache = false) const = 0;
77 
79  virtual bool operator()() const { return GetValue(); }
80  };
81 
82 
83  //*************************************************************
84  // CBooleanRef class
85  //*************************************************************
86 
87 #ifndef DOXYGEN_IGNORE
88 
93  template <class T>
94  class CBooleanRefT : public CValueRefT<T>
95  {
96  typedef CValueRefT<T> ref;
97 
98  public:
99  /*--------------------------------------------------------*/
100  // IBoolean
101  /*--------------------------------------------------------*/
102 
104  virtual void SetValue(bool Value, bool Verify = true)
105  {
106  if (ref::m_Ptr)
107  {
108  ref::m_Ptr->SetValue( Value, Verify );
109  }
110  else
111  {
112  throw ACCESS_EXCEPTION( "Feature not present (reference not valid)" );
113  }
114  }
115 
117  virtual CBooleanRefT& operator=(bool Value)
118  {
119  if (ref::m_Ptr)
120  {
121  ref::m_Ptr->operator=(Value);
122  }
123  else
124  {
125  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
126  }
127 
128  return *this;
129  }
130 
132  virtual bool GetValue(bool Verify = false, bool IgnoreCache = false) const
133  {
134  if(!ref::m_Ptr)
135  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
136  return ref::m_Ptr->GetValue(Verify, IgnoreCache);
137  }
138 
140  virtual bool operator()() const
141  {
142  if(!ref::m_Ptr)
143  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
144  return ref::m_Ptr->operator()();
145  }
146  };
147 
151 
152 #endif
153 
154 }
155 
156 #ifdef _MSC_VER
157 # pragma warning ( pop )
158 #endif
159 
160 #endif // ifndef GENAPI_IBOOLEAN_H
GENAPI_NAMESPACE
Lexical analyzer for CIntSwissKnife.
Definition: Destructible.h:30
GENAPI_NAMESPACE::CBooleanRefT::ref
CValueRefT< T > ref
Definition: IBoolean.h:96
Types.h
Common types used in the public GenApi interface.
GENAPI_NAMESPACE::IBoolean
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IBoolean
Interface for Boolean properties.
Definition: IBoolean.h:61
GENICAM_INTERFACE
#define GENICAM_INTERFACE
Definition: GenICamFwd.h:33
GENAPI_NAMESPACE::CValueRefT
Definition: IValue.h:95
GENAPI_NAMESPACE::CBooleanRef
CBooleanRefT< IBoolean > CBooleanRef
Reference to an IBoolean pointer.
Definition: IBoolean.h:150
GENAPI_NAMESPACE::Verify
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT bool Verify
Definition: IBoolean.h:61
GENAPI_NAMESPACE::CBooleanRefT::SetValue
virtual void SetValue(bool Value, bool Verify=true)
Set node value.
Definition: IBoolean.h:104
GENAPI_NAMESPACE::CBooleanRefT::operator()
virtual bool operator()() const
Get node value.
Definition: IBoolean.h:140
GENAPI_NAMESPACE::IValue
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IValue
Interface for value properties.
Definition: IValue.h:61
GENAPI_NAMESPACE::CBooleanRefT
Definition: IBoolean.h:94
ACCESS_EXCEPTION
#define ACCESS_EXCEPTION
Fires a access exception, e.g. throw ACCESS_EXCEPTION("Not everybody")
Definition: GCException.h:253
GENAPI_NAMESPACE::GetValue
virtual bool GetValue(bool Verify=false, bool IgnoreCache=false) const =0
Get node value.
GENAPI_NAMESPACE::CReferenceT< T, T >::m_Ptr
T * m_Ptr
Pointer to the implementation the reference references to.
Definition: Reference.h:101
IValue.h
Definition of the interface IValue.
GENAPI_NAMESPACE::CBooleanRefT::operator=
virtual CBooleanRefT & operator=(bool Value)
Set node value.
Definition: IBoolean.h:117
GENAPI_NAMESPACE::CBooleanRefT::GetValue
virtual bool GetValue(bool Verify=false, bool IgnoreCache=false) const
Get node value.
Definition: IBoolean.h:132
GENAPI_NAMESPACE::operator()
virtual bool operator()() const
Get node value.
Definition: IBoolean.h:79
GENAPI_NAMESPACE::operator=
virtual IBoolean & operator=(bool Value)
Set node value.
Definition: IBoolean.h:64
GenApiDll.h
declspec's to be used for GenApi Windows dll


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Wed Dec 4 2024 03:10:11