ICommand.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: Hartmut Nebelung
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_ICOMMAND_H
32 #define GENAPI_ICOMMAND_H
33 
34 #include <GenApi/GenApiDll.h>
35 #include <GenApi/Types.h>
36 #include <GenApi/IValue.h>
37 
38 #ifdef _MSC_VER
39 # pragma warning ( push )
40 # pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY
41 #endif
42 
43 namespace GENAPI_NAMESPACE
44 {
45  //*************************************************************
46  // ICommand interface
47  //*************************************************************
48 
51  interface GENAPI_DECL_ABSTRACT ICommand : virtual public IValue
52  {
53  public:
54 
56 
59  virtual void Execute(bool Verify = true) = 0;
60 
62  virtual void operator()() = 0;
63 
65 
69  virtual bool IsDone(bool Verify = true) = 0;
70 
71 
72  };
73 
74 
75  //*************************************************************
76  // CCommandRef class
77  //*************************************************************
78 
79 #ifndef DOXYGEN_IGNORE
80 
86  template <class T>
87  class CCommandRefT : public CValueRefT<T>
88  {
89  typedef CValueRefT<T> ref;
90 
91  public:
92  /*--------------------------------------------------------*/
93  // ICommand
94  /*--------------------------------------------------------*/
95 
97  virtual void Execute(bool Verify = true)
98  {
99  if(ref::m_Ptr)
100  return ref::m_Ptr->Execute(Verify);
101  else
102  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
103  }
104 
106  virtual void operator()()
107  {
108  if(ref::m_Ptr)
109  ref::m_Ptr->operator()();
110  else
111  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
112  }
113 
115  virtual bool IsDone(bool Verify = true)
116  {
117  if(ref::m_Ptr)
118  return ref::m_Ptr->IsDone(Verify);
119  else
120  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
121  }
122 
123 
124  };
125 
129 
130 #endif
131 
132 }
133 
134 #ifdef _MSC_VER
135 # pragma warning ( pop )
136 #endif
137 
138 #endif // ifndef GENAPI_ICOMMAND_H
Common types used in the public GenApi interface.
virtual bool IsDone(bool Verify=true)=0
Query whether the command is executed.
virtual void operator()()
Execute the command.
Definition: ICommand.h:106
virtual bool operator()() const
Get node value.
Definition: IBoolean.h:75
virtual bool IsDone(bool Verify=true)
Query whether the command is executed.
Definition: ICommand.h:115
virtual void Execute(bool Verify=true)
Execute the command.
Definition: ICommand.h:97
interface GENAPI_DECL_ABSTRACT ICommand
Interface for command like properties.
Definition: ICommand.h:59
#define ACCESS_EXCEPTION
Fires a access exception, e.g. throw ACCESS_EXCEPTION("Not everybody")
Definition: GCException.h:252
interface GENAPI_DECL_ABSTRACT IValue
Interface for value properties.
Definition: IValue.h:61
interface GENAPI_DECL_ABSTRACT bool Verify
Definition: IBoolean.h:61
declspec&#39;s to be used for GenApi Windows dll
Definition of the interface IValue.
Part of the generic device API.
Definition: Autovector.h:48
CCommandRefT< ICommand > CCommandRef
Reference to an ICommand pointer.
Definition: ICommand.h:128


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Thu Jun 6 2019 19:10:54