GenApi  3.5.1
ISelector.h
1 //-----------------------------------------------------------------------------
2 // (c) 2006 by Basler Vision Technologies
3 // Author: Hartmut Nebelung
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 //-----------------------------------------------------------------------------
28 #ifndef GENAPI_ISELECTOR_H
29 #define GENAPI_ISELECTOR_H
30 
31 #include <GenApi/GenApiDll.h>
32 
33 #ifdef _MSC_VER
34 # pragma warning ( push )
35 # pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY
36 #endif
37 
38 namespace GENAPI_NAMESPACE
39 {
44  GENICAM_INTERFACE GENAPI_DECL_ABSTRACT ISelector : virtual public IBase
45  {
47  virtual bool IsSelector() const = 0;
48 
50  virtual void GetSelectedFeatures( FeatureList_t& ) const = 0;
51 
53  virtual void GetSelectingFeatures( FeatureList_t& ) const = 0;
54  };
55 
56  //*************************************************************
57  // CSelectorRef class
58  //*************************************************************
59 
65  template <class T>
66  class CSelectorRefT : public CBaseRefT<T>
67  {
68  typedef CBaseRefT<T> ref;
69 
70  public:
71  /*--------------------------------------------------------*/
72  // ISelector
73  /*--------------------------------------------------------*/
74 
76  virtual void GetSelectedFeatures(FeatureList_t &Features) const
77  {
78  if (ref::m_Ptr)
79  {
80  ref::m_Ptr->GetSelectedFeatures(Features);
81  }
82  else
83  {
84  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
85  }
86  }
87 
89  virtual void GetSelectingFeatures( FeatureList_t& Features) const
90  {
91  if (ref::m_Ptr)
92  {
93  ref::m_Ptr->GetSelectingFeatures(Features);
94  }
95  else
96  {
97  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
98  }
99  }
100 
102  virtual bool IsSelector() const
103  {
104  if(!ref::m_Ptr)
105  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
106  return ref::m_Ptr->IsSelector();
107  }
108  };
109 
112  typedef CSelectorRefT<ISelector> CSelectorRef;
113 
114 }
115 
116 #ifdef _MSC_VER
117 # pragma warning ( pop )
118 #endif
119 
120 #endif // GENAPI_ISELECTOR_H
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT ISelector
Interface for groups of features selected by a single one.
Definition: ISelector.h:47
CSelectorRefT< ISelector > CSelectorRef
Definition: ISelector.h:112
#define ACCESS_EXCEPTION
Fires a access exception, e.g. throw ACCESS_EXCEPTION("Not everybody")
Definition: GCException.h:252
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IBase
Base interface common to all nodes.
Definition: IBase.h:53
declspec&#39;s to be used for GenApi Windows dll
Definition: ChunkAdapter.h:37