IBoolean.h
Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 //  (c) 2006 by Basler Vision Technologies
00003 //  Section: Vision Components
00004 //  Project: GenApi
00005 //  Author:  Margret Albrecht
00006 //  $Header$
00007 //
00008 //  License: This file is published under the license of the EMVA GenICam  Standard Group.
00009 //  A text file describing the legal terms is included in  your installation as 'GenICam_license.pdf'.
00010 //  If for some reason you are missing  this file please contact the EMVA or visit the website
00011 //  (http://www.genicam.org) for a full copy.
00012 //
00013 //  THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS"
00014 //  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
00015 //  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00016 //  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD  GROUP
00017 //  OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,  SPECIAL,
00018 //  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT  LIMITED TO,
00019 //  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,  DATA, OR PROFITS;
00020 //  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY  THEORY OF LIABILITY,
00021 //  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT  (INCLUDING NEGLIGENCE OR OTHERWISE)
00022 //  ARISING IN ANY WAY OUT OF THE USE  OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00023 //  POSSIBILITY OF SUCH DAMAGE.
00024 //-----------------------------------------------------------------------------
00031 #ifndef GENAPI_IBOOLEAN_H
00032 #define GENAPI_IBOOLEAN_H
00033 
00034 #include <GenApi/GenApiDll.h>
00035 #include <GenApi/Types.h>
00036 #include <GenApi/IValue.h>
00037 
00038 #pragma warning ( push )
00039 #pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY
00040 
00041 namespace GENAPI_NAMESPACE
00042 {
00043     //*************************************************************
00044     // IBoolean interface
00045     //*************************************************************
00046 
00051     interface GENAPI_DECL_ABSTRACT IBoolean   : virtual public IValue
00052     {
00053     public:
00055 
00059         virtual void SetValue(bool Value, bool Verify = true) = 0;
00060 
00062         virtual void operator=(bool Value){ SetValue( Value ); }
00063 
00065 
00070         virtual bool GetValue(bool Verify = false, bool IgnoreCache = false) const = 0;
00071 
00073         virtual bool operator()() const { return GetValue(); }
00074     };
00075 
00076 
00077     //*************************************************************
00078     // CBooleanRef class
00079     //*************************************************************
00080 
00081 #ifndef DOXYGEN_IGNORE
00082 
00087     template <class T>
00088     class CBooleanRefT : public CValueRefT<T>
00089     {
00090         typedef CValueRefT<T> ref;
00091 
00092     public:
00093         /*--------------------------------------------------------*/
00094         // IBoolean
00095         /*--------------------------------------------------------*/
00096 
00098         virtual void SetValue(bool Value, bool Verify = true)
00099         {
00100             if(ref::m_Ptr)
00101                 return ref::m_Ptr->SetValue(Value, Verify);
00102             else
00103                 throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
00104 
00105             // unused param *JS* (removed warning)
00106             GC_UNUSED(Verify);
00107         }
00108 
00110         virtual void operator=(bool Value)
00111         {
00112             if(ref::m_Ptr)
00113                 return ref::m_Ptr->operator=(Value);
00114             else
00115                 throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
00116         }
00117 
00119         virtual bool GetValue(bool Verify = false, bool IgnoreCache = false) const
00120         {
00121             if(ref::m_Ptr)
00122                 return ref::m_Ptr->GetValue(Verify, IgnoreCache);
00123             else
00124                 throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
00125         }
00126 
00128         virtual bool operator()() const
00129         {
00130             if(ref::m_Ptr)
00131                 return ref::m_Ptr->operator()();
00132             else
00133                 throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
00134         }
00135 
00136     };
00137 
00140     typedef CBooleanRefT<IBoolean> CBooleanRef;
00141 
00142 #endif
00143 
00144 
00145 
00146 }
00147 
00148 #pragma warning ( pop )
00149 
00150 #endif // ifndef GENAPI_IBOOLEAN_H


rc_visard_driver
Author(s): Heiko Hirschmueller , Christian Emmerich , Felix Ruess
autogenerated on Thu Jun 6 2019 20:43:04