29 #ifndef GENAPI_IENUMERATIONT_H 30 #define GENAPI_IENUMERATIONT_H 36 #include <GenApi/Compatibility.h> 49 template<
typename EnumT >
57 virtual void SetValue(EnumT Value,
bool Verify =
true) = 0;
68 virtual EnumT
GetValue(
bool Verify =
false,
bool IgnoreCache =
false) = 0;
90 #ifndef DOXYGEN_IGNORE 97 template<
class EnumT >
111 virtual void SetReference(
IBase *ptr )
123 m_EnumExists.resize(NumEnums);
124 m_EnumValues.resize(NumEnums);
126 std::vector<bool>::iterator ptr;
127 for(ptr = m_EnumExists.begin(); ptr != m_EnumExists.end(); ptr++)
141 m_EnumExists[Index] =
true;
142 m_EnumValues[Index] = ptrEnumEntry->GetValue();
156 return m_Ptr->GetAccessMode();
169 return m_Ptr->GetNode();
178 return m_Ptr->ToString(Verify, IgnoreCache);
187 return m_Ptr->FromString(ValueStr, Verify);
196 return m_Ptr->IsValueCacheValid();
209 return m_Ptr->GetSymbolics(Symbolics);
218 return m_Ptr->GetEntries(Entries);
227 return m_Ptr->operator=(ValueStr);
236 return m_Ptr->operator=(pValueStr);
242 virtual void SetIntValue(int64_t Value,
bool Verify =
true)
245 m_Ptr->SetIntValue(Value, Verify);
254 return m_Ptr->operator*();
260 virtual int64_t
GetIntValue(
bool Verify =
false,
bool IgnoreCache =
false)
263 return m_Ptr->GetIntValue(Verify, IgnoreCache);
272 return m_Ptr->GetEntryByName(Symbolic);
282 return m_Ptr->GetEntry(IntValue);
291 return m_Ptr->GetCurrentEntry(Verify, IgnoreCache);
301 virtual void SetValue(EnumT Value,
bool Verify =
true)
305 if( m_EnumExists[Value] )
307 int64_t EnumValue = m_EnumValues[Value];
308 m_Ptr->SetIntValue(EnumValue, Verify);
325 virtual EnumT
GetValue(
bool Verify =
false,
bool IgnoreCache =
false)
329 int64_t IntValue = m_Ptr->GetIntValue(Verify, IgnoreCache);
330 std::vector<int64_t>::iterator ptr;
331 for (
unsigned int idx = 0; idx < m_EnumValues.size(); ++idx )
333 if( m_EnumExists[idx] && m_EnumValues[idx] == IntValue)
353 if( m_EnumExists[Value] )
355 int64_t EnumValue = m_EnumValues[Value];
356 return m_Ptr->GetEntry(EnumValue);
370 std::vector<int64_t > m_EnumValues;
373 std::vector<bool > m_EnumExists;
381 #endif // ifndef GENAPI_IENUMERATIONT_H virtual void SetNumEnums(int NumEnums)=0
sets the number of enum vallues
virtual int64_t GetIntValue(bool Verify=false, bool IgnoreCache=false)=0
Get integer node value.
Common types used in the public GenApi interface.
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IReference
Interface to construct a reference.
Definition: Reference.h:48
bool IsValid() const
true if the pointer is valid
Definition: Pointer.h:109
GENICAM_NAMESPACE::gcstring_vector StringList_t
Definition: Types.h:147
virtual void GetEntries(NodeList_t &Entries)=0
Get list of entry nodes.
virtual bool operator()() const
Get node value.
Definition: IBoolean.h:77
GENICAM_INTERFACE INode
Interface common to all nodes.
Definition: ICategory.h:49
GENICAM_INTERFACE IEnumerationT
Interface for enumeration properties.
Definition: IEnumerationT.h:57
virtual void FromString(const GENICAM_NAMESPACE::gcstring &ValueStr, bool Verify=true)=0
Set content of the node as string.
node_vector NodeList_t
a list of node references
Definition: INode.h:53
virtual GENICAM_NAMESPACE::gcstring operator*()=0
Get string node value.
enum GENAPI_NAMESPACE::_EAccessMode EAccessMode
virtual IBoolean & operator=(bool Value)
Set node value.
Definition: IBoolean.h:62
Encapsulates a GenApi pointer dealing with the dynamic_cast automatically.
Definition: Pointer.h:49
virtual IEnumEntry * GetEntryByName(const GENICAM_NAMESPACE::gcstring &Symbolic)=0
Get an entry node by name.
#define ACCESS_EXCEPTION
Fires a access exception, e.g. throw ACCESS_EXCEPTION("Not everybody")
Definition: GCException.h:252
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IEnumReference
Interface to construct an enum reference.
Definition: Reference.h:62
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IBase
Base interface common to all nodes.
Definition: IBase.h:53
virtual void SetIntValue(int64_t Value, bool Verify=true)=0
Set integer node value.
virtual IEnumEntry * GetCurrentEntry(bool Verify=false, bool IgnoreCache=false)=0
Get the current entry.
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IEnumeration
Interface for enumeration properties.
Definition: IEnumeration.h:58
virtual bool IsValueCacheValid() const =0
Checks if the value comes from cache or is requested from another node.
Definition of template CPointer.
A string class which is a clone of std::string.
Definition: GCString.h:50
virtual IEnumEntry * GetEntry(const int64_t IntValue)=0
Get an entry node by its IntValue.
virtual bool GetValue(bool Verify=false, bool IgnoreCache=false) const =0
Get node value.
declspec's to be used for GenApi Windows dll
Definition of interface IEnumeration.
Not implemented.
Definition: Types.h:54
Definition: ChunkAdapter.h:37
virtual INode * GetNode(const GENICAM_NAMESPACE::gcstring &Name) const =0
Retrieves the node from the central map by Name.
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IEnumEntry
Interface of single enum value.
Definition: IEnumEntry.h:58