IString.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: Margret Albrecht
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_ISTRING_H
32 #define GENAPI_ISTRING_H
33 
34 #include <Base/GCString.h>
35 #include <GenApi/GenApiDll.h>
36 #include <GenApi/Types.h>
37 #include <GenApi/IValue.h>
38 
39 #ifdef _MSC_VER
40 # pragma warning ( push )
41 # pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY
42 #endif
43 
44 namespace GENAPI_NAMESPACE
45 {
46  //*************************************************************
47  // IString interface
48  //*************************************************************
49 
54  GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IString : virtual public IValue
55  {
57 
61  virtual void SetValue(const GENICAM_NAMESPACE::gcstring& Value, bool Verify = true) = 0;
62 
64  virtual IString& operator=(const GENICAM_NAMESPACE::gcstring& Value) = 0;
65 
67 
72  virtual GENICAM_NAMESPACE::gcstring GetValue(bool Verify = false, bool IgnoreCache = false) = 0;
73 
76 
79 
81  virtual int64_t GetMaxLength(bool Verify = false) = 0;
82 
83  };
84  //*************************************************************
85  // CStringRef class
86  //*************************************************************
87 
88 #ifndef DOXYGEN_IGNORE
89 
95  template <class T>
96  class CStringRefT : public CValueRefT<T>
97  {
98  typedef CValueRefT<T> ref;
99 
100  public:
101  /*--------------------------------------------------------*/
102  // IString
103  /*--------------------------------------------------------*/
104 
106  virtual void SetValue(const GENICAM_NAMESPACE::gcstring& Value, bool Verify = true)
107  {
108  if(ref::m_Ptr)
109  return ref::m_Ptr->SetValue(Value, Verify);
110  else
111  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
112  }
113 
116  {
117  if(ref::m_Ptr)
118  return ref::m_Ptr->operator=(Value);
119  else
120  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
121  }
122 
124  virtual GENICAM_NAMESPACE::gcstring GetValue(bool Verify = false, bool IgnoreCache = false)
125  {
126  if(ref::m_Ptr)
127  return ref::m_Ptr->GetValue(Verify, IgnoreCache);
128  else
129  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
130  }
131 
134  {
135  if(ref::m_Ptr)
136  return ref::m_Ptr->operator()();
137  else
138  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
139  }
140 
143  {
144  if(ref::m_Ptr)
145  return ref::m_Ptr-> operator*();
146  else
147  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
148  }
149 
151  virtual int64_t GetMaxLength( bool Verify = false )
152  {
153  if(ref::m_Ptr)
154  return ref::m_Ptr->GetMaxLength( Verify );
155  else
156  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
157  }
158 
159  };
160 
164 
165 #endif
166 
167 }
168 
169 #ifdef _MSC_VER
170 # pragma warning ( pop )
171 #endif
172 
173 #endif // ifndef GENAPI_ISTRING_H
#define GENICAM_INTERFACE
Definition: GenICamFwd.h:33
Common types used in the public GenApi interface.
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT bool Verify
Definition: IBoolean.h:61
virtual GENICAM_NAMESPACE::gcstring GetValue(bool Verify=false, bool IgnoreCache=false)
Get node value.
Definition: IString.h:124
virtual bool GetValue(bool Verify=false, bool IgnoreCache=false) const =0
Get node value.
virtual void operator=(bool Value)
Set node value.
Definition: IBoolean.h:64
virtual bool operator()() const
Get node value.
Definition: IBoolean.h:75
__int64 int64_t
Definition: config-win32.h:21
virtual int64_t GetMaxLength(bool Verify=false)
Get max length of string.
Definition: IString.h:151
virtual void SetValue(const GENICAM_NAMESPACE::gcstring &Value, bool Verify=true)
Set node value.
Definition: IString.h:106
virtual IString & operator=(const GENICAM_NAMESPACE::gcstring &Value)
Set node value.
Definition: IString.h:115
#define ACCESS_EXCEPTION
Fires a access exception, e.g. throw ACCESS_EXCEPTION("Not everybody")
Definition: GCException.h:253
T * m_Ptr
Pointer to the implementation the reference references to.
Definition: Reference.h:101
virtual GENICAM_NAMESPACE::gcstring operator*()
Get node value.
Definition: IString.h:142
virtual GENICAM_NAMESPACE::gcstring operator()()
Get node value.
Definition: IString.h:133
CStringRefT< IString > CStringRef
Reference to an IString pointer.
Definition: IString.h:163
virtual int64_t GetMaxLength(bool Verify=false)=0
Retrieves the maximum length of the string in bytes.
virtual GENICAM_NAMESPACE::gcstring operator*()=0
Get string node value.
A string class which is a clone of std::string.
Definition: GCString.h:52
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IString
Interface for string properties.
Definition: IString.h:61
Portable string implementation.
declspec&#39;s to be used for GenApi Windows dll
Definition of the interface IValue.
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IValue
Interface for value properties.
Definition: IValue.h:61
CValueRefT< T > ref
Definition: IString.h:98
Lexical analyzer for CIntSwissKnife.
Definition: Autovector.h:48


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Wed Mar 17 2021 02:48:40