VimbaSystem.hpp
Go to the documentation of this file.
1 /*=============================================================================
2  Copyright (C) 2012 Allied Vision Technologies. All Rights Reserved.
3 
4  Redistribution of this file, in original or modified form, without
5  prior written consent of Allied Vision Technologies is prohibited.
6 
7  -----------------------------------------------------------------------------
8 
9  File: VimbaSystem.hpp
10 
11  Description: Inline wrapper functions for class AVT::VmbAPI::VimbaSystem.
12  (This include file is for internal use only.)
13 
14  -----------------------------------------------------------------------------
15 
16  THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
17  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF TITLE,
18  NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19  DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
20  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
24  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 
27 =============================================================================*/
28 
29 #ifndef AVT_VMBAPI_VIMBASYSTEM_HPP
30 #define AVT_VMBAPI_VIMBASYSTEM_HPP
31 
32 //
33 // Inline wrapper functions that allocate memory for STL objects in the application's context
34 // and to pass data across DLL boundaries using arrays
35 //
36 inline VmbErrorType VimbaSystem::GetInterfaces( InterfacePtrVector &rInterfaces )
37 {
38  VmbErrorType res;
39  VmbUint32_t nSize;
40 
41  res = GetInterfaces( NULL, nSize );
42  if ( VmbErrorSuccess == res )
43  {
44  if( 0 != nSize)
45  {
46  try
47  {
48  InterfacePtrVector tmpInterfaces( nSize );
49  res = GetInterfaces( &tmpInterfaces[0], nSize );
50  if( VmbErrorSuccess == res )
51  {
52  rInterfaces.swap( tmpInterfaces);
53  }
54  }
55  catch(...)
56  {
57  return VmbErrorResources;
58  }
59  }
60  else
61  {
62  rInterfaces.clear();
63  }
64  }
65 
66  return res;
67 }
68 
69 inline VmbErrorType VimbaSystem::GetCameras( CameraPtrVector &rCameras )
70 {
71  VmbErrorType res;
72  VmbUint32_t nSize;
73 
74  res = GetCameras( NULL, nSize );
75  if ( VmbErrorSuccess == res)
76  {
77  if( 0 != nSize)
78  {
79  try
80  {
81  CameraPtrVector tmpCameras( nSize );
82  res = GetCameras( &tmpCameras[0], nSize );
83  if( VmbErrorSuccess == res )
84  {
85  rCameras.swap( tmpCameras );
86  }
87  }
88  catch(...)
89  {
90  return VmbErrorResources;
91  }
92  }
93  else
94  {
95  rCameras.clear();
96  }
97  }
98 
99  return res;
100 }
101 
102 #endif
std::vector< CameraPtr > CameraPtrVector
Definition: Camera.h:45
VmbErrorType
unsigned int VmbUint32_t
std::vector< InterfacePtr > InterfacePtrVector
Definition: VimbaSystem.h:46


avt_vimba_camera
Author(s): Miquel Massot , Allied Vision Technologies
autogenerated on Mon Jun 10 2019 12:50:39