GenApi 3.5.1
IEnumEntry.h
Go to the documentation of this file.
1//-----------------------------------------------------------------------------
2// (c) 2006 by Basler Vision Technologies
3// Author: Margret Albrecht
4//
5// License: This file is published under the license of the EMVA GenICam Standard Group.
6// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'.
7// If for some reason you are missing this file please contact the EMVA or visit the website
8// (http://www.genicam.org) for a full copy.
9//
10// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS"
11// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
12// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
13// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP
14// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
15// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
16// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
17// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
18// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
19// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
20// POSSIBILITY OF SUCH DAMAGE.
21//
22//-----------------------------------------------------------------------------
28#ifndef GENAPI_IENUMENTRY_H
29#define GENAPI_IENUMENTRY_H
30
31
32#include <Base/GCString.h>
33#include <GenApi/GenApiDll.h>
34#include <GenApi/IValue.h>
35
36#ifdef _MSC_VER
37# pragma warning ( push )
38# pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY
39#endif
40
41namespace GENAPI_NAMESPACE
42{
43
44 //*************************************************************
45 // IEnumEntry interface
46 //*************************************************************
47
53 GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IEnumEntry : virtual public IValue
54 {
55
56 public:
58 virtual int64_t GetValue() = 0;
59
62
64 virtual double GetNumericValue() = 0;
65
67 virtual bool IsSelfClearing() = 0;
68 };
69
70 //*************************************************************
71 // CEnumEntryRef class
72 //*************************************************************
73
74#ifndef DOXYGEN_IGNORE
75
81 template <class T>
82 class CEnumEntryRefT : public CValueRefT<T>
83 {
84 typedef CValueRefT<T> ref;
85
86 public:
87 /*--------------------------------------------------------*/
88 // IEnumEntry
89 /*--------------------------------------------------------*/
90
92 virtual int64_t GetValue()
93 {
94 if(ref::m_Ptr)
95 return ref::m_Ptr->GetValue();
96 else
97 throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
98 }
99
101 virtual GENICAM_NAMESPACE::gcstring GetSymbolic()const
102 {
103 if(ref::m_Ptr)
104 return ref::m_Ptr->GetSymbolic();
105 else
106 throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
107 }
108
110 virtual double GetNumericValue()
111 {
112 if(ref::m_Ptr)
113 return ref::m_Ptr->GetNumericValue();
114 else
115 throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
116 }
117
119 virtual bool IsSelfClearing()
120 {
121 if(ref::m_Ptr)
122 return ref::m_Ptr->IsSelfClearing();
123 else
124 throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
125 }
126 };
127
130 typedef CEnumEntryRefT<IEnumEntry> CEnumEntryRef;
131
132#endif
133
134}
135
136#ifdef _MSC_VER
137# pragma warning ( pop )
138#endif
139
140#endif // ifndef GENAPI_IENUMENTRY_H
Portable string implementation.
declspec's to be used for GenApi Windows dll
virtual bool GetValue(bool Verify=false, bool IgnoreCache=false) const =0
Get node value.
virtual GENICAM_NAMESPACE::gcstring GetSymbolic() const =0
Get symbolic enum value.
virtual double GetNumericValue()=0
Get double number associated with the entry.
virtual bool IsSelfClearing()=0
Indicates if the corresponding EnumEntry is self clearing.
Definition of the interface IValue.
A string class which is a clone of std::string.
Definition GCString.h:51
#define ACCESS_EXCEPTION
Fires a access exception, e.g. throw ACCESS_EXCEPTION("Not everybody")
Definition GCException.h:252
CEnumEntryRefT< IEnumEntry > CEnumEntryRef
Definition IEnumEntry.h:130
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IValue
Interface for value properties.
Definition IValue.h:59
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IEnumEntry
Interface of single enum value.
Definition IEnumEntry.h:58