VimbaSystem.hpp
Go to the documentation of this file.
00001 /*=============================================================================
00002   Copyright (C) 2012 Allied Vision Technologies.  All Rights Reserved.
00003 
00004   Redistribution of this file, in original or modified form, without
00005   prior written consent of Allied Vision Technologies is prohibited.
00006 
00007   -----------------------------------------------------------------------------
00008 
00009   File:        VimbaSystem.hpp
00010 
00011   Description: Inline wrapper functions for class AVT::VmbAPI::VimbaSystem.
00012                (This include file is for internal use only.)
00013 
00014   -----------------------------------------------------------------------------
00015 
00016   THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
00017   WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF TITLE,
00018   NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR  PURPOSE ARE
00019   DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 
00020   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
00021   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00022   LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED  
00023   AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 
00024   TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
00025   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00026 
00027 =============================================================================*/
00028 
00029 #ifndef AVT_VMBAPI_VIMBASYSTEM_HPP
00030 #define AVT_VMBAPI_VIMBASYSTEM_HPP
00031 
00032 //
00033 // Inline wrapper functions that allocate memory for STL objects in the application's context
00034 // and to pass data across DLL boundaries using arrays
00035 //
00036 inline VmbErrorType VimbaSystem::GetInterfaces( InterfacePtrVector &rInterfaces )
00037 {
00038     VmbErrorType    res;
00039     VmbUint32_t     nSize;
00040 
00041     res = GetInterfaces( NULL, nSize );
00042     if ( VmbErrorSuccess == res )
00043     {
00044         if( 0 != nSize)
00045         {
00046             try
00047             {
00048                 InterfacePtrVector tmpInterfaces( nSize );
00049                 res = GetInterfaces( &tmpInterfaces[0], nSize );
00050                 if( VmbErrorSuccess == res )
00051                 {
00052                     rInterfaces.swap( tmpInterfaces);
00053                 }
00054             }
00055             catch(...)
00056             {
00057                 return VmbErrorResources;
00058             }
00059         }
00060         else
00061         {
00062             rInterfaces.clear();
00063         }
00064     }
00065 
00066     return res;
00067 }
00068 
00069 inline VmbErrorType VimbaSystem::GetCameras( CameraPtrVector &rCameras )
00070 {
00071     VmbErrorType    res;
00072     VmbUint32_t     nSize;
00073 
00074     res = GetCameras( NULL, nSize );
00075     if (    VmbErrorSuccess == res)
00076     {
00077         if( 0 != nSize)
00078         {
00079             try
00080             {
00081                 CameraPtrVector tmpCameras( nSize );
00082                 res = GetCameras( &tmpCameras[0], nSize );
00083                 if( VmbErrorSuccess == res )
00084                 {
00085                     rCameras.swap( tmpCameras );
00086                 }
00087             }
00088             catch(...)
00089             {
00090                 return VmbErrorResources;
00091             }
00092         }
00093         else
00094         {
00095             rCameras.clear();
00096         }
00097     }
00098 
00099     return res;
00100 }
00101 
00102 #endif


avt_vimba_camera
Author(s): Miquel Massot , Allied Vision Technologies
autogenerated on Thu Jun 6 2019 18:23:39