EnumEntry.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:        EnumEntry.hpp
00010 
00011   Description: Inline wrapper functions for class AVT::VmbAPI::EnumEntry.
00012 
00013 -------------------------------------------------------------------------------
00014 
00015   THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
00016   WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF TITLE,
00017   NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR  PURPOSE ARE
00018   DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 
00019   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
00020   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00021   LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED  
00022   AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 
00023   TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
00024   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00025 
00026 =============================================================================*/
00027 
00028 #ifndef AVT_VMBAPI_ENUMENTRY_HPP
00029 #define AVT_VMBAPI_ENUMENTRY_HPP
00030 
00031 //
00032 // Inline wrapper functions that allocate memory for STL objects in the application's context
00033 // and to pass data across DLL boundaries using arrays
00034 //
00035 inline VmbErrorType EnumEntry::GetName( std::string &rStrName ) const
00036 {
00037     VmbErrorType res;
00038     VmbUint32_t nLength;
00039 
00040     res = GetName( NULL, nLength );
00041     if ( VmbErrorSuccess == res )
00042     {
00043         if ( 0 < nLength )
00044         {
00045             rStrName.resize( nLength );
00046             res = GetName( &rStrName[0], nLength );
00047             if ( VmbErrorSuccess == res )
00048             {
00049                 size_t nPos = rStrName.find( '\0' );
00050                 if ( nLength-1 > nPos )
00051                 {
00052                     rStrName.resize( nPos );
00053                 }
00054             }
00055         }
00056         else
00057         {
00058             rStrName.clear();
00059         }
00060     }
00061 
00062     return res;
00063 }
00064 
00065 inline VmbErrorType EnumEntry::GetDisplayName( std::string &rStrDisplayName ) const
00066 {
00067     VmbErrorType res;
00068     VmbUint32_t nLength;
00069 
00070     res = GetDisplayName( NULL, nLength );
00071     if ( VmbErrorSuccess == res )
00072     {
00073         if ( 0 < nLength )
00074         {
00075             rStrDisplayName.resize( nLength );
00076             res = GetDisplayName( &rStrDisplayName[0], nLength );
00077             if ( VmbErrorSuccess == res )
00078             {
00079                 size_t nPos = rStrDisplayName.find( '\0' );
00080                 if ( nLength-1 > nPos )
00081                 {
00082                     rStrDisplayName.resize( nPos );
00083                 }
00084             }
00085         }
00086         else
00087         {
00088             rStrDisplayName.clear();
00089         }
00090     }
00091 
00092     return res;
00093 }
00094 
00095 inline VmbErrorType EnumEntry::GetDescription( std::string &rStrDescription ) const
00096 {
00097     VmbErrorType res;
00098     VmbUint32_t nLength;
00099 
00100     res = GetDescription( NULL, nLength );
00101     if ( VmbErrorSuccess == res )
00102     {
00103         if ( 0 < nLength )
00104         {
00105             rStrDescription.resize( nLength );
00106             res = GetDescription( &rStrDescription[0], nLength );
00107             if ( VmbErrorSuccess == res )
00108             {
00109                 size_t nPos = rStrDescription.find( '\0' );
00110                 if ( nLength-1 > nPos )
00111                 {
00112                     rStrDescription.resize( nPos );
00113                 }
00114             }
00115         }
00116         else
00117         {
00118             rStrDescription.clear();
00119         }
00120     }
00121 
00122     return res;
00123 }
00124 
00125 inline VmbErrorType EnumEntry::GetTooltip( std::string &rStrTooltip ) const
00126 {
00127     VmbErrorType res;
00128     VmbUint32_t nLength;
00129 
00130     res = GetTooltip( NULL, nLength );
00131     if ( VmbErrorSuccess == res )
00132     {
00133         if ( 0 < nLength )
00134         {
00135             rStrTooltip.resize( nLength );
00136             res = GetTooltip( &rStrTooltip[0], nLength );
00137             if ( VmbErrorSuccess == res )
00138             {
00139                 size_t nPos = rStrTooltip.find( '\0' );
00140                 if ( nLength-1 > nPos )
00141                 {
00142                     rStrTooltip.resize( nPos );
00143                 }
00144             }
00145         }
00146         else
00147         {
00148             rStrTooltip.clear();
00149         }
00150     }
00151 
00152     return res;
00153 }
00154 
00155 inline VmbErrorType EnumEntry::GetSFNCNamespace( std::string &rStrNamespace ) const
00156 {
00157     VmbErrorType res;
00158     VmbUint32_t nLength;
00159 
00160     res = GetSFNCNamespace( NULL, nLength );
00161     if ( VmbErrorSuccess == res )
00162     {
00163         if ( 0 < nLength )
00164         {
00165             rStrNamespace.resize( nLength );
00166             res = GetSFNCNamespace( &rStrNamespace[0], nLength );
00167             if ( VmbErrorSuccess == res )
00168             {
00169                 size_t nPos = rStrNamespace.find( '\0' );
00170                 if ( nLength-1 > nPos )
00171                 {
00172                     rStrNamespace.resize( nPos );
00173                 }
00174             }
00175         }
00176         else
00177         {
00178             rStrNamespace.clear();
00179         }
00180     }
00181 
00182     return res;
00183 }
00184 
00185 #endif


avt_vimba_camera
Author(s): Miquel Massot , Allied Vision Technologies
autogenerated on Thu Aug 27 2015 12:29:49