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" 67 template<
typename C,
typename V>
70 if (std::find(c.begin(), c.end(), v) == c.end())
106 #pragma BullseyeCoverage off 111 #pragma BullseyeCoverage on 131 virtual void InternalInvalidateNode( std::list<CNodeCallback*> &CallbacksToFire );
134 virtual bool InternalIsCachable()
const;
140 virtual int64_t InternalGetPollingTime()
const;
168 virtual INodeMap* InternalGetNodeMap()
const;
179 virtual void GetPropertyNames(GENICAM_NAMESPACE::gcstring_vector &PropertyNames)
const;
198 virtual void InternalCheckError()
const;
204 virtual bool InternalIsDeprecated()
const;
210 virtual EYesNo InternalIsAccessModeCacheable()
const;
218 #pragma BullseyeCoverage off 220 #pragma BullseyeCoverage on 223 m_AccessModeCache =
RW;
224 GCLOGWARN( m_pAccessLog,
"InternalGetAccessMode : ReadCycle detected at = '%s'", m_Name.c_str() );
239 virtual bool GetProperty(CNodeDataMap *pNodeDataMap, CPropertyID::EProperty_ID_t PropertyID, CNodeData::PropertyVector_t &PropertyList)
const;
241 virtual void CollectCallbacksToFire(std::list<CNodeCallback*> &CallbacksToFire,
bool allDependents =
false);
251 virtual bool IsSelector()
const;
274 # define ADD_ORPHAN_CHILD( PropertyID, Property ) \ 275 INodePrivate *pNode = dynamic_cast<CNodeMap*>(m_pNodeMap)->_GetNodeByID( Property.NodeID() ); \ 276 if( CPropertyID::IsInvalidatingPointer(PropertyID) )\ 278 detail::push_back_unique(m_InvalidatingChildren, pNode); \ 279 if( CPropertyID::IsReadingPointer(PropertyID) ) \ 281 detail::push_back_unique(m_ReadingChildren, pNode); \ 282 if( CPropertyID::IsWritingPointer(PropertyID) ) \ 284 detail::push_back_unique(m_WritingChildren, pNode); \ 290 # define ADD_CHILD( PropertyID, Property ) \ 291 INodePrivate *pNode = dynamic_cast<CNodeMap*>(m_pNodeMap)->_GetNodeByID( Property.NodeID() ); \ 292 if( CPropertyID::IsInvalidatingPointer(PropertyID) )\ 294 detail::push_back_unique(m_InvalidatingChildren, pNode);\ 295 dynamic_cast<CNodeImpl*>(pNode)->SetParent( this );\ 296 if( CPropertyID::IsReadingPointer(PropertyID) ) \ 298 detail::push_back_unique(m_ReadingChildren, pNode);\ 299 if( CPropertyID::IsWritingPointer(PropertyID) ) \ 301 detail::push_back_unique(m_WritingChildren, pNode); \ 307 # define ADD_ORPHAN_CHILD( PropertyID, Property ) \ 308 INodePrivate *pNode = dynamic_cast<CNodeMap*>(m_pNodeMap)->_GetNodeByID(Property.NodeID()); \ 309 add_orphan_child( PropertyID, Property, pNode ); 311 # define ADD_CHILD( PropertyID, Property ) \ 312 INodePrivate *pNode = dynamic_cast<CNodeMap*>(m_pNodeMap)->_GetNodeByID(Property.NodeID()); \ 313 add_child( PropertyID, Property, pNode ); 319 if (CPropertyID::IsInvalidatingPointer(PropertyID))
322 dynamic_cast<CNodeImpl*
>(pNode)->SetParent(
this);
323 if (CPropertyID::IsReadingPointer(PropertyID))
326 if (CPropertyID::IsWritingPointer(PropertyID))
336 if (CPropertyID::IsInvalidatingPointer(PropertyID))
339 if (CPropertyID::IsReadingPointer(PropertyID))
342 if (CPropertyID::IsWritingPointer(PropertyID))
362 std::string nodetype;
365 return nodetype.c_str();
442 eTerminalPropagationDone
518 virtual bool InternalIsValueCacheValid()
const;
548 void PostSetValue( std::list<CNodeCallback*> &CallbacksToFire );
560 m_CallbacksToFire( CallbacksToFire )
566 m_pThis->PostSetValue( m_CallbacksToFire );
594 m_pNodeMapPrivate =
dynamic_cast<INodeMapPrivate*
>( pThis->GetNodeMap() );
595 m_pNodeMapPrivate->SetEntryPoint( EntryMethod, pThis, IgnoreCache );
601 m_pNodeMapPrivate->ResetEntryPoint();
656 #if defined( _WIN32 ) && !defined( PHARLAP_WIN32 ) 658 typedef std::wstring::size_type
size_type;
661 #define QUALIFY_LITERAL( x ) _L( x ) 662 #define _L( x ) L ## x 663 #define GET_MODULE_FILE_NAME GetModuleFileNameW 664 #define GET_CSTR( x ) x.w_str().c_str() 665 #define GET_LOCALE_INFO GetLocaleInfoW 671 #define QUALIFY_LITERAL( x ) x 672 #define GET_MODULE_FILE_NAME GetModuleFileName 673 #define GET_CSTR( x ) x.c_str() 674 #define GET_LOCALE_INFO GetLocaleInfo 678 void GetNodeName( string_t& VariableContent )
const;
679 void GetStringStreamContent(
const ostringstream_t& Content, string_t& VariableContent )
const;
681 void GetModelName( string_t& VariableContent )
const;
695 #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_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.
LOG4CPP_NS::Category * m_pMiscLog
Logger for messages concerning miscellaneous access which does not fit to the other categories...
interface GENAPI_DECL_ABSTRACT INodePrivate
Interface including the methods for node construction common to all nodes.
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.
std::string::size_type size_type
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
std::vector< INodePrivate * > NodePrivateVector_t
a vector of node references using the INodePrivate interface
bool IsAccessModeCached() const
returns true, if the AccessModeCache is valid
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.
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.
interface GENAPI_DECL_ABSTRACT INodeMap
Interface to access the node map.
virtual bool IsFeature() const =0
True if the node can be reached via category nodes from a category node named "Root".
interface GENAPI_DECL_ABSTRACT IEnumeration
Interface for enumeration properties.
LOG4CPP_NS_BEGIN class LOG4CPP_EXPORT Category
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
NodePrivateVector_t m_AllTerminalNodes
All indirectly connected terminal nodes For details see GenICam wiki : GenApi/SoftwareArchitecture/No...
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.
LOG4CPP_NS::Category * m_pValueLog
Logger for messages concerning the getting and setting values.
interface GENAPI_DECL_ABSTRACT IBase
Base interface common to all nodes.
UserData_t m_pUserData
Storage of user defined data.
node_vector NodeList_t
a list of node references
interface GENAPI_DECL_ABSTRACT CNodeData::ENodeType_t NodeID_t NodeID
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.
interface GENAPI_DECL_ABSTRACT ISelector
Interface for groups of features selected by a single one.
NodePrivateVector_t m_ReadingChildren
all nodes which can be read from For details see GenICam wiki : GenApi/SoftwareArchitecture/NodeDepen...
std::ostringstream ostringstream_t
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.
static const size_t MaxPath
LOG4CPP_NS::Category * 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()
interface GENAPI_DECL_ABSTRACT CNodeData::ENodeType_t NodeType
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.
LOG4CPP_NS::Category * m_pAccessLog
Logger for messages concerning the AccessMode.
void add_child(CPropertyID::EProperty_ID_t PropertyID, CProperty &, INodePrivate *pNode)
interface GENAPI_DECL_ABSTRACT IUserData
Interface to manage user data stored in nodes or nodemaps.
int64_t m_ElapsedTime
time elapsed since the last poll
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.
LOG4CPP_NS::Category * m_pRangeLog
Logger for messages concerning the range check.
intptr_t CallbackHandleType
the callback handle for nodes
virtual void CollectCallbacksToFire(std::list< CNodeCallback * > &CallbacksToFire, bool allDependents=false)=0
Update the registered callbacks.
interface GENAPI_DECL_ABSTRACT INodeMapPrivate
NodeMap functions used for initialization.
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
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.
virtual void SetInvalid(ESetInvalidMode simMode)=0
Invalidate the node resp. the node and all of its dependents.
LOG4CPP_NS::Category * m_pCacheLog
Logger for messages concerning the caching access.
GENICAM_NAMESPACE::gcstring m_DocuURL
A URL pointing or the documentation of this featrues.
void CacheAccessModeIfPossible(EAccessMode AccessMode) const
FeatureList_t m_Selecting
List of selecting features.
Used to ensure that PostSetValue() is called in any case.
LOG4CPP_NS::Category * m_pPortLog
Logger for messages concerning the port access.
GENICAM_NAMESPACE::gcstring GetNodeType() const
~PostSetValueFinalizer()
Destructor calling PostSetValue()
Definition of interface INodeMapPrivate.
interface GENAPI_DECL_ABSTRACT INode
Interface common to all nodes.
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.
Part of the generic device API.
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