38 #include "../GenApiDll.h" 42 #include "../ICategory.h" 45 #include "../IInteger.h" 46 #include "../IBoolean.h" 47 #include "../ISelector.h" 48 #include "../NodeCallback.h" 49 #include "../EnumClasses.h" 53 #include "NodeMapData/NodeMapDataTypes.h" 54 #include "NodeMapData/NodeData.h" 56 #include "../IUserData.h" 68 template<
typename C,
typename V>
71 if (std::find(c.begin(), c.end(), v) == c.end())
107 #pragma BullseyeCoverage off 112 #pragma BullseyeCoverage on 132 virtual void InternalInvalidateNode( std::list<CNodeCallback*> &CallbacksToFire );
135 virtual bool InternalIsCachable()
const;
141 virtual int64_t InternalGetPollingTime()
const;
169 virtual INodeMap* InternalGetNodeMap()
const;
180 virtual void GetPropertyNames(GENICAM_NAMESPACE::gcstring_vector &PropertyNames)
const;
199 virtual void InternalCheckError()
const;
205 virtual bool InternalIsDeprecated()
const;
211 virtual EYesNo InternalIsAccessModeCacheable()
const;
219 #pragma BullseyeCoverage off 221 #pragma BullseyeCoverage on 224 m_AccessModeCache =
RW;
225 GCLOGWARN( m_pAccessLog,
"InternalGetAccessMode : ReadCycle detected at = '%s'", m_Name.c_str() );
240 virtual bool GetProperty(CNodeDataMap *pNodeDataMap, CPropertyID::EProperty_ID_t PropertyID, CNodeData::PropertyVector_t &PropertyList)
const;
242 virtual void CollectCallbacksToFire(std::list<CNodeCallback*> &CallbacksToFire,
bool allDependents =
false);
252 virtual bool IsSelector()
const;
275 # define ADD_ORPHAN_CHILD( PropertyID, Property ) \ 276 INodePrivate *pNode = dynamic_cast<CNodeMap*>(m_pNodeMap)->_GetNodeByID( Property.NodeID() ); \ 277 if( CPropertyID::IsInvalidatingPointer(PropertyID) )\ 279 detail::push_back_unique(m_InvalidatingChildren, pNode); \ 280 if( CPropertyID::IsReadingPointer(PropertyID) ) \ 282 detail::push_back_unique(m_ReadingChildren, pNode); \ 283 if( CPropertyID::IsWritingPointer(PropertyID) ) \ 285 detail::push_back_unique(m_WritingChildren, pNode); \ 291 # define ADD_CHILD( PropertyID, Property ) \ 292 INodePrivate *pNode = dynamic_cast<CNodeMap*>(m_pNodeMap)->_GetNodeByID( Property.NodeID() ); \ 293 if( CPropertyID::IsInvalidatingPointer(PropertyID) )\ 295 detail::push_back_unique(m_InvalidatingChildren, pNode);\ 296 dynamic_cast<CNodeImpl*>(pNode)->SetParent( this );\ 297 if( CPropertyID::IsReadingPointer(PropertyID) ) \ 299 detail::push_back_unique(m_ReadingChildren, pNode);\ 300 if( CPropertyID::IsWritingPointer(PropertyID) ) \ 302 detail::push_back_unique(m_WritingChildren, pNode); \ 308 # define ADD_ORPHAN_CHILD( PropertyID, Property ) \ 309 INodePrivate *pNode = dynamic_cast<CNodeMap*>(m_pNodeMap)->_GetNodeByID(Property.NodeID()); \ 310 add_orphan_child( PropertyID, Property, pNode ); 312 # define ADD_CHILD( PropertyID, Property ) \ 313 INodePrivate *pNode = dynamic_cast<CNodeMap*>(m_pNodeMap)->_GetNodeByID(Property.NodeID()); \ 314 add_child( PropertyID, Property, pNode ); 320 if (CPropertyID::IsInvalidatingPointer(PropertyID))
323 dynamic_cast<CNodeImpl*
>(pNode)->SetParent(
this);
324 if (CPropertyID::IsReadingPointer(PropertyID))
327 if (CPropertyID::IsWritingPointer(PropertyID))
337 if (CPropertyID::IsInvalidatingPointer(PropertyID))
340 if (CPropertyID::IsReadingPointer(PropertyID))
343 if (CPropertyID::IsWritingPointer(PropertyID))
363 std::string nodetype;
366 return nodetype.c_str();
443 eTerminalPropagationDone
519 virtual bool InternalIsValueCacheValid()
const;
549 void PostSetValue( std::list<CNodeCallback*> &CallbacksToFire );
564 m_CallbacksToFire( CallbacksToFire )
570 m_pThis->PostSetValue( m_CallbacksToFire );
598 m_pNodeMapPrivate =
dynamic_cast<INodeMapPrivate*
>( pThis->GetNodeMap() );
599 m_pNodeMapPrivate->SetEntryPoint( EntryMethod, pThis, IgnoreCache );
605 m_pNodeMapPrivate->ResetEntryPoint();
660 #if defined( _WIN32 ) && !defined( PHARLAP_WIN32 ) 662 typedef std::wstring::size_type
size_type;
665 #define QUALIFY_LITERAL( x ) _L( x ) 666 #define _L( x ) L ## x 667 #define GET_MODULE_FILE_NAME GetModuleFileNameW 668 #define GET_CSTR( x ) x.w_str().c_str() 669 #define GET_LOCALE_INFO GetLocaleInfoW 675 #define QUALIFY_LITERAL( x ) x 676 #define GET_MODULE_FILE_NAME GetModuleFileName 677 #define GET_CSTR( x ) x.c_str() 678 #define GET_LOCALE_INFO GetLocaleInfo 682 void GetNodeName( string_t& VariableContent )
const;
683 void GetStringStreamContent(
const ostringstream_t& Content, string_t& VariableContent )
const;
685 void GetModelName( string_t& VariableContent )
const;
699 #endif // ifndef GENAPI_NODE_H void add_orphan_child(CPropertyID::EProperty_ID_t PropertyID, CProperty &, INodePrivate *pNode)
EVisibility m_ImposedVisibility
Visibility imposed to the natural visibility of the node.
Definition of value2string and string2value functions.
std::list< CNodeCallback * > m_Callbacks
List of callbacks.
enum GENAPI_NAMESPACE::_EVisibility EVisibility
recommended visibility of a node
virtual GENICAM_NAMESPACE::gcstring GetStandardNameSpace()=0
Get the standard name space.
virtual Counter & GetBathometer()=0
Returns the object which counts the depth of SetValue() call-chains.
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IBase
Base interface common to all nodes.
GENICAM_NAMESPACE::gcstring m_ToolTip
The ToolTip for the node.
GENICAM_NAMESPACE::gcstring m_Name
The name of the node.
virtual bool IsTerminalNode() const =0
Returns true, if this node is terminal.
virtual void SetProperty(CProperty &Property)=0
Sets a property to the node map itself.
bool m_DontDeleteThisCache
indicates that the cache has been filled and should not be cleared at the end of the operation ...
EYesNo m_AccessModeCacheability
indicates if the AccessMode is cacheable
GENICAM_NAMESPACE::gcstring m_Description
The Description of the node.
INodeMapPrivate * GetNodeMapPrivate()
Retrieves the INodeMapPrivate interface.
NodeID_t m_NodeID
The node's ID.
CBooleanPolyRef m_IsImplemented
Reference to a Node, which indicates if the node is implemented.
A reference to a bool which can bei either an bool variable, or a pointer to an IInteger, an IEnumeration, or an IBoolean.
NodePrivateVector_t m_AllDependingNodes
All directly or indirectly connected nodes which are invalidated by this nodes (i.e. which are dependent on this node) For details see GenICam wiki : GenApi/SoftwareArchitecture/NodeDependencies.
std::string::size_type size_type
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IUserData
Interface to manage user data stored in nodes or nodemaps.
GENICAM_NAMESPACE::ILogger * m_pAccessLog
Logger for messages concerning the AccessMode.
bool m_ValueCacheValid
true if the value cache is valid
#define GCLOGWARN(cat,...)
ETerminalPropagationState m_propagationState
Current state for propagating terminals.
virtual void GetSelectedFeatures(FeatureList_t &) const =0
retrieve the group of selected features
std::list< CNodeCallback * > & m_CallbacksToFire
list of callbacks to file
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT INodeMapPrivate
NodeMap functions used for initialization.
std::vector< INodePrivate * > NodePrivateVector_t
a vector of node references using the INodePrivate interface
bool IsAccessModeCached() const
returns true, if the AccessModeCache is valid
GENICAM_INTERFACE INodePrivate
Interface including the methods for node construction common to all nodes.
ENameSpace m_NameSpace
The namespace of the node.
EYesNo m_IsFeature
indicates that the node is a feature that is reachable from the Root node via categories ...
EVisibility m_Visibility
recommended visibility;
virtual void operator=(bool Value)
Set node value.
CBooleanPolyRef m_IsAvailable
Reference to a Node, which indicates if the node is available.
CBooleanPolyRef m_BlockPolling
Reference to a Node, which indicates if the node is not cached.
NodePrivateVector_t m_VariableChildren
All node use as variable by this node.
GENICAM_NAMESPACE::gcstring m_Extension
The metadata from the extension.
GENICAM_NAMESPACE::ILogger * m_pCacheLog
Logger for messages concerning the caching access.
virtual void ImposeVisibility(EVisibility ImposedVisibility)=0
Imposes a visibility to the natural visibility of the node.
used internally for AccessMode cycle detection
GENICAM_NAMESPACE::gcstring m_DeviceName
The device name of the node tree.
GENICAM_NAMESPACE::ILogger * m_pPortLog
Logger for messages concerning the port access.
virtual bool IsFeature() const =0
True if the node can be reached via category nodes from a category node named "Root".
virtual bool GetProperty(CNodeDataMap *pNodeDataMap, CPropertyID::EProperty_ID_t PropertyID, CNodeData::PropertyVector_t &PropertyList) const =0
Retrieves a property from the node map itself.
EYesNo m_IsDeprecated
indicates that the feature should not be used any more
callback body instance for INode pointers
GENICAM_INTERFACE INodeMap
Interface to access the node map.
NodePrivateVector_t m_AllTerminalNodes
All indirectly connected terminal nodes For details see GenICam wiki : GenApi/SoftwareArchitecture/No...
GENICAM_NAMESPACE::ILogger * m_pRangeLog
Logger for messages concerning the range check.
CNodeData::ENodeType_t m_NodeTypeEnum
EntryMethodFinalizer(const INodePrivate *pThis, EMethod EntryMethod, bool IgnoreCache=false)
Constructor.
NodePrivateVector_t m_WritingChildren
all nodes which can write a value further down the node stack For details see GenICam wiki : GenApi/S...
Used to ensure that PostSetValue() is called in any case.
GENICAM_NAMESPACE::gcstring m_EventID
The EventID.
UserData_t m_pUserData
Storage of user defined data. Ownership remains by the user!. Use IUserData interface to access the d...
node_vector NodeList_t
a list of node references
CNodeImpl * m_pThis
pointer to owner object
enum GENAPI_NAMESPACE::_ECachingMode ECachingMode
caching mode of a register
INode * m_pAlias
Pointer to a Node, which describes the same feature as this one.
bool DeleteDoubleCallbacksCompare(GENAPI_NAMESPACE::CNodeCallback *pA, GENAPI_NAMESPACE::CNodeCallback *pB)
Helper function for DeleteDoubleCallbacks.
Encapsulates a GenApi pointer dealing with the dynamic_cast automatically.
NodePrivateVector_t m_ReadingChildren
all nodes which can be read from For details see GenICam wiki : GenApi/SoftwareArchitecture/NodeDepen...
std::ostringstream ostringstream_t
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IEnumeration
Interface for enumeration properties.
enum GENAPI_NAMESPACE::_EYesNo EYesNo
Defines the choices of a Yes/No alternatives.
virtual void GetParents(GENAPI_NAMESPACE::NodeList_t &Parents) const =0
Gets all nodes this node is directly depending on.
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT CNodeData::ENodeType_t NodeID_t NodeID
static const size_t MaxPath
GENICAM_NAMESPACE::ILogger * m_pPreProcLog
Logger for things done during pre-processing of the node map, e.g. determining dependencies.
virtual EInterfaceType InternalGetPrincipalInterfaceType() const
Implementation of IBase::GetPrincipalInterfaceType()
IEnumeration * m_pError
Pointer to a Error class.
Definition of polymorphical smart pointer.
virtual void ImposeAccessMode(EAccessMode ImposedAccessMode)=0
Imposes an access mode to the natural access mode of the node.
NodePrivateVector_t m_InvalidatingChildren
All directly connected nodes which invalidate this node For details see GenICam wiki : GenApi/Softwar...
EMethod
denotes through which method call the node tree was entered
virtual INode * GetAlias() const =0
Retrieves the a node which describes the same feature in a different way.
virtual bool IsStreamable() const =0
True if the node is streamable.
void add_child(CPropertyID::EProperty_ID_t PropertyID, CProperty &, INodePrivate *pNode)
GENICAM_NAMESPACE::ILogger * m_pValueLog
Logger for messages concerning the getting and setting values.
int64_t m_ElapsedTime
time elapsed since the last poll
bool m_TerminalNodeWritten
indicates that this terminal node was written and not yet invalidated.
AutoLock Lock
shortcut for the lock type
GENICAM_NAMESPACE::gcstring m_DisplayName
The display name string of the node.
virtual GENICAM_NAMESPACE::gcstring GetEventID() const =0
Get the EventId of the node.
Standard implementation for the INode and the ISelector interface.
PostSetValueFinalizer(CNodeImpl *pThis, std::list< CNodeCallback * > &CallbacksToFire)
Constructor.
intptr_t CallbackHandleType
the callback handle for nodes
virtual void CollectCallbacksToFire(std::list< CNodeCallback * > &CallbacksToFire, bool allDependents=false)=0
Update the registered callbacks.
virtual CNodeData::ENodeType_t GetNodeType()=0
Reads back the node type.
EAccessMode m_ImposedAccessMode
Access mode imposed on the natural access mode of the node.
EAccessMode m_AccessModeCache
cache access mode
virtual UserData_t SetUserData(UserData_t userdata)=0
Stores user defined data without taking ownership. Returns the previously stored value.
A string class which is a clone of std::string.
NodeList_t m_Invalidators
List of references to nodes which may invalidate this node.
virtual void GetSelectingFeatures(FeatureList_t &) const =0
retrieve the group of features selecting this node
EYesNo m_IsStreamable
indicates if the node is streamable
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT CNodeData::ENodeType_t NodeType
PropagateTerminals not run for node.
~EntryMethodFinalizer()
Destructor calling.
bool m_ListOfValidValuesCacheValid
true if the list of valid value is cached
CBooleanPolyRef m_IsLocked
Reference to a Node, which indicates if the node is locked (i.e. not writable)
void SetParent(INodePrivate *pParent)
Sets a parent : CAVE : for internal use only...
enum GENAPI_NAMESPACE::_EAccessMode EAccessMode
access mode of a node
virtual INode * GetCastAlias() const =0
Retrieves the a node which describes the same feature so that it can be casted.
virtual NodeID_t GetNodeID()=0
Reads back the node id.
Object is not yet initialized.
GENICAM_NAMESPACE::ILogger * m_pMiscLog
Logger for messages concerning miscellaneous access which does not fit to the other categories...
virtual void SetInvalid(ESetInvalidMode simMode)=0
Invalidate the node resp. the node and all of its dependents.
GENICAM_NAMESPACE::gcstring m_DocuURL
A URL pointing or the documentation of this featrues.
void CacheAccessModeIfPossible(EAccessMode AccessMode) const
GENICAM_INTERFACE INode
Interface common to all nodes.
FeatureList_t m_Selecting
List of selecting features.
Used to ensure that PostSetValue() is called in any case.
GENICAM_NAMESPACE::gcstring GetNodeType() const
~PostSetValueFinalizer()
Destructor calling PostSetValue()
Definition of interface INodeMapPrivate.
ESetInvalidMode
Three different modes of operation for INodePrivate::SetInvalid()
virtual bool Poll(int64_t ElapsedTime)=0
Invalidates the node if the polling time has elapsed.
int64_t m_PollingTime
recommended polling time in [ms]
virtual void GetPropertyNames(GENICAM_NAMESPACE::gcstring_vector &PropertyNames) const =0
Returns a list of the names all properties set during initialization.
GENICAM_NAMESPACE::gcstring_vector m_PropertyNames
Helper: A list of all properties belonging to this node.
virtual GENICAM_NAMESPACE::gcstring GetVendorName()=0
Get the vendor name.
PropagateTerminals is in progress for node, used for detecting cycles.
virtual void FinalConstruct(bool DetermineDependencies)=0
finalizes construction of the node map
ETerminalPropagationState
States when propagating terminals.
void push_back_unique(C &c, const V &v)
Add a value to container if not already present.
void Value2String(T Value, GENICAM_NAMESPACE::gcstring &ValueStr)
Converts an T property to a string.
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT ISelector
Interface for groups of features selected by a single one.
Lexical analyzer for CIntSwissKnife.
Definition of interface INodePrivate.
enum GENAPI_NAMESPACE::_EInterfaceType EInterfaceType
typedef for interface type
FeatureList_t m_Selected
List of selected features.
virtual void GetTerminalNodes(NodeList_t &) const =0
Returns the list of all terminal nodes a write access to this node will eventually write to...
virtual CLock & GetLock() const =0
Returns the lock which guards the node map.
void DeleteDoubleCallbacks(std::list< CNodeCallback * > &CallbackList)
deletes double callbacks from list
enum GENAPI_NAMESPACE::_ENameSpace ENameSpace
Defines if a node name is standard or custom.
INode * m_pCastAlias
Pointer to a Node, which describes the same feature as this one so that it can be casted...
INodeMapPrivate * m_pNodeMapPrivate
Private cache for the INodeMapPrivate pointer.
ECachingMode m_CachingMode
indicates that the node has changed
enum GENAPI_NAMESPACE::_ELinkType ELinkType
typedef for link type