IValue.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 //-----------------------------------------------------------------------------
31 #ifndef GENAPI_IVALUE_H
32 #define GENAPI_IVALUE_H
33 
34 #include <GenApi/GenApiDll.h>
35 #include <GenApi/Types.h>
36 #include <GenApi/IBase.h>
37 #include <GenApi/INode.h>
38 #include <Base/GCString.h>
39 #include <Base/GCException.h>
40 
41 #ifdef _MSC_VER
42 # pragma warning ( push )
43 # pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY
44 #endif
45 
46 namespace GENAPI_NAMESPACE
47 {
48  interface INode;
49 
50  //*************************************************************
51  // IValue interface
52  //*************************************************************
53 
58  interface GENAPI_DECL_ABSTRACT IValue : virtual public IBase
59  {
61  virtual INode* GetNode() { return dynamic_cast<INode*>(this); }
62 
64 
69  virtual GENICAM_NAMESPACE::gcstring ToString(bool Verify = false, bool IgnoreCache = false) = 0;
70 
72 
76  virtual void FromString(const GENICAM_NAMESPACE::gcstring& ValueStr, bool Verify = true) = 0;
77 
79  virtual bool IsValueCacheValid() const = 0;
80  };
81 
82 
83  //*************************************************************
84  // CValueRef class
85  //*************************************************************
86 
87 #ifndef DOXYGEN_IGNORE
88 
94  template <class T, class I=T>
95  class CValueRefT : public CBaseRefT<T,I>
96  {
98 
99  public:
100  /*--------------------------------------------------------*/
101  // IValue
102  /*--------------------------------------------------------*/
103 
105  virtual INode* GetNode()
106  {
107  if(ref::m_Ptr)
108  return ref::m_Ptr->GetNode();
109  else
110  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
111  }
112 
114  virtual GENICAM_NAMESPACE::gcstring ToString(bool Verify = false, bool IgnoreCache = false)
115  {
116  if(ref::m_Ptr)
117  return ref::m_Ptr->ToString(Verify, IgnoreCache);
118  else
119  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
120  }
121 
123  virtual void FromString(const GENICAM_NAMESPACE::gcstring& ValueStr, bool Verify = true)
124  {
125  if(ref::m_Ptr)
126  return ref::m_Ptr->FromString(ValueStr, Verify);
127  else
128  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
129  }
130 
132  virtual bool IsValueCacheValid() const
133  {
134  if(ref::m_Ptr)
135  return ref::m_Ptr->IsValueCacheValid();
136  else
137  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
138  }
139  };
140 
144 
145 #endif
146 
147 }
148 
149 #ifdef _MSC_VER
150 # pragma warning ( pop )
151 #endif
152 
153 #endif // ifndef GENAPI_IVALUE_H
Definition of interface IBase.
Common types used in the public GenApi interface.
virtual bool IsValueCacheValid() const =0
Checks if the value comes from cache or is requested from another node.
Definition of interface INode and types NodeList_t and CallbackHandleType:
virtual INode * GetNode(const GENICAM_NAMESPACE::gcstring &Name) const =0
Retrieves the node from the central map by Name.
virtual void FromString(const GENICAM_NAMESPACE::gcstring &ValueStr, bool Verify=true)
Set content of the node as string.
Definition: IValue.h:123
interface GENAPI_DECL_ABSTRACT IBase
Base interface common to all nodes.
Definition: IBase.h:55
virtual bool IsValueCacheValid() const
Checks if the value comes from cache or is requested from another node.
Definition: IValue.h:132
virtual void FromString(const GENICAM_NAMESPACE::gcstring &ValueStr, bool Verify=true)=0
Set content of the node as string.
virtual GENICAM_NAMESPACE::gcstring ToString()=0
Returns a string representation of the digit.
#define ACCESS_EXCEPTION
Fires a access exception, e.g. throw ACCESS_EXCEPTION("Not everybody")
Definition: GCException.h:252
interface GENAPI_DECL_ABSTRACT IValue
Interface for value properties.
Definition: IValue.h:61
interface GENAPI_DECL_ABSTRACT bool Verify
Definition: IBoolean.h:61
CValueRefT< IValue > CValueRef
Reference to an IValue pointer.
Definition: IValue.h:143
A string class which is a clone of std::string.
Definition: GCString.h:52
CBaseRefT< T, I > ref
Definition: IValue.h:97
virtual INode * GetNode()
Get the INode interface of the node.
Definition: IValue.h:105
Portable string implementation.
declspec&#39;s to be used for GenApi Windows dll
interface GENAPI_DECL_ABSTRACT INode
Interface common to all nodes.
Definition: INode.h:60
virtual GENICAM_NAMESPACE::gcstring ToString(bool Verify=false, bool IgnoreCache=false)
Get content of the node as string.
Definition: IValue.h:114
Part of the generic device API.
Definition: Autovector.h:48


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