Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
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
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
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
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
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