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 //----------------------------------------------------------------------------- 00030 #ifndef GENAPI_IENUMENTRY_H 00031 #define GENAPI_IENUMENTRY_H 00032 00033 00034 #include <Base/GCString.h> 00035 #include <GenApi/GenApiDll.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 // IEnumEntry interface 00046 //************************************************************* 00047 00053 interface GENAPI_DECL_ABSTRACT IEnumEntry : virtual public IValue 00054 { 00055 00056 public: 00058 virtual int64_t GetValue() = 0; 00059 00061 virtual GENICAM_NAMESPACE::gcstring GetSymbolic()const = 0; 00062 00064 virtual double GetNumericValue() = 0; 00065 00067 virtual bool IsSelfClearing() = 0; 00068 }; 00069 00070 //************************************************************* 00071 // CEnumEntryRef class 00072 //************************************************************* 00073 00074 #ifndef DOXYGEN_IGNORE 00075 00081 template <class T> 00082 class CEnumEntryRefT : public CValueRefT<T> 00083 { 00084 typedef CValueRefT<T> ref; 00085 00086 public: 00087 /*--------------------------------------------------------*/ 00088 // IEnumEntry 00089 /*--------------------------------------------------------*/ 00090 00092 virtual int64_t GetValue() 00093 { 00094 if(ref::m_Ptr) 00095 return ref::m_Ptr->GetValue(); 00096 else 00097 throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); 00098 } 00099 00101 virtual GENICAM_NAMESPACE::gcstring GetSymbolic()const 00102 { 00103 if(ref::m_Ptr) 00104 return ref::m_Ptr->GetSymbolic(); 00105 else 00106 throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); 00107 } 00108 00110 virtual double GetNumericValue() 00111 { 00112 if(ref::m_Ptr) 00113 return ref::m_Ptr->GetNumericValue(); 00114 else 00115 throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); 00116 } 00117 00119 virtual bool IsSelfClearing() 00120 { 00121 if(ref::m_Ptr) 00122 return ref::m_Ptr->IsSelfClearing(); 00123 else 00124 throw ACCESS_EXCEPTION("Feature not present (reference not valid)"); 00125 } 00126 }; 00127 00130 typedef CEnumEntryRefT<IEnumEntry> CEnumEntryRef; 00131 00132 #endif 00133 00134 } 00135 00136 #pragma warning ( pop ) 00137 00138 #endif // ifndef GENAPI_IENUMENTRY_H