INode.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: Fritz Dierks
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 //-----------------------------------------------------------------------------
32 #ifndef GENAPI_INODE_H
33 #define GENAPI_INODE_H
34 
35 #include <Base/GCString.h>
36 #include <GenApi/GenApiDll.h>
37 #include <GenApi/Types.h>
38 #include <GenApi/IBase.h>
39 #include <GenApi/Container.h>
40 
41 #include <assert.h>
42 
43 #ifdef _MSC_VER
44 # pragma warning ( push )
45 # pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY
46 #endif
47 
48 namespace GENAPI_NAMESPACE
49 {
50 
51  interface INode;
52  interface INodeMap;
53 
55  typedef node_vector NodeList_t;
56 
58  typedef intptr_t CallbackHandleType;
59 
61 
62  //*************************************************************
63  // INode interface
64  //*************************************************************
65 
70  interface GENAPI_DECL_ABSTRACT INode : virtual public IBase
71  {
73  virtual GENICAM_NAMESPACE::gcstring GetName(bool FullQualified=false) const = 0;
74 
76  virtual GENAPI_NAMESPACE::ENameSpace GetNameSpace() const = 0;
77 
79  virtual EVisibility GetVisibility() const = 0;
80 
82 
83  virtual void InvalidateNode() = 0;
84 
86  virtual bool IsCachable() const = 0;
87 
89  virtual EYesNo IsAccessModeCacheable() const = 0;
90 
92  virtual ECachingMode GetCachingMode() const = 0;
93 
95  virtual int64_t GetPollingTime() const = 0;
96 
98  virtual GENICAM_NAMESPACE::gcstring GetToolTip() const = 0;
99 
101  virtual GENICAM_NAMESPACE::gcstring GetDescription() const = 0;
102 
104  virtual GENICAM_NAMESPACE::gcstring GetDisplayName() const = 0;
105 
107  virtual GENICAM_NAMESPACE::gcstring GetDeviceName() const = 0;
108 
114  virtual void GetChildren(GENAPI_NAMESPACE::NodeList_t &Children, ELinkType LinkType=ctReadingChildren) const = 0;
115 
120  virtual void GetParents(GENAPI_NAMESPACE::NodeList_t &Parents) const = 0;
121 
123 
124  virtual CallbackHandleType RegisterCallback( CNodeCallback *pCallback ) = 0;
125 
127 
130  virtual bool DeregisterCallback( CallbackHandleType hCallback ) = 0;
131 
133  virtual INodeMap* GetNodeMap() const = 0;
134 
136  virtual GENICAM_NAMESPACE::gcstring GetEventID() const = 0;
137 
139  virtual bool IsStreamable() const = 0;
140 
142  virtual void GetPropertyNames(GENICAM_NAMESPACE::gcstring_vector &PropertyNames) const = 0;
143 
145 
146  virtual bool GetProperty(const GENICAM_NAMESPACE::gcstring& PropertyName, GENICAM_NAMESPACE::gcstring& ValueStr, GENICAM_NAMESPACE::gcstring& AttributeStr) = 0;
147 
149  virtual void ImposeAccessMode(EAccessMode ImposedAccessMode) = 0;
150 
152  virtual void ImposeVisibility(EVisibility ImposedVisibility) = 0;
153 
155  virtual INode* GetAlias() const = 0;
156 
158  virtual INode* GetCastAlias() const = 0;
159 
161  virtual GENICAM_NAMESPACE::gcstring GetDocuURL() const = 0;
162 
164  virtual bool IsDeprecated() const = 0;
165 
167  virtual EInterfaceType GetPrincipalInterfaceType() const = 0;
168 
170  virtual bool IsFeature() const = 0;
171 
172  };
173 
176 
178  inline bool IsReadable( EAccessMode AccessMode )
179  {
180  return RO == AccessMode || RW == AccessMode;
181  }
182 
184  inline bool IsReadable( const IBase* p)
185  {
186  return (p != NULL) && IsReadable( p->GetAccessMode() );
187  }
188 
190  inline bool IsReadable( const IBase& r)
191  {
192  return IsReadable( r.GetAccessMode() );
193  }
194 
196  inline bool IsWritable( EAccessMode AccessMode )
197  {
198  return WO == AccessMode || RW == AccessMode;
199  }
200 
202  inline bool IsWritable( const IBase* p)
203  {
204  return (p != NULL) && IsWritable( p->GetAccessMode() );
205  }
206 
208  inline bool IsWritable( const IBase& r)
209  {
210  return IsWritable( r.GetAccessMode() );
211  }
212 
214  inline bool IsImplemented( EAccessMode AccessMode )
215  {
216  return AccessMode != NI;
217  }
218 
220  inline bool IsImplemented( const IBase* p)
221  {
222  return (p != NULL) && IsImplemented(p->GetAccessMode() );
223  }
224 
226  inline bool IsImplemented( const IBase& r)
227  {
228  return IsImplemented(&r);
229  }
230 
232  inline bool IsAvailable( EAccessMode AccessMode )
233  {
234  return ! ( AccessMode == NA || AccessMode == NI );
235  }
236 
238  inline bool IsAvailable( const IBase* p)
239  {
240  return (p != NULL) && IsAvailable(p->GetAccessMode() );
241  }
242 
244  inline bool IsAvailable( const IBase& r)
245  {
246  return IsAvailable(r.GetAccessMode() );
247  }
248 
251  {
252  assert( Peter != _UndefinedAccesMode );
253  assert( Paul != _UndefinedAccesMode );
254 
255  if( Peter == NI || Paul == NI )
256  return NI;
257  else if( Peter == NA || Paul == NA )
258  return NA;
259  else if( (Peter == RO && Paul == WO) || (Peter == WO && Paul == RO) )
260  return NA;
261  else if( Peter == WO || Paul == WO )
262  return WO;
263  else if( Peter == RO || Paul == RO )
264  return RO;
265  else
266  return RW;
267  }
268 
269 
271 
272  inline bool IsVisible( EVisibility Visibility, EVisibility MaxVisiblity )
273  {
274  return (Visibility <= MaxVisiblity);
275  }
276 
277 
280  {
281  assert( Peter != _UndefinedVisibility );
282  assert( Paul != _UndefinedVisibility );
283 
284  if( Peter == Invisible || Paul == Invisible )
285  return Invisible;
286  else if( Peter == Guru || Paul == Guru )
287  return Guru;
288  else if( Peter == Expert || Paul == Expert )
289  return Expert;
290  else
291  return Beginner;
292  }
293 
294 
296  inline bool IsCacheable( ECachingMode CachingMode )
297  {
298  return (CachingMode != NoCache);
299  }
300 
303  {
304  assert( Peter != _UndefinedCachingMode );
305  assert( Paul != _UndefinedCachingMode );
306 
307  if( Peter == NoCache || Paul == NoCache )
308  return NoCache;
309  else if( Peter == WriteAround || Paul == WriteAround )
310  return WriteAround;
311  else
312  return WriteThrough;
313  }
314 
316 
317 }
318 
319 #ifdef _MSC_VER
320 # pragma warning ( pop )
321 #endif
322 
323 #endif // ifndef GENAPI_INODE_H
Definition of interface IBase.
virtual void InvalidateNode()=0
Indicates that the node&#39;s value may have changed.
enum GENAPI_NAMESPACE::_EVisibility EVisibility
recommended visibility of a node
Common types used in the public GenApi interface.
virtual GENICAM_NAMESPACE::gcstring GetDescription() const =0
Get a long description of the node.
virtual EVisibility GetVisibility() const =0
Get the recommended visibility of the node.
Object is not yet initialized.
Definition: Types.h:74
Visible for Gurus.
Definition: Types.h:72
virtual bool IsCachable() const =0
Is the node value cachable.
bool IsCacheable(ECachingMode CachingMode)
Tests Cacheability.
Definition: INode.h:296
__int64 int64_t
Definition: config-win32.h:21
Not Visible.
Definition: Types.h:73
virtual void ImposeVisibility(EVisibility ImposedVisibility)=0
Imposes a visibility to the natural visibility of the node.
virtual bool DeregisterCallback(CallbackHandleType hCallback)=0
De register change callback.
virtual void GetChildren(GENAPI_NAMESPACE::NodeList_t &Children, ELinkType LinkType=ctReadingChildren) const =0
Get all nodes this node directly depends on.
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 IsFeature() const =0
True if the node can be reached via category nodes from a category node named "Root".
virtual INodeMap * GetNodeMap() const =0
Retrieves the central node map.
virtual bool GetProperty(CNodeDataMap *pNodeDataMap, CPropertyID::EProperty_ID_t PropertyID, CNodeData::PropertyVector_t &PropertyList) const =0
Retrieves a property from the node map itself.
virtual EYesNo IsAccessModeCacheable() const =0
True if the AccessMode can be cached.
callback body instance for INode pointers
Definition: NodeCallback.h:55
bool IsReadable(EAccessMode AccessMode)
Tests if readable.
Definition: INode.h:178
Visible for experts or Gurus.
Definition: Types.h:71
virtual GENICAM_NAMESPACE::gcstring GetToolTip()=0
Get tool tip.
interface GENAPI_DECL_ABSTRACT IBase
Base interface common to all nodes.
Definition: IBase.h:55
bool IsAvailable(EAccessMode AccessMode)
Tests if available.
Definition: INode.h:232
Write to cache and register.
Definition: Types.h:82
node_vector NodeList_t
a list of node references
Definition: INode.h:55
Not yet initialized.
Definition: Types.h:84
enum GENAPI_NAMESPACE::_ECachingMode ECachingMode
caching mode of a register
All nodes which can be read from.
Definition: Types.h:212
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.
Write to register, write to cache on read.
Definition: Types.h:83
bool IsVisible(EVisibility Visibility, EVisibility MaxVisiblity)
Tests Visibility.
Definition: INode.h:272
virtual GENICAM_NAMESPACE::gcstring GetDocuURL() const =0
Gets a URL pointing to the documentation of that feature.
virtual GENAPI_NAMESPACE::ENameSpace GetNameSpace() const =0
Get name space.
virtual int64_t GetPollingTime() const =0
recommended polling time (for not cachable nodes)
virtual void ImposeAccessMode(EAccessMode ImposedAccessMode)=0
Imposes an access mode to the natural access mode of the node.
Not implemented.
Definition: Types.h:56
Read Only.
Definition: Types.h:59
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.
bool IsImplemented(EAccessMode AccessMode)
Tests if implemented.
Definition: INode.h:214
virtual GENICAM_NAMESPACE::gcstring GetEventID() const =0
Get the EventId of the node.
intptr_t CallbackHandleType
the callback handle for nodes
Definition: INode.h:58
Always visible.
Definition: Types.h:70
Not available.
Definition: Types.h:57
Write Only.
Definition: Types.h:58
A string class which is a clone of std::string.
Definition: GCString.h:52
virtual EInterfaceType GetPrincipalInterfaceType() const =0
Get the type of the main interface of a node.
virtual GENICAM_NAMESPACE::gcstring GetDeviceName() const =0
Get a name of the device.
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.
Portable string implementation.
Object is not yet initialized.
Definition: Types.h:61
virtual ECachingMode GetCachingMode() const =0
Get Caching Mode.
bool IsWritable(EAccessMode AccessMode)
Tests if writable.
Definition: INode.h:196
declspec&#39;s to be used for GenApi Windows dll
Portable container classes for INode & IValue pointers.
Read and Write.
Definition: Types.h:60
interface GENAPI_DECL_ABSTRACT INode
Interface common to all nodes.
Definition: INode.h:60
virtual bool IsDeprecated() const =0
True if the node should not be used any more.
virtual void GetPropertyNames(GENICAM_NAMESPACE::gcstring_vector &PropertyNames) const =0
Returns a list of the names all properties set during initialization.
virtual GENICAM_NAMESPACE::gcstring GetDisplayName() const =0
Get a name string for display.
virtual CallbackHandleType RegisterCallback(CNodeCallback *pCallback)=0
Register change callback.
Part of the generic device API.
Definition: Autovector.h:48
enum GENAPI_NAMESPACE::_EInterfaceType EInterfaceType
typedef for interface type
Do not use cache.
Definition: Types.h:81
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