Feature.cpp
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:        Feature.cpp
00010 
00011   Description: Implementation of wrapper class AVT::VmbAPI::Feature.
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 #include <VimbaCPP/Include/Feature.h>
00029 #pragma warning(disable:4996)
00030 #include <VimbaCPP/Source/BaseFeature.h>
00031 #pragma warning(default:4996)
00032 #include <VimbaCPP/Source/BoolFeature.h>
00033 #include <VimbaCPP/Source/CommandFeature.h>
00034 #include <VimbaCPP/Source/EnumFeature.h>
00035 #include <VimbaCPP/Source/FloatFeature.h>
00036 #include <VimbaCPP/Source/IntFeature.h>
00037 #include <VimbaCPP/Source/StringFeature.h>
00038 #include <VimbaCPP/Source/RawFeature.h>
00039 
00040 namespace AVT {
00041 namespace VmbAPI {
00042 
00043 Feature::Feature( const VmbFeatureInfo_t *pFeatureInfo, FeatureContainer *pFeatureContainer )
00044     :   m_pImpl( new BaseFeature( pFeatureInfo, pFeatureContainer ))
00045 {
00046     if ( NULL != pFeatureInfo )
00047     {
00048         delete m_pImpl;
00049         switch ( pFeatureInfo->featureDataType )
00050         {
00051             case VmbFeatureDataBool:        m_pImpl = new BoolFeature( pFeatureInfo, pFeatureContainer );
00052                 break;
00053             case VmbFeatureDataEnum:        m_pImpl = new EnumFeature( pFeatureInfo, pFeatureContainer );
00054                 break;
00055             case VmbFeatureDataFloat:       m_pImpl = new FloatFeature( pFeatureInfo, pFeatureContainer );
00056                 break;
00057             case VmbFeatureDataInt:         m_pImpl = new IntFeature( pFeatureInfo, pFeatureContainer );
00058                 break;
00059             case VmbFeatureDataString:      m_pImpl = new StringFeature( pFeatureInfo, pFeatureContainer );
00060                 break;
00061             case VmbFeatureDataCommand:     m_pImpl = new CommandFeature( pFeatureInfo, pFeatureContainer );
00062                 break;
00063             case VmbFeatureDataRaw:         m_pImpl = new RawFeature( pFeatureInfo, pFeatureContainer );
00064                 break;
00065             default:                        m_pImpl = new BaseFeature( pFeatureInfo, pFeatureContainer );
00066         }
00067     }
00068 }
00069 
00070 Feature::Feature()
00071 {
00072     // No default ctor
00073 }
00074 
00075 Feature::Feature( const Feature& )
00076 {
00077     // No copy ctor
00078 }
00079 
00080 Feature::~Feature()
00081 {
00082     delete m_pImpl;
00083 }
00084 
00085 void Feature::ResetFeatureContainer()
00086 {
00087     m_pImpl->ResetFeatureContainer();
00088 }
00089 
00090 VmbErrorType Feature::RegisterObserver( const IFeatureObserverPtr &rObserver )
00091 {
00092     return m_pImpl->RegisterObserver( rObserver );
00093 }
00094 
00095 VmbErrorType Feature::UnregisterObserver( const IFeatureObserverPtr &rObserver )
00096 {
00097     return m_pImpl->UnregisterObserver( rObserver );
00098 }
00099 
00100 // Gets the value of a feature of type VmbFeatureDataInt
00101 VmbErrorType Feature::GetValue( VmbInt64_t &rnValue ) const
00102 {
00103     return m_pImpl->GetValue( rnValue );
00104 }
00105 
00106 // Sets the value of a feature of type VmbFeatureDataInt
00107 VmbErrorType Feature::SetValue( const VmbInt64_t &rnValue )
00108 {
00109     return m_pImpl->SetValue( rnValue );
00110 }
00111 
00112 // Sets the value of a feature of type VmbFeatureDataInt
00113 VmbErrorType Feature::SetValue( const VmbInt32_t &rnValue )
00114 {
00115     return m_pImpl->SetValue( (const VmbInt64_t)rnValue );
00116 }
00117 
00118 // Gets the range of a feature of type VmbFeatureDataInt
00119 VmbErrorType Feature::GetRange( VmbInt64_t &rnMinimum, VmbInt64_t &rnMaximum ) const
00120 {
00121     return m_pImpl->GetRange( rnMinimum, rnMaximum );
00122 }
00123 
00124 VmbErrorType Feature::HasIncrement( VmbBool_t &incrementSupported) const
00125 {
00126     return m_pImpl->HasIncrement( incrementSupported);
00127 }
00128 // Gets the increment of a feature of type VmbFeatureDataInt
00129 VmbErrorType Feature::GetIncrement( VmbInt64_t &rnIncrement ) const
00130 {
00131     return m_pImpl->GetIncrement( rnIncrement );
00132 }
00133 
00134 // Gets the increment of a feature of type VmbFeatureDataFloat
00135 VmbErrorType Feature::GetIncrement( double &rnIncrement ) const
00136 {
00137     return m_pImpl->GetIncrement( rnIncrement );
00138 }
00139 
00140 // Gets the value of a feature of type VmbFeatureDataFloat
00141 VmbErrorType Feature::GetValue( double &rfValue) const
00142 {
00143     return m_pImpl->GetValue( rfValue );
00144 }
00145 
00146 // Sets the value of a feature of type VmbFeatureDataFloat
00147 VmbErrorType Feature::SetValue( const double &rfValue )
00148 {
00149     return m_pImpl->SetValue( rfValue );
00150 }
00151 
00152 // Gets the range of a feature of type VmbFeatureDataFloat
00153 VmbErrorType Feature::GetRange( double &rfMinimum, double &rfMaximum ) const
00154 {
00155     return m_pImpl->GetRange( rfMinimum, rfMaximum );
00156 }
00157 
00158 // Sets the value of a feature of type VmbFeatureDataEnum
00159 // Sets the value of a feature of type VmbFeatureDataString
00160 VmbErrorType Feature::SetValue( const char *pStrValue )
00161 {
00162     return m_pImpl->SetValue( pStrValue );
00163 }
00164 
00165 // Gets all possible values as string of a feature of type VmbFeatureDataEnum
00166 VmbErrorType Feature::GetValues( const char **pStrValues, VmbUint32_t &rnSize )
00167 {
00168     return m_pImpl->GetValues( pStrValues, rnSize );
00169 }
00170 
00171 // Gets all possible values as integer of a feature of type VmbFeatureDataEnum
00172 VmbErrorType Feature::GetValues( VmbInt64_t *pnValues, VmbUint32_t &rnSize )
00173 {
00174     return m_pImpl->GetValues( pnValues, rnSize );
00175 }
00176 
00177 // Gets the currently selected enum entry of a feature of type VmbFeatureDataEnum
00178 VmbErrorType Feature::GetEntry( EnumEntry &entry, const char *pStrEntryName ) const
00179 {
00180     return m_pImpl->GetEntry( entry, pStrEntryName );
00181 }
00182 
00183 // Gets all possible enum entries of a feature of type VmbFeatureDataEnum
00184 VmbErrorType Feature::GetEntries( EnumEntry *pEnumEntries, VmbUint32_t &rnSize )
00185 {
00186     return m_pImpl->GetEntries( pEnumEntries, rnSize );
00187 }
00188 
00189 // Indicates whether a particular enum value as string of a feature of type VmbFeatureDataEnum is available
00190 VmbErrorType Feature::IsValueAvailable( const char *pStrValue, bool &rbAvailable ) const
00191 {
00192     return m_pImpl->IsValueAvailable( pStrValue, rbAvailable );
00193 }
00194 
00195 // Indicates whether a particular enum value as integer of a feature of type VmbFeatureDataEnum is available
00196 VmbErrorType Feature::IsValueAvailable( const VmbInt64_t nValue, bool &rbAvailable ) const
00197 {
00198     return m_pImpl->IsValueAvailable( nValue, rbAvailable );
00199 }
00200 
00201 // Gets the value of a feature of type VmbFeatureDataString
00202 VmbErrorType Feature::GetValue( char * const pStrValue, VmbUint32_t &rnLength ) const
00203 {
00204     return m_pImpl->GetValue( pStrValue, rnLength );
00205 }
00206 
00207 // Gets the value of a feature of type VmbFeatureDataBool
00208 VmbErrorType Feature::GetValue( bool &rbValue ) const
00209 {
00210     return m_pImpl->GetValue( rbValue );
00211 }
00212 
00213 // Sets the value of a feature of type VmbFeatureDataBool
00214 VmbErrorType Feature::SetValue( bool bValue )
00215 {
00216     return m_pImpl->SetValue( bValue );
00217 }
00218 
00219 // Executes a feature of type VmbFeatureDataCommand
00220 VmbErrorType Feature::RunCommand() 
00221 {
00222     return m_pImpl->RunCommand();
00223 }
00224 
00225 // Indicates whether a feature of type VmbFeatureDataCommand finished execution
00226 VmbErrorType Feature::IsCommandDone( bool &bIsDone ) const
00227 {
00228     return m_pImpl->IsCommandDone( bIsDone );
00229 }
00230 
00231 // Gets the value of a feature of type VmbFeatureDataRaw
00232 VmbErrorType Feature::GetValue( VmbUchar_t *pValue, VmbUint32_t &rnSize, VmbUint32_t &rnSizeFilled ) const
00233 {
00234     return m_pImpl->GetValue( pValue, rnSize, rnSizeFilled );
00235 }
00236 
00237 // Sets the value of a feature of type VmbFeatureDataRaw
00238 VmbErrorType Feature::SetValue( const VmbUchar_t *pValue, VmbUint32_t nSize )
00239 {
00240     return m_pImpl->SetValue( pValue, nSize );
00241 }
00242 
00243 VmbErrorType Feature::GetName( char * const pStrName, VmbUint32_t &rnLength ) const
00244 {
00245     return m_pImpl->GetName( pStrName, rnLength );
00246 }
00247 
00248 VmbErrorType Feature::GetDisplayName( char * const pStrDisplayName, VmbUint32_t &rnLength ) const
00249 {
00250     return m_pImpl->GetDisplayName( pStrDisplayName, rnLength );
00251 }
00252 
00253 VmbErrorType Feature::GetDataType( VmbFeatureDataType &reDataType ) const
00254 {
00255     return m_pImpl->GetDataType( reDataType );
00256 }
00257 
00258 VmbErrorType Feature::GetFlags( VmbFeatureFlagsType &reFlags ) const
00259 {
00260     return m_pImpl->GetFlags( reFlags );
00261 }
00262 
00263 VmbErrorType Feature::GetCategory( char * const pStrCategory, VmbUint32_t &rnLength ) const
00264 {
00265     return m_pImpl->GetCategory( pStrCategory, rnLength );
00266 }
00267 
00268 VmbErrorType Feature::GetPollingTime( VmbUint32_t &rnPollingTime ) const
00269 {
00270     return m_pImpl->GetPollingTime( rnPollingTime );
00271 }
00272 
00273 VmbErrorType Feature::GetUnit( char * const pStrUnit, VmbUint32_t &rnLength ) const
00274 {
00275     return m_pImpl->GetUnit( pStrUnit, rnLength );
00276 }
00277 
00278 VmbErrorType Feature::GetRepresentation( char * const pStrRepresentation, VmbUint32_t &rnLength ) const
00279 {
00280     return m_pImpl->GetRepresentation( pStrRepresentation, rnLength );
00281 }
00282 
00283 VmbErrorType Feature::GetVisibility( VmbFeatureVisibilityType &reVisibility ) const
00284 {
00285     return m_pImpl->GetVisibility( reVisibility );
00286 }
00287 
00288 VmbErrorType Feature::GetToolTip( char * const pStrToolTip, VmbUint32_t &rnLength ) const
00289 {
00290     return m_pImpl->GetToolTip( pStrToolTip, rnLength );
00291 }
00292 
00293 VmbErrorType Feature::GetDescription( char * const pStrDescription, VmbUint32_t &rnLength ) const
00294 {
00295     return m_pImpl->GetDescription( pStrDescription, rnLength );
00296 }
00297 
00298 VmbErrorType Feature::GetSFNCNamespace( char * const pStrSFNCNamespace, VmbUint32_t &rnLength ) const
00299 {
00300     return m_pImpl->GetSFNCNamespace( pStrSFNCNamespace, rnLength );
00301 }
00302 
00303 VmbErrorType Feature::GetAffectedFeatures( FeaturePtr *pAffectedFeatures, VmbUint32_t &rnSize )
00304 {
00305     return m_pImpl->GetAffectedFeatures( pAffectedFeatures, rnSize );
00306 }
00307 
00308 VmbErrorType Feature::GetSelectedFeatures( FeaturePtr *pSelectedFeatures, VmbUint32_t &rnSize )
00309 {
00310     return m_pImpl->GetSelectedFeatures( pSelectedFeatures, rnSize );
00311 }
00312 
00313 VmbErrorType Feature::IsReadable( bool &rbIsReadable )
00314 {
00315     return m_pImpl->IsReadable( rbIsReadable );
00316 }
00317 
00318 VmbErrorType Feature::IsWritable( bool &rbIsWritable )
00319 {
00320     return m_pImpl->IsWritable( rbIsWritable );
00321 }
00322 
00323 VmbErrorType Feature::IsStreamable( bool &rbIsStreamable ) const
00324 {
00325     return m_pImpl->IsStreamable( rbIsStreamable );
00326 }
00327 
00328 
00329 }} // namespace AVT::VmbAPI


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