FeatureContainer.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: FeatureContainer.hpp
10 
11  Description: Inline wrapper functions for class
12  AVT::VmbAPI::FeatureContainer.
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_FEATURECONTAINER_HPP
30 #define AVT_VMBAPI_FEATURECONTAINER_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 
37 // HINT: Once queried this information remains static throughout the object's lifetime
38 inline VmbErrorType FeatureContainer::GetFeatures( FeaturePtrVector &features )
39 {
40  VmbErrorType res;
41  VmbUint32_t nSize;
42 
43  res = GetFeatures( NULL, nSize );
44  if ( VmbErrorSuccess == res )
45  {
46  if( 0 != nSize)
47  {
48  try
49  {
50  FeaturePtrVector tmpFeatures( nSize );
51  res = GetFeatures( &tmpFeatures[0], nSize );
52  if( VmbErrorSuccess == res)
53  {
54  features.swap( tmpFeatures );
55  }
56  }
57  catch(...)
58  {
59  return VmbErrorResources;
60  }
61  }
62  else
63  {
64  features.clear();
65  }
66  }
67 
68  return res;
69 }
70 
71 #endif
VmbErrorType
unsigned int VmbUint32_t
std::vector< FeaturePtr > FeaturePtrVector
Definition: Feature.h:46


avt_vimba_camera
Author(s): Allied Vision Technologies, Miquel Massot
autogenerated on Fri Jun 2 2023 02:21:10