GenApi  3.5.1
IBase.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 // (c) 2006 by Basler Vision Technologies
3 // Author: Fritz Dierks
4 //
5 // License: This file is published under the license of the EMVA GenICam Standard Group.
6 // A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'.
7 // If for some reason you are missing this file please contact the EMVA or visit the website
8 // (http://www.genicam.org) for a full copy.
9 //
10 // THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS"
11 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
12 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
13 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP
14 // OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
15 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
16 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
17 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
18 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
19 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
20 // POSSIBILITY OF SUCH DAMAGE.
21 //
22 //-----------------------------------------------------------------------------
30 #ifndef GENAPI_IBASE_H
31 #define GENAPI_IBASE_H
32 
33 #include <GenApi/GenApiDll.h>
34 #include <GenApi/Types.h>
35 #include <GenApi/Reference.h>
36 
37 #ifdef _MSC_VER
38 # pragma warning ( push )
39 # pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY
40 #endif
41 
42 namespace GENAPI_NAMESPACE
43 {
44  //*************************************************************
45  // IBase interface
46  //*************************************************************
47 
52  GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IBase
53  {
55  virtual EAccessMode GetAccessMode() const = 0;
56 
58  virtual ~IBase() = 0;
59  };
60 
61  // Implementation required for Windows only.
62  // Note: the C++ standard >= 11 prohibit pure virtual destructors with a function body
63  // in the declaration. Consequently gcc 4.0 and newer reject an inline implementation
64  // in the class.
65  inline IBase::~IBase()
66  {
67  // do nothing
68  }
69 
70  //*************************************************************
71  // CBaseRef class
72  //*************************************************************
73 
74 #ifndef DOXYGEN_IGNORE
75 
81  template <class T, class I=T>
82  class CBaseRefT : public CReferenceT<T, I>
83  {
84  typedef CReferenceT<T, I> ref;
85 
86  public:
87  /*--------------------------------------------------------*/
88  // IBase
89  /*--------------------------------------------------------*/
90 
92  virtual EAccessMode GetAccessMode() const
93  {
94  if(ref::m_Ptr)
95  return ref::m_Ptr->GetAccessMode();
96  else
97  return NI;
98  }
99 
100  };
101 
104  typedef CBaseRefT<IBase> CBaseRef;
105 
106 #endif
107 
108 }
109 #ifdef _MSC_VER
110 # pragma warning ( pop )
111 #endif
112 
113 #endif // ifndef GENAPI_IBASE_H
Common types used in the public GenApi interface.
Definition of template CReference.
CBaseRefT< IBase > CBaseRef
Definition: IBase.h:104
enum GENAPI_NAMESPACE::_EAccessMode EAccessMode
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IBase
Base interface common to all nodes.
Definition: IBase.h:53
I * m_Ptr
Pointer to the implementation the reference references to.
Definition: Reference.h:99
Reference to an IBase derived pointer.
Definition: Reference.h:79
declspec&#39;s to be used for GenApi Windows dll
Not implemented.
Definition: Types.h:54
Definition: ChunkAdapter.h:37