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  (This include file is for internal use only.)
14 
15 -------------------------------------------------------------------------------
16 
17  THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
18  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF TITLE,
19  NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20  DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
21  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
25  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 
28 =============================================================================*/
29 
30 #ifndef AVT_VMBAPI_FEATURECONTAINER_HPP
31 #define AVT_VMBAPI_FEATURECONTAINER_HPP
32 
33 //
34 // Inline wrapper functions that allocate memory for STL objects in the application's context
35 // and to pass data across DLL boundaries using arrays
36 //
37 
38 // HINT: Once queried this information remains static throughout the object's lifetime
39 inline VmbErrorType FeatureContainer::GetFeatures( FeaturePtrVector &features )
40 {
41  VmbErrorType res;
42  VmbUint32_t nSize;
43 
44  res = GetFeatures( NULL, nSize );
45  if ( VmbErrorSuccess == res )
46  {
47  if( 0 != nSize)
48  {
49  try
50  {
51  FeaturePtrVector tmpFeatures( nSize );
52  res = GetFeatures( &tmpFeatures[0], nSize );
53  if( VmbErrorSuccess == res)
54  {
55  features.swap( tmpFeatures );
56  }
57  }
58  catch(...)
59  {
60  return VmbErrorResources;
61  }
62  }
63  else
64  {
65  features.clear();
66  }
67  }
68 
69  return res;
70 }
71 
72 #endif
VmbErrorType
unsigned int VmbUint32_t
std::vector< FeaturePtr > FeaturePtrVector
Definition: Feature.h:46


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