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 
89  Base::InternalInvalidateNode( CallbacksToFire );
90 
91  // fire callbacks inside the lock
92  std::list<CNodeCallback*>::iterator ptrCallback;
93  for( ptrCallback = CallbacksToFire.begin(); ptrCallback != CallbacksToFire.end(); ptrCallback++ )
94  {
95  (*ptrCallback)->operator ()(cbPostInsideLock);
96  }
97  }
98 
99  // fire callbacks outside the lock
100  std::list<CNodeCallback*>::iterator ptrCallback;
101  for( ptrCallback = CallbacksToFire.begin(); ptrCallback != CallbacksToFire.end(); ptrCallback++ )
102  {
103  (*ptrCallback)->operator ()(cbPostOutsideLock);
104  }
105  }
106 
108  virtual bool IsCachable()const
109  {
110  AutoLock l(Base::GetLock());
111 
112  return Base::InternalIsCachable();
113  }
114 
116  virtual ECachingMode GetCachingMode() const
117  {
118  AutoLock l(Base::GetLock());
119 
120  return Base::InternalGetCachingMode();
121  }
122 
125  {
126  AutoLock l(Base::GetLock());
127 
128  return Base::InternalIsAccessModeCacheable();
129  }
130 
132  virtual int64_t GetPollingTime()const
133  {
134  AutoLock l(Base::GetLock());
135 
136  return Base::InternalGetPollingTime();
137  }
138 
141  {
142  AutoLock l(Base::GetLock());
143 
144  return Base::InternalGetToolTip();
145  }
146 
149  {
150  AutoLock l(Base::GetLock());
151 
152  return Base::InternalGetDescription();
153  }
154 
157  {
158  AutoLock l(Base::GetLock());
159 
160  return Base::InternalGetDisplayName();
161  }
162 
165  {
166  AutoLock l(Base::GetLock());
167 
168  return Base::InternalGetDeviceName();
169  }
170 
172  virtual void GetChildren(NodeList_t &Children, ELinkType LinkType) const
173  {
174  AutoLock l(Base::GetLock());
175 
176  return Base::InternalGetChildren( Children, LinkType );
177  }
178 
181  {
182  AutoLock l(Base::GetLock());
183 
184  return Base::InternalRegisterCallback( pCallback );
185  }
186 
188  virtual bool DeregisterCallback( CallbackHandleType hCallback )
189  {
190  AutoLock l(Base::GetLock());
191 
192  return Base::InternalDeregisterCallback( hCallback );
193  }
194 
196  virtual INodeMap* GetNodeMap() const
197  {
198  AutoLock l(Base::GetLock());
199 
200  return Base::InternalGetNodeMap();
201  }
202 
205  {
206  AutoLock l(Base::GetLock());
207 
208  return Base::GetEventID();
209  }
210 
212  virtual void GetPropertyNames(GENICAM_NAMESPACE::gcstring_vector &PropertyNames) const
213  {
214  AutoLock l(Base::GetLock());
215 
216  Base::GetPropertyNames(PropertyNames);
217  }
218 
220 
221  virtual bool GetProperty(const GENICAM_NAMESPACE::gcstring& PropertyName, GENICAM_NAMESPACE::gcstring& ValueStr, GENICAM_NAMESPACE::gcstring& AttributeStr)
222  {
223  AutoLock l(Base::GetLock());
224 
225  return CNodeImpl::GetProperty(PropertyName, ValueStr, AttributeStr);
226  }
227 
228  virtual bool GetProperty(CNodeDataMap *pNodeDataMap, CPropertyID::EProperty_ID_t PropertyID, CNodeData::PropertyVector_t &PropertyList)
229  {
230  AutoLock l(Base::GetLock());
231 
232  return Base::GetProperty(pNodeDataMap, PropertyID, PropertyList);
233  }
234 
235 
238  {
239  AutoLock l(Base::GetLock());
240 
241  return Base::InternalGetDocuURL();
242  }
243 
245  virtual bool IsDeprecated() const
246  {
247  AutoLock l(Base::GetLock());
248 
249  return Base::InternalIsDeprecated();
250  }
251 
254  {
255  AutoLock l(Base::GetLock());
256 
257  return Base::InternalGetPrincipalInterfaceType();
258  }
259 
260  private:
261  // suppress assignment operator
262  NodeT<Base>& operator=( const NodeT<Base>& );
263 
264  };
265 
266 
267 }
268 
269 #endif // GENAPI_NODET_H
virtual bool GetProperty(const GENICAM_NAMESPACE::gcstring &PropertyName, GENICAM_NAMESPACE::gcstring &ValueStr, GENICAM_NAMESPACE::gcstring &AttributeStr) const
Retrieves a property plus an additional attribute by name.
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:221
virtual EInterfaceType GetPrincipalInterfaceType() const
Implementation of IBase::GetPrincipalInterfaceType()
Definition: NodeT.h:253
NodeT< Base > & operator=(const NodeT< Base > &)
enum GENAPI_NAMESPACE::_EVisibility EVisibility
recommended visibility of a node
virtual bool IsCachable() const
Implementation of INode::IsCachable()
Definition: NodeT.h:108
virtual INodeMap * GetNodeMap() const
Implementation of INode::GetNodeMap()
Definition: NodeT.h:196
virtual bool DeregisterCallback(CallbackHandleType hCallback)
Implementation of INode::DeregisterCallback()
Definition: NodeT.h:188
virtual void GetPropertyNames(GENICAM_NAMESPACE::gcstring_vector &PropertyNames) const
Returns a list of the names all properties set during initialization.
Definition: NodeT.h:212
__int64 int64_t
Definition: config-win32.h:21
virtual CallbackHandleType RegisterCallback(CNodeCallback *pCallback)
Implementation of INode::RegisterCallback()
Definition: NodeT.h:180
virtual GENICAM_NAMESPACE::gcstring GetName(bool FullQualified) const
Implementation of INode::GetName()
Definition: NodeT.h:54
EAccessMode Combine(EAccessMode Peter, EAccessMode Paul)
Computes which access mode the two guards allow together.
Definition: INode.h:250
interface GENAPI_DECL_ABSTRACT INodeMap
Interface to access the node map.
Definition: INodeMap.h:56
virtual bool GetProperty(CNodeDataMap *pNodeDataMap, CPropertyID::EProperty_ID_t PropertyID, CNodeData::PropertyVector_t &PropertyList) const =0
Retrieves a property from the node map itself.
callback body instance for INode pointers
Definition: NodeCallback.h:55
virtual int64_t GetPollingTime() const
Implementation of INode::GetPollingTime()
Definition: NodeT.h:132
virtual GENICAM_NAMESPACE::gcstring GetDeviceName() const
Implementation of INode::GetDeviceName.
Definition: NodeT.h:164
virtual void GetChildren(NodeList_t &Children, ELinkType LinkType) const
Implementation of INode::GetChildren()
Definition: NodeT.h:172
virtual EVisibility GetVisibility() const
Implementation of INode::GetVisibility()
Definition: NodeT.h:70
Implementation of the INode interface.
Definition: NodeT.h:50
node_vector NodeList_t
a list of node references
Definition: INode.h:55
enum GENAPI_NAMESPACE::_ECachingMode ECachingMode
caching mode of a register
virtual bool GetProperty(CNodeDataMap *pNodeDataMap, CPropertyID::EProperty_ID_t PropertyID, CNodeData::PropertyVector_t &PropertyList)
Definition: NodeT.h:228
virtual void InvalidateNode()
Implementation of INode::InvalidateNode()
Definition: NodeT.h:82
enum GENAPI_NAMESPACE::_EYesNo EYesNo
Defines the choices of a Yes/No alternatives.
virtual GENICAM_NAMESPACE::gcstring GetEventID() const
Implementation of INode::GetNodeMap()
Definition: NodeT.h:204
virtual GENICAM_NAMESPACE::gcstring GetDescription() const
Implementation of INode::GetDescription()
Definition: NodeT.h:148
virtual ECachingMode GetCachingMode() const
Implementation of INode::GetCachingMode.
Definition: NodeT.h:116
virtual GENICAM_NAMESPACE::gcstring GetEventID() const =0
Get the EventId of the node.
virtual GENAPI_NAMESPACE::ENameSpace GetNameSpace() const
Implementation of INode::GetNameSpace()
Definition: NodeT.h:62
virtual GENICAM_NAMESPACE::gcstring GetDisplayName() const
Implementation of INode::GetDisplayName.
Definition: NodeT.h:156
intptr_t CallbackHandleType
the callback handle for nodes
Definition: INode.h:58
virtual GENICAM_NAMESPACE::gcstring GetToolTip() const
Implementation of INode::GetToolTip()
Definition: NodeT.h:140
A string class which is a clone of std::string.
Definition: GCString.h:52
virtual GENICAM_NAMESPACE::gcstring GetDocuURL() const
Gets a URL pointing to the documentation of that feature.
Definition: NodeT.h:237
virtual EYesNo IsAccessModeCacheable() const
True if the AccessMode can be cached.
Definition: NodeT.h:124
virtual bool IsDeprecated() const
True if the node should not be used any more.
Definition: NodeT.h:245
virtual void GetPropertyNames(GENICAM_NAMESPACE::gcstring_vector &PropertyNames) const =0
Returns a list of the names all properties set during initialization.
Part of the generic device API.
Definition: Autovector.h:48
callback is fired on leaving the tree inside the lock-guarded area
Definition: NodeCallback.h:48
enum GENAPI_NAMESPACE::_EInterfaceType EInterfaceType
typedef for interface type
virtual CLock & GetLock() const =0
Returns the lock which guards the node map.
enum GENAPI_NAMESPACE::_ENameSpace ENameSpace
Defines if a node name is standard or custom.
enum GENAPI_NAMESPACE::_ELinkType ELinkType
typedef for link type


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Thu Jun 6 2019 19:10:54