RawFeature.cpp
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: RawFeature.cpp
10 
11  Description: Implementation of class AVT::VmbAPI::RawFeature.
12  Intended for use in the implementation of Vimba CPP API.
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 
30 
31 namespace AVT {
32 namespace VmbAPI {
33 
34 RawFeature::RawFeature( const VmbFeatureInfo_t *featureInfo, FeatureContainer *pFeatureContainer )
35  : BaseFeature( featureInfo, pFeatureContainer )
36 {
37 }
38 
39 VmbErrorType RawFeature::GetValue( VmbUchar_t *pValue, VmbUint32_t &rnSize, VmbUint32_t &rnSizeFilled ) const
40 {
41  VmbError_t res;
42  VmbUint32_t nSize;
43 
44  if ( NULL == m_pFeatureContainer )
45  {
46  return VmbErrorDeviceNotOpen;
47  }
48 
50 
51  if ( NULL != pValue )
52  {
53  if ( rnSize < nSize )
54  {
55  return VmbErrorMoreData;
56  }
57 
58  if ( VmbErrorSuccess == res )
59  {
60  res = VmbFeatureRawGet( m_pFeatureContainer->GetHandle(), m_featureInfo.name.c_str(), (char*)pValue, rnSize, &rnSizeFilled );
61  }
62  }
63  else
64  {
65  rnSize = nSize;
66  }
67 
68  return (VmbErrorType)res;
69 }
70 
72 {
73  if ( NULL == m_pFeatureContainer )
74  {
75  return VmbErrorDeviceNotOpen;
76  }
77 
78  if ( NULL == pValue )
79  {
80  return VmbErrorBadParameter;
81  }
82 
83  return (VmbErrorType)VmbFeatureRawSet( m_pFeatureContainer->GetHandle(), m_featureInfo.name.c_str(), (const char*)pValue, nSize );
84 }
85 
86 }} // namespace AVT::VmbAPI
VmbErrorDeviceNotOpen
@ VmbErrorDeviceNotOpen
Definition: VmbCommonTypes.h:113
AVT::VmbAPI::BaseFeature::m_featureInfo
FeatureInfo m_featureInfo
Definition: BaseFeature.h:106
AVT
Definition: AncillaryData.h:35
VmbErrorType
VmbErrorType
Definition: VmbCommonTypes.h:106
AVT::VmbAPI::RawFeature::GetValue
virtual IMEXPORT VmbErrorType GetValue(VmbUchar_t *pValue, VmbUint32_t &size, VmbUint32_t &sizeFilled) const
Definition: RawFeature.cpp:39
VmbFeatureRawGet
IMEXPORTC VmbError_t VMB_CALL VmbFeatureRawGet(const VmbHandle_t handle, const char *name, char *pBuffer, VmbUint32_t bufferSize, VmbUint32_t *pSizeFilled)
AVT::VmbAPI::FeatureContainer::GetHandle
VmbHandle_t GetHandle() const
Definition: FeatureContainer.cpp:188
VmbErrorMoreData
@ VmbErrorMoreData
Definition: VmbCommonTypes.h:117
AVT::VmbAPI::BaseFeature::FeatureInfo::name
std::string name
Definition: BaseFeature.h:89
AVT::VmbAPI::BaseFeature
Definition: BaseFeature.h:39
VmbError_t
VmbInt32_t VmbError_t
Definition: VmbCommonTypes.h:130
AVT::VmbAPI::RawFeature::RawFeature
RawFeature(const VmbFeatureInfo_t *featureInfo, FeatureContainer *pFeatureContainer)
Definition: RawFeature.cpp:34
VmbUint32_t
unsigned int VmbUint32_t
Definition: VmbCommonTypes.h:73
VmbErrorSuccess
@ VmbErrorSuccess
Definition: VmbCommonTypes.h:108
VmbFeatureRawSet
IMEXPORTC VmbError_t VMB_CALL VmbFeatureRawSet(const VmbHandle_t handle, const char *name, const char *pBuffer, VmbUint32_t bufferSize)
RawFeature.h
AVT::VmbAPI::BaseFeature::m_pFeatureContainer
FeatureContainer * m_pFeatureContainer
Definition: BaseFeature.h:108
AVT::VmbAPI::RawFeature::SetValue
virtual IMEXPORT VmbErrorType SetValue(const VmbUchar_t *pValue, VmbUint32_t size)
Definition: RawFeature.cpp:71
AVT::VmbAPI::FeatureContainer
Definition: FeatureContainer.h:40
VmbUchar_t
unsigned char VmbUchar_t
Definition: VmbCommonTypes.h:101
VmbFeatureRawLengthQuery
IMEXPORTC VmbError_t VMB_CALL VmbFeatureRawLengthQuery(const VmbHandle_t handle, const char *name, VmbUint32_t *pLength)
VmbErrorBadParameter
@ VmbErrorBadParameter
Definition: VmbCommonTypes.h:115
VmbFeatureInfo
Definition: VimbaC.h:207


avt_vimba_camera
Author(s): Allied Vision Technologies, Miquel Massot
autogenerated on Sat Jun 3 2023 02:14:12