GenApi 3.5.1
Reference.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//-----------------------------------------------------------------------------
29#ifndef GENAPI_REFERENCE_H
30#define GENAPI_REFERENCE_H
31
32#include <GenApi/Types.h>
33#include <GenApi/GenApiDll.h>
34
35namespace GENAPI_NAMESPACE
36{
37 GENICAM_INTERFACE IBase;
38
39 //*************************************************************
40 // IReference interface
41 //*************************************************************
42
47 GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IReference
48 {
50 virtual void SetReference( GENAPI_NAMESPACE::IBase *pBase ) = 0;
51 };
52
53 //*************************************************************
54 // IEnumReference interface
55 //*************************************************************
56
61 GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IEnumReference
62 {
64 virtual void SetEnumReference( int Index, GENICAM_NAMESPACE::gcstring Name) = 0;
65
67 virtual void SetNumEnums( int NumEnums ) = 0;
68 };
69
70 //*************************************************************
71 // CReference class
72 //*************************************************************
73
78 template <class T, class I=T>
79 class CReferenceT : public T, public IReference
80 {
81 public:
82 // Constructor
83 CReferenceT() :
84 m_Ptr(NULL)
85 {}
86
87 /*--------------------------------------------------------*/
88 // IReference
89 /*--------------------------------------------------------*/
90
92 virtual void SetReference( IBase *ptr )
93 {
94 m_Ptr = dynamic_cast<I*>( ptr );
95 }
96
97 protected:
100 };
101
102}
103
104#endif // ifndef GENAPI_REFERENCE_H
declspec's to be used for GenApi Windows dll
virtual void SetNumEnums(int NumEnums)=0
sets the number of enum vallues
Common types used in the public GenApi interface.
Reference to an IBase derived pointer.
Definition Reference.h:80
virtual void SetReference(IBase *ptr)
sets the implementation to the reference
Definition Reference.h:92
I * m_Ptr
Pointer to the implementation the reference references to.
Definition Reference.h:99
A string class which is a clone of std::string.
Definition GCString.h:51
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IBase
Base interface common to all nodes.
Definition IBase.h:53