All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
IPortRecorder.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 // (c) 2009 by Basler Vision Technologies
3 // Section: Vision Components
4 // Project: GenApi
5 // Author: Fritz Dierks
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_IPORTRECORDER_H
32 #define GENAPI_IPORTRECORDER_H
33 
34 #include <GenApi/IPort.h>
35 
36 #ifdef _MSC_VER
37 # pragma warning ( push )
38 # pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY
39 #endif
40 
41 namespace GENAPI_NAMESPACE
42 {
43 
44  GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IPortWriteList
45  {
47  virtual void Write(const void *pBuffer, int64_t Address, int64_t Length) = 0;
48 
50  virtual void Replay(IPort* pPort) = 0;
51 
53  // Default = -1
54  virtual void SetCookie(const int64_t Value) = 0;
55 
57  virtual int64_t GetCookie() = 0;
58  };
59 
64  GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IPortReplay : virtual public IPort
65  {
67 
72  virtual void Replay(IPortWriteList *pPortRecorder, bool Invalidate = true) = 0;
73  };
74 
79  GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IPortRecorder : public IPortReplay
80  {
82  virtual void StartRecording(IPortWriteList *pPortRecorder) = 0;
83 
85  virtual void StopRecording() = 0;
86  };
87 
88  //*************************************************************
89  // CPortRecorderRef class
90  //*************************************************************
91 
97  template <class T>
98  class CPortRecorderRefT : public CPortRefT<T>
99  {
100  typedef CPortRefT<T> ref;
101 
102  public:
103  /*--------------------------------------------------------*/
104  // IPortRecorder
105  /*--------------------------------------------------------*/
106 
108 
113  virtual void Replay(IPortWriteList *pPortRecorder, bool Invalidate = true)
114  {
115  if (ref::m_Ptr)
116  {
117  ref::m_Ptr->Replay(pPortRecorder, Invalidate);
118  }
119  else
120  {
121  throw ACCESS_EXCEPTION( "Feature not present (reference not valid)" );
122  }
123  }
124 
126  virtual void StartRecording(IPortWriteList *pPortRecorder)
127  {
128  if (ref::m_Ptr)
129  {
130  ref::m_Ptr->StartRecording(pPortRecorder);
131  }
132  else
133  {
134  throw ACCESS_EXCEPTION( "Feature not present (reference not valid)" );
135  }
136  }
137 
139  virtual void StopRecording()
140  {
141  if (ref::m_Ptr)
142  {
143  ref::m_Ptr->StopRecording();
144  }
145  else
146  {
147  throw ACCESS_EXCEPTION( "Feature not present (reference not valid)" );
148  }
149  }
150  };
151 
155 
156 }
157 
158 #ifdef _MSC_VER
159 # pragma warning ( pop )
160 #endif
161 
162 #endif // ifndef GENAPI_IPORTRECORDER_H
GENAPI_NAMESPACE::CPortRefT
Definition: IPort.h:75
GENAPI_NAMESPACE
Lexical analyzer for CIntSwissKnife.
Definition: Destructible.h:30
GENAPI_NAMESPACE::CPortRecorderRefT::StartRecording
virtual void StartRecording(IPortWriteList *pPortRecorder)
starts logging all WriteRegister commands to a list
Definition: IPortRecorder.h:126
GENAPI_NAMESPACE::IPortWriteList
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IPortWriteList
Definition: IPortRecorder.h:45
GENAPI_NAMESPACE::CPortRecorderRefT::ref
CPortRefT< T > ref
Definition: IPortRecorder.h:100
GENICAM_INTERFACE
#define GENICAM_INTERFACE
Definition: GenICamFwd.h:33
GENAPI_NAMESPACE::GetCookie
virtual int64_t GetCookie()=0
Gets the cookie a port implementation may have set for caching a command list.
GENAPI_NAMESPACE::Write
virtual void Write(const void *pBuffer, int64_t Address, int64_t Length)=0
Writes a chunk of bytes to the port.
GENAPI_NAMESPACE::SetCookie
virtual void SetCookie(const int64_t Value)=0
Sets a cookie in case the port implementation want to cache a command list.
GENAPI_NAMESPACE::Address
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT int64_t Address
Definition: IPort.h:57
GENAPI_NAMESPACE::Length
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT int64_t int64_t Length
Definition: IPort.h:57
IPort.h
Definition of interface IPort.
GENAPI_NAMESPACE::IPortRecorder
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IPortRecorder
Interface for recording write commands on a port.
Definition: IPortRecorder.h:73
GENAPI_NAMESPACE::IPortReplay
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IPortReplay
Interface for replaying write commands on a port.
Definition: IPortRecorder.h:58
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::CReferenceT< T, T >::m_Ptr
T * m_Ptr
Pointer to the implementation the reference references to.
Definition: Reference.h:101
GENAPI_NAMESPACE::Replay
virtual void Replay(IPort *pPort)=0
Replays the write command to the given port interface.
GENAPI_NAMESPACE::IPort
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IPort
Interface for ports.
Definition: IPort.h:57
GENAPI_NAMESPACE::CPortRecorderRefT::Replay
virtual void Replay(IPortWriteList *pPortRecorder, bool Invalidate=true)
sends the commands to the camera.
Definition: IPortRecorder.h:113
GENAPI_NAMESPACE::Invalidate
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT bool Invalidate
Definition: IPortRecorder.h:72
GENAPI_NAMESPACE::CPortRecorderRefT::StopRecording
virtual void StopRecording()
stops recording
Definition: IPortRecorder.h:139
GENAPI_NAMESPACE::StopRecording
virtual void StopRecording()=0
stops recording
GENAPI_NAMESPACE::CPortRecorderRef
CPortRecorderRefT< IPortRecorder > CPortRecorderRef
Reference to an IPortRecorder pointer.
Definition: IPortRecorder.h:154
GENAPI_NAMESPACE::CPortRecorderRefT
Definition: IPortRecorder.h:98


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Wed Dec 4 2024 03:10:11