All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
NodeT.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 // (c) 2006 by Basler Vision Technologies
3 // Section: Vision Components
4 // Project: GenApi
5 // Author: Alexander Happe
6 // $Header$
7 //
8 // License: This file is published under the license of the EMVA GenICam Standard Group.
9 // A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'.
10 // If for some reason you are missing this file please contact the EMVA or visit the website
11 // (http://www.genicam.org) for a full copy.
12 //
13 // THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS"
14 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP
17 // OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
20 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
21 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
23 // POSSIBILITY OF SUCH DAMAGE.
24 //-----------------------------------------------------------------------------
31 #ifndef GENAPI_NODET_H
32 #define GENAPI_NODET_H
33 
34 #include "../NodeCallback.h"
35 #include "../INode.h"
36 #include "../Synch.h"
37 #include "GenApi/impl/Log.h"
38 #include "Node.h"
39 #ifndef _MSC_VER
40 #include <list>
41 #endif
42 
43 namespace GENAPI_NAMESPACE
44 {
45 
49  template< class Base >
50  class NodeT : public Base
51  {
52  public:
54  virtual GENICAM_NAMESPACE::gcstring GetName(bool FullQualified) const
55  {
57 
58  return Base::InternalGetName(FullQualified);
59  }
60 
63  {
65 
66  return Base::InternalGetNameSpace();
67  }
68 
70  virtual EVisibility GetVisibility() const
71  {
73 
74  EVisibility NaturalVisibility = Base::InternalGetVisibility();
75 
76  EVisibility Visibility = Combine(NaturalVisibility, Base::m_ImposedVisibility);
77 
78  return Visibility;
79  }
80 
82  virtual void InvalidateNode()
83  {
84  // a list of callbacks to fire held outside(!) the autolock on the stack(!)
85  std::list<CNodeCallback*> CallbacksToFire;
86  {
88  typename Base::EntryMethodFinalizer E(this, meInvalidateNode);
89 
90  Base::InternalInvalidateNode( CallbacksToFire );
91 
92  // fire callbacks inside the lock
93  std::list<CNodeCallback*>::iterator ptrCallback;
94  for( ptrCallback = CallbacksToFire.begin(); ptrCallback != CallbacksToFire.end(); ptrCallback++ )
95  {
96  (*ptrCallback)->operator ()(cbPostInsideLock);
97  }
98  }
99 
100  // fire callbacks outside the lock
101  std::list<CNodeCallback*>::iterator ptrCallback;
102  for( ptrCallback = CallbacksToFire.begin(); ptrCallback != CallbacksToFire.end(); ptrCallback++ )
103  {
104  (*ptrCallback)->operator ()(cbPostOutsideLock);
105  }
106  }
107 
109  virtual bool IsCachable()const
110  {
111  AutoLock l(Base::GetLock());
112 
113  return Base::InternalIsCachable();
114  }
115 
117  virtual ECachingMode GetCachingMode() const
118  {
119  AutoLock l(Base::GetLock());
120 
121  return Base::InternalGetCachingMode();
122  }
123 
126  {
127  AutoLock l(Base::GetLock());
128 
129  return Base::InternalIsAccessModeCacheable();
130  }
131 
133  virtual int64_t GetPollingTime()const
134  {
135  AutoLock l(Base::GetLock());
136 
137  return Base::InternalGetPollingTime();
138  }
139 
142  {
143  AutoLock l(Base::GetLock());
144 
145  return Base::InternalGetToolTip();
146  }
147 
150  {
151  AutoLock l(Base::GetLock());
152 
153  return Base::InternalGetDescription();
154  }
155 
158  {
159  AutoLock l(Base::GetLock());
160 
161  return Base::InternalGetDisplayName();
162  }
163 
166  {
167  AutoLock l(Base::GetLock());
168 
169  return Base::InternalGetDeviceName();
170  }
171 
173  virtual void GetChildren(NodeList_t &Children, ELinkType LinkType) const
174  {
175  AutoLock l(Base::GetLock());
176 
177  Base::InternalGetChildren( Children, LinkType );
178  }
179 
182  {
183  AutoLock l(Base::GetLock());
184 
185  return Base::InternalRegisterCallback( pCallback );
186  }
187 
189  virtual bool DeregisterCallback( CallbackHandleType hCallback )
190  {
191  AutoLock l(Base::GetLock());
192 
193  return Base::InternalDeregisterCallback( hCallback );
194  }
195 
197  virtual INodeMap* GetNodeMap() const
198  {
199  AutoLock l(Base::GetLock());
200 
201  return Base::InternalGetNodeMap();
202  }
203 
206  {
207  AutoLock l(Base::GetLock());
208 
209  return Base::GetEventID();
210  }
211 
213  virtual void GetPropertyNames(GENICAM_NAMESPACE::gcstring_vector &PropertyNames) const
214  {
215  AutoLock l(Base::GetLock());
216 
217  Base::GetPropertyNames(PropertyNames);
218  }
219 
221 
222  virtual bool GetProperty(const GENICAM_NAMESPACE::gcstring& PropertyName, GENICAM_NAMESPACE::gcstring& ValueStr, GENICAM_NAMESPACE::gcstring& AttributeStr)
223  {
224  AutoLock l(Base::GetLock());
225 
226  return CNodeImpl::GetProperty(PropertyName, ValueStr, AttributeStr);
227  }
228 
229  virtual bool GetProperty(CNodeDataMap *pNodeDataMap, CPropertyID::EProperty_ID_t PropertyID, CNodeData::PropertyVector_t &PropertyList)
230  {
231  AutoLock l(Base::GetLock());
232 
233  return Base::GetProperty(pNodeDataMap, PropertyID, PropertyList);
234  }
235 
236 
239  {
240  AutoLock l(Base::GetLock());
241 
242  return Base::InternalGetDocuURL();
243  }
244 
246  virtual bool IsDeprecated() const
247  {
248  AutoLock l(Base::GetLock());
249 
250  return Base::InternalIsDeprecated();
251  }
252 
255  {
256  AutoLock l(Base::GetLock());
257 
258  return Base::InternalGetPrincipalInterfaceType();
259  }
260 
261  private:
262  // suppress assignment operator
263  NodeT<Base>& operator=( const NodeT<Base>& );
264 
265  };
266 
267 
268 }
269 
270 #endif // GENAPI_NODET_H
GENAPI_NAMESPACE
Lexical analyzer for CIntSwissKnife.
Definition: Destructible.h:30
GENAPI_NAMESPACE::NodeT::GetNodeMap
virtual INodeMap * GetNodeMap() const
Implementation of INode::GetNodeMap()
Definition: NodeT.h:197
GENAPI_NAMESPACE::NodeT::GetNameSpace
virtual GENAPI_NAMESPACE::ENameSpace GetNameSpace() const
Implementation of INode::GetNameSpace()
Definition: NodeT.h:62
GENAPI_NAMESPACE::NodeT::IsAccessModeCacheable
virtual EYesNo IsAccessModeCacheable() const
True if the AccessMode can be cached.
Definition: NodeT.h:125
GENAPI_NAMESPACE::NodeT::GetProperty
virtual bool GetProperty(CNodeDataMap *pNodeDataMap, CPropertyID::EProperty_ID_t PropertyID, CNodeData::PropertyVector_t &PropertyList)
Definition: NodeT.h:229
GENAPI_NAMESPACE::cbPostOutsideLock
@ cbPostOutsideLock
callback is fired on leaving the tree inside the lock-guarded area
Definition: NodeCallback.h:48
GENAPI_NAMESPACE::NodeT::GetToolTip
virtual GENICAM_NAMESPACE::gcstring GetToolTip() const
Implementation of INode::GetToolTip()
Definition: NodeT.h:141
GENAPI_NAMESPACE::NodeT::GetDescription
virtual GENICAM_NAMESPACE::gcstring GetDescription() const
Implementation of INode::GetDescription()
Definition: NodeT.h:149
GENAPI_NAMESPACE::NodeT::GetPollingTime
virtual int64_t GetPollingTime() const
Implementation of INode::GetPollingTime()
Definition: NodeT.h:133
GENAPI_NAMESPACE::Combine
EAccessMode Combine(EAccessMode Peter, EAccessMode Paul)
Computes which access mode the two guards allow together.
Definition: INode.h:250
GENICAM_NAMESPACE::gcstring
A string class which is a clone of std::string.
Definition: GCString.h:52
GENAPI_NAMESPACE::CNodeImpl::GetProperty
virtual bool GetProperty(const GENICAM_NAMESPACE::gcstring &PropertyName, GENICAM_NAMESPACE::gcstring &ValueStr, GENICAM_NAMESPACE::gcstring &AttributeStr)
Retrieves a property plus an additional attribute by name.
GENAPI_NAMESPACE::NodeT::GetPrincipalInterfaceType
virtual EInterfaceType GetPrincipalInterfaceType() const
Implementation of IBase::GetPrincipalInterfaceType()
Definition: NodeT.h:254
GENAPI_NAMESPACE::NodeT::DeregisterCallback
virtual bool DeregisterCallback(CallbackHandleType hCallback)
Implementation of INode::DeregisterCallback()
Definition: NodeT.h:189
GENAPI_NAMESPACE::CNodeCallback
callback body instance for INode pointers
Definition: NodeCallback.h:55
GENAPI_NAMESPACE::GetLock
virtual CLock & GetLock() const =0
Returns the lock which guards the node map.
GENAPI_NAMESPACE::NodeT::GetProperty
virtual bool GetProperty(const GENICAM_NAMESPACE::gcstring &PropertyName, GENICAM_NAMESPACE::gcstring &ValueStr, GENICAM_NAMESPACE::gcstring &AttributeStr)
Retrieves a property plus an additional attribute by name.
Definition: NodeT.h:222
GENAPI_NAMESPACE::NodeT::GetDocuURL
virtual GENICAM_NAMESPACE::gcstring GetDocuURL() const
Gets a URL pointing to the documentation of that feature.
Definition: NodeT.h:238
GENAPI_NAMESPACE::NodeT::operator=
NodeT< Base > & operator=(const NodeT< Base > &)
GENAPI_NAMESPACE::NodeT
Implementation of the INode interface.
Definition: NodeT.h:50
GENAPI_NAMESPACE::NodeT::GetName
virtual GENICAM_NAMESPACE::gcstring GetName(bool FullQualified) const
Implementation of INode::GetName()
Definition: NodeT.h:54
GENAPI_NAMESPACE::NodeT::RegisterCallback
virtual CallbackHandleType RegisterCallback(CNodeCallback *pCallback)
Implementation of INode::RegisterCallback()
Definition: NodeT.h:181
GENAPI_NAMESPACE::INodeMap
GENICAM_INTERFACE INodeMap
Interface to access the node map.
Definition: INode.h:52
GENAPI_NAMESPACE::NodeT::InvalidateNode
virtual void InvalidateNode()
Implementation of INode::InvalidateNode()
Definition: NodeT.h:82
GENAPI_NAMESPACE::EInterfaceType
enum GENAPI_NAMESPACE::_EInterfaceType EInterfaceType
typedef for interface type
GENAPI_NAMESPACE::NodeT::GetVisibility
virtual EVisibility GetVisibility() const
Implementation of INode::GetVisibility()
Definition: NodeT.h:70
GENAPI_NAMESPACE::NodeT::GetPropertyNames
virtual void GetPropertyNames(GENICAM_NAMESPACE::gcstring_vector &PropertyNames) const
Returns a list of the names all properties set during initialization.
Definition: NodeT.h:213
GENAPI_NAMESPACE::NodeT::GetDeviceName
virtual GENICAM_NAMESPACE::gcstring GetDeviceName() const
Implementation of INode::GetDeviceName.
Definition: NodeT.h:165
GENAPI_NAMESPACE::ELinkType
enum GENAPI_NAMESPACE::_ELinkType ELinkType
typedef for link type
GENAPI_NAMESPACE::NodeT::IsDeprecated
virtual bool IsDeprecated() const
True if the node should not be used any more.
Definition: NodeT.h:246
Node.h
GENAPI_NAMESPACE::GetPropertyNames
virtual void GetPropertyNames(GENICAM_NAMESPACE::gcstring_vector &PropertyNames) const =0
Returns a list of the names all properties set during initialization.
GENAPI_NAMESPACE::AutoLock
Definition: Synch.h:139
GENAPI_NAMESPACE::GetProperty
virtual bool GetProperty(CNodeDataMap *pNodeDataMap, CPropertyID::EProperty_ID_t PropertyID, CNodeData::PropertyVector_t &PropertyList) const =0
Retrieves a property from the node map itself.
GENAPI_NAMESPACE::GetEventID
virtual GENICAM_NAMESPACE::gcstring GetEventID() const =0
Get the EventId of the node.
GENAPI_NAMESPACE::CallbackHandleType
intptr_t CallbackHandleType
the callback handle for nodes
Definition: INode.h:58
GENAPI_NAMESPACE::EYesNo
enum GENAPI_NAMESPACE::_EYesNo EYesNo
Defines the choices of a Yes/No alternatives.
GENAPI_NAMESPACE::NodeT::IsCachable
virtual bool IsCachable() const
Implementation of INode::IsCachable()
Definition: NodeT.h:109
GENAPI_NAMESPACE::ENameSpace
enum GENAPI_NAMESPACE::_ENameSpace ENameSpace
Defines if a node name is standard or custom.
GENAPI_NAMESPACE::EVisibility
enum GENAPI_NAMESPACE::_EVisibility EVisibility
recommended visibility of a node
int64_t
__int64 int64_t
Definition: config-win32.h:21
GENAPI_NAMESPACE::NodeT::GetDisplayName
virtual GENICAM_NAMESPACE::gcstring GetDisplayName() const
Implementation of INode::GetDisplayName.
Definition: NodeT.h:157
GENAPI_NAMESPACE::NodeT::GetCachingMode
virtual ECachingMode GetCachingMode() const
Implementation of INode::GetCachingMode.
Definition: NodeT.h:117
GENAPI_NAMESPACE::ECachingMode
enum GENAPI_NAMESPACE::_ECachingMode ECachingMode
caching mode of a register
GENAPI_NAMESPACE::NodeT::GetChildren
virtual void GetChildren(NodeList_t &Children, ELinkType LinkType) const
Implementation of INode::GetChildren()
Definition: NodeT.h:173
GENAPI_NAMESPACE::meInvalidateNode
@ meInvalidateNode
Definition: Exception.h:59
GENAPI_NAMESPACE::cbPostInsideLock
@ cbPostInsideLock
Definition: NodeCallback.h:47
GENAPI_NAMESPACE::NodeT::GetEventID
virtual GENICAM_NAMESPACE::gcstring GetEventID() const
Implementation of INode::GetNodeMap()
Definition: NodeT.h:205
GENAPI_NAMESPACE::NodeList_t
node_vector NodeList_t
a list of node references
Definition: INode.h:55


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Wed Dec 4 2024 03:10:11