31 #ifndef GENAPI_IENUMERATIONT_H 32 #define GENAPI_IENUMERATIONT_H 51 template<
typename EnumT >
59 virtual void SetValue(EnumT Value,
bool Verify =
true) = 0;
70 virtual EnumT
GetValue(
bool Verify =
false,
bool IgnoreCache =
false) = 0;
92 #ifndef DOXYGEN_IGNORE 99 template<
class EnumT >
125 m_EnumExists.resize(NumEnums);
126 m_EnumValues.resize(NumEnums);
128 std::vector<bool>::iterator ptr;
129 for(ptr = m_EnumExists.begin(); ptr != m_EnumExists.end(); ptr++)
143 m_EnumExists[Index] =
true;
144 m_EnumValues[Index] = ptrEnumEntry->GetValue();
158 return m_Ptr->GetAccessMode();
171 return m_Ptr->GetNode();
180 return m_Ptr->ToString(
Verify, IgnoreCache);
189 return m_Ptr->FromString(ValueStr,
Verify);
198 return m_Ptr->IsValueCacheValid();
211 return m_Ptr->GetSymbolics(Symbolics);
220 return m_Ptr->GetEntries(Entries);
229 return m_Ptr->operator=(ValueStr);
238 return m_Ptr->operator=(pValueStr);
247 m_Ptr->SetIntValue(Value,
Verify);
256 return m_Ptr->operator*();
265 return m_Ptr->GetIntValue(
Verify, IgnoreCache);
274 return m_Ptr->GetEntryByName(Symbolic);
284 return m_Ptr->GetEntry(IntValue);
293 return m_Ptr->GetCurrentEntry(
Verify, IgnoreCache);
307 if( m_EnumExists[Value] )
309 int64_t EnumValue = m_EnumValues[Value];
310 m_Ptr->SetIntValue(EnumValue,
Verify);
332 std::vector<int64_t>::iterator ptr;
333 for (
unsigned int idx = 0; idx < m_EnumValues.size(); ++idx )
335 if( m_EnumExists[idx] && m_EnumValues[idx] == IntValue)
355 if( m_EnumExists[Value] )
357 int64_t EnumValue = m_EnumValues[Value];
358 return m_Ptr->GetEntry(EnumValue);
383 #endif // ifndef GENAPI_IENUMERATIONT_H virtual GENICAM_NAMESPACE::gcstring operator*()
Get node value.
virtual void SetValue(EnumT Value, bool Verify=true)
Set node value.
Common types used in the public GenApi interface.
virtual bool GetValue(bool Verify=false, bool IgnoreCache=false) const =0
Get node value.
virtual INode * GetNode()
Get the INode interface of the node.
virtual void GetEntries(NodeList_t &Entries)
Get list of entry nodes.
virtual void operator=(bool Value)
Set node value.
virtual void SetIntValue(int64_t Value, bool Verify=true)
Set node value.
virtual EnumT operator()()
Get node value.
virtual bool operator()() const
Get node value.
virtual IEnumeration & operator=(EnumT Value)
Set node value.
virtual IEnumEntry * GetEntry(const int64_t IntValue)=0
Get an entry node by its IntValue.
virtual void GetSymbolics(StringList_t &Symbolics)
Get list of symbolic Values.
interface GENAPI_DECL_ABSTRACT IEnumeration
Interface for enumeration properties.
virtual EnumT GetValue(bool Verify=false, bool IgnoreCache=false)
Get node value.
virtual IEnumEntry * GetEntryByName(const GENICAM_NAMESPACE::gcstring &Symbolic)=0
Get an entry node by name.
virtual IEnumeration & operator=(const GENICAM_NAMESPACE::gcstring &ValueStr)
Set node value.
virtual void FromString(const GENICAM_NAMESPACE::gcstring &ValueStr, bool Verify=true)
Set content of the node as string.
interface GENAPI_DECL_ABSTRACT IEnumEntry
Interface of single enum value.
interface GENAPI_DECL_ABSTRACT IReference
Interface to construct a reference.
interface GENAPI_DECL_ABSTRACT IBase
Base interface common to all nodes.
node_vector NodeList_t
a list of node references
Encapsulates a GenApi pointer dealing with the dynamic_cast automatically.
#define ACCESS_EXCEPTION
Fires a access exception, e.g. throw ACCESS_EXCEPTION("Not everybody")
virtual void SetNumEnums(int NumEnums)
sets the number of enum values
virtual void SetReference(IBase *ptr)
sets the implementation to the reference
IEnumeration * m_Ptr
Pointer to the implementation the reference references to.
Definition of macros for cross-platform compatibility.
interface GENAPI_DECL_ABSTRACT bool Verify
interface GENAPI_DECL_ABSTRACT IEnumReference
Interface to construct an enum reference.
std::vector< int64_t > m_EnumValues
The values for enums with a given index.
virtual IEnumEntry * GetCurrentEntry(bool Verify=false, bool IgnoreCache=false)=0
Get the current entry.
virtual IEnumEntry * GetCurrentEntry(bool Verify=false, bool IgnoreCache=false)
Get the current entry.
std::vector< bool > m_EnumExists
Indicates it an enum with a given index exists.
virtual IEnumEntry * GetEntryByName(const GENICAM_NAMESPACE::gcstring &Symbolic)
Get an entry node by name.
virtual EAccessMode GetAccessMode() const
Get the access mode of the node.
virtual IEnumEntry * GetEntry(const EnumT Value)
returns the EnumEntry object belonging to the Value
Definition of template CPointer.
virtual GENICAM_NAMESPACE::gcstring ToString(bool Verify=false, bool IgnoreCache=false)
Get content of the node as string.
A string class which is a clone of std::string.
bool IsValueCacheValid() const
Checks if the value comes from cache or is requested from another node.
bool IsValid() const
true if the pointer is valid
enum GENAPI_NAMESPACE::_EAccessMode EAccessMode
access mode of a node
virtual IEnumEntry * GetEntry(const int64_t IntValue)
Get an entry node by its IntValue.
declspec's to be used for GenApi Windows dll
Definition of interface IEnumeration.
virtual void SetEnumReference(int Index, GENICAM_NAMESPACE::gcstring Name)
sets the Enum value corresponding to a value
interface GENAPI_DECL_ABSTRACT INode
Interface common to all nodes.
virtual int64_t GetIntValue(bool Verify=false, bool IgnoreCache=false)
Get node value.
GENICAM_NAMESPACE::gcstring_vector StringList_t
A list of strings.
virtual IEnumeration & operator=(const char *pValueStr)
Set node value.
Part of the generic device API.