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  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
110  ref::m_Ptr->SetValue(Value, Verify);
111  }
112 
115  {
116  if(!ref::m_Ptr)
117  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
118  return ref::m_Ptr->operator=(Value);
119  }
120 
122  virtual GENICAM_NAMESPACE::gcstring GetValue(bool Verify = false, bool IgnoreCache = false)
123  {
124  if(!ref::m_Ptr)
125  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
126  return ref::m_Ptr->GetValue(Verify, IgnoreCache);
127  }
128 
131  {
132  if(!ref::m_Ptr)
133  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
134  return ref::m_Ptr->operator()();
135  }
136 
139  {
140  if(!ref::m_Ptr)
141  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
142  return ref::m_Ptr-> operator*();
143  }
144 
146  virtual int64_t GetMaxLength(bool Verify = false)
147  {
148  if(!ref::m_Ptr)
149  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
150  return ref::m_Ptr->GetMaxLength(Verify);
151  }
152 
153  };
154 
158 
159 #endif
160 
161 }
162 
163 #ifdef _MSC_VER
164 # pragma warning ( pop )
165 #endif
166 
167 #endif // ifndef GENAPI_ISTRING_H
GENAPI_NAMESPACE
Lexical analyzer for CIntSwissKnife.
Definition: Destructible.h:30
GENAPI_NAMESPACE::CStringRefT::ref
CValueRefT< T > ref
Definition: IString.h:98
Types.h
Common types used in the public GenApi interface.
GENICAM_INTERFACE
#define GENICAM_INTERFACE
Definition: GenICamFwd.h:33
GENICAM_NAMESPACE::gcstring
A string class which is a clone of std::string.
Definition: GCString.h:52
GENAPI_NAMESPACE::CValueRefT
Definition: IValue.h:95
GENAPI_NAMESPACE::Verify
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT bool Verify
Definition: IBoolean.h:61
GENAPI_NAMESPACE::operator*
virtual GENICAM_NAMESPACE::gcstring operator*()=0
Get string node value.
GENAPI_NAMESPACE::CStringRefT
Definition: IString.h:96
GENAPI_NAMESPACE::CStringRefT::operator=
virtual IString & operator=(const GENICAM_NAMESPACE::gcstring &Value)
Set node value.
Definition: IString.h:114
GENAPI_NAMESPACE::CStringRefT::GetMaxLength
virtual int64_t GetMaxLength(bool Verify=false)
Get max length of string.
Definition: IString.h:146
GENAPI_NAMESPACE::CStringRefT::operator*
virtual GENICAM_NAMESPACE::gcstring operator*()
Get node value.
Definition: IString.h:138
GENAPI_NAMESPACE::GetMaxLength
virtual int64_t GetMaxLength(bool Verify=false)=0
Retrieves the maximum length of the string in bytes.
GENAPI_NAMESPACE::CStringRef
CStringRefT< IString > CStringRef
Reference to an IString pointer.
Definition: IString.h:157
GENAPI_NAMESPACE::CStringRefT::GetValue
virtual GENICAM_NAMESPACE::gcstring GetValue(bool Verify=false, bool IgnoreCache=false)
Get node value.
Definition: IString.h:122
GENAPI_NAMESPACE::IValue
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IValue
Interface for value properties.
Definition: IValue.h:61
GENAPI_NAMESPACE::IString
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IString
Interface for string properties.
Definition: IString.h:61
ACCESS_EXCEPTION
#define ACCESS_EXCEPTION
Fires a access exception, e.g. throw ACCESS_EXCEPTION("Not everybody")
Definition: GCException.h:253
int64_t
__int64 int64_t
Definition: config-win32.h:21
GENAPI_NAMESPACE::GetValue
virtual bool GetValue(bool Verify=false, bool IgnoreCache=false) const =0
Get node value.
GENAPI_NAMESPACE::CReferenceT< T, T >::m_Ptr
T * m_Ptr
Pointer to the implementation the reference references to.
Definition: Reference.h:101
GENAPI_NAMESPACE::CStringRefT::SetValue
virtual void SetValue(const GENICAM_NAMESPACE::gcstring &Value, bool Verify=true)
Set node value.
Definition: IString.h:106
IValue.h
Definition of the interface IValue.
GENAPI_NAMESPACE::operator()
virtual bool operator()() const
Get node value.
Definition: IBoolean.h:79
GENAPI_NAMESPACE::operator=
virtual IBoolean & operator=(bool Value)
Set node value.
Definition: IBoolean.h:64
GenApiDll.h
declspec's to be used for GenApi Windows dll
GENAPI_NAMESPACE::CStringRefT::operator()
virtual GENICAM_NAMESPACE::gcstring operator()()
Get node value.
Definition: IString.h:130
GCString.h
Portable string implementation.


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Wed Nov 22 2023 03:12:04