Feature.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: Feature.cpp
10 
11  Description: Implementation of wrapper class AVT::VmbAPI::Feature.
12 
13 -------------------------------------------------------------------------------
14 
15  THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
16  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF TITLE,
17  NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18  DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
19  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
22  AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
23  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 
26 =============================================================================*/
27 
29 #pragma warning(disable:4996)
31 #pragma warning(default:4996)
39 
40 namespace AVT {
41 namespace VmbAPI {
42 
43 Feature::Feature( const VmbFeatureInfo_t *pFeatureInfo, FeatureContainer *pFeatureContainer )
44  : m_pImpl( new BaseFeature( pFeatureInfo, pFeatureContainer ))
45 {
46  if ( NULL != pFeatureInfo )
47  {
48  delete m_pImpl;
49  switch ( pFeatureInfo->featureDataType )
50  {
51  case VmbFeatureDataBool: m_pImpl = new BoolFeature( pFeatureInfo, pFeatureContainer );
52  break;
53  case VmbFeatureDataEnum: m_pImpl = new EnumFeature( pFeatureInfo, pFeatureContainer );
54  break;
55  case VmbFeatureDataFloat: m_pImpl = new FloatFeature( pFeatureInfo, pFeatureContainer );
56  break;
57  case VmbFeatureDataInt: m_pImpl = new IntFeature( pFeatureInfo, pFeatureContainer );
58  break;
59  case VmbFeatureDataString: m_pImpl = new StringFeature( pFeatureInfo, pFeatureContainer );
60  break;
61  case VmbFeatureDataCommand: m_pImpl = new CommandFeature( pFeatureInfo, pFeatureContainer );
62  break;
63  case VmbFeatureDataRaw: m_pImpl = new RawFeature( pFeatureInfo, pFeatureContainer );
64  break;
65  default: m_pImpl = new BaseFeature( pFeatureInfo, pFeatureContainer );
66  }
67  }
68 }
69 
71 {
72  // No default ctor
73 }
74 
76 {
77  // No copy ctor
78 }
79 
81 {
82  delete m_pImpl;
83 }
84 
86 {
88 }
89 
90 VmbErrorType Feature::RegisterObserver( const IFeatureObserverPtr &rObserver )
91 {
92  return m_pImpl->RegisterObserver( rObserver );
93 }
94 
95 VmbErrorType Feature::UnregisterObserver( const IFeatureObserverPtr &rObserver )
96 {
97  return m_pImpl->UnregisterObserver( rObserver );
98 }
99 
100 // Gets the value of a feature of type VmbFeatureDataInt
102 {
103  return m_pImpl->GetValue( rnValue );
104 }
105 
106 // Sets the value of a feature of type VmbFeatureDataInt
108 {
109  return m_pImpl->SetValue( rnValue );
110 }
111 
112 // Sets the value of a feature of type VmbFeatureDataInt
114 {
115  return m_pImpl->SetValue( (const VmbInt64_t)rnValue );
116 }
117 
118 // Gets the range of a feature of type VmbFeatureDataInt
119 VmbErrorType Feature::GetRange( VmbInt64_t &rnMinimum, VmbInt64_t &rnMaximum ) const
120 {
121  return m_pImpl->GetRange( rnMinimum, rnMaximum );
122 }
123 
124 VmbErrorType Feature::HasIncrement( VmbBool_t &incrementSupported) const
125 {
126  return m_pImpl->HasIncrement( incrementSupported);
127 }
128 // Gets the increment of a feature of type VmbFeatureDataInt
130 {
131  return m_pImpl->GetIncrement( rnIncrement );
132 }
133 
134 // Gets the increment of a feature of type VmbFeatureDataFloat
135 VmbErrorType Feature::GetIncrement( double &rnIncrement ) const
136 {
137  return m_pImpl->GetIncrement( rnIncrement );
138 }
139 
140 // Gets the value of a feature of type VmbFeatureDataFloat
141 VmbErrorType Feature::GetValue( double &rfValue) const
142 {
143  return m_pImpl->GetValue( rfValue );
144 }
145 
146 // Sets the value of a feature of type VmbFeatureDataFloat
147 VmbErrorType Feature::SetValue( const double &rfValue )
148 {
149  return m_pImpl->SetValue( rfValue );
150 }
151 
152 // Gets the range of a feature of type VmbFeatureDataFloat
153 VmbErrorType Feature::GetRange( double &rfMinimum, double &rfMaximum ) const
154 {
155  return m_pImpl->GetRange( rfMinimum, rfMaximum );
156 }
157 
158 // Sets the value of a feature of type VmbFeatureDataEnum
159 // Sets the value of a feature of type VmbFeatureDataString
160 VmbErrorType Feature::SetValue( const char *pStrValue )
161 {
162  return m_pImpl->SetValue( pStrValue );
163 }
164 
165 // Gets all possible values as string of a feature of type VmbFeatureDataEnum
166 VmbErrorType Feature::GetValues( const char **pStrValues, VmbUint32_t &rnSize )
167 {
168  return m_pImpl->GetValues( pStrValues, rnSize );
169 }
170 
171 // Gets all possible values as integer of a feature of type VmbFeatureDataEnum
173 {
174  return m_pImpl->GetValues( pnValues, rnSize );
175 }
176 
177 // Gets the currently selected enum entry of a feature of type VmbFeatureDataEnum
178 VmbErrorType Feature::GetEntry( EnumEntry &entry, const char *pStrEntryName ) const
179 {
180  return m_pImpl->GetEntry( entry, pStrEntryName );
181 }
182 
183 // Gets all possible enum entries of a feature of type VmbFeatureDataEnum
185 {
186  return m_pImpl->GetEntries( pEnumEntries, rnSize );
187 }
188 
189 // Indicates whether a particular enum value as string of a feature of type VmbFeatureDataEnum is available
190 VmbErrorType Feature::IsValueAvailable( const char *pStrValue, bool &rbAvailable ) const
191 {
192  return m_pImpl->IsValueAvailable( pStrValue, rbAvailable );
193 }
194 
195 // Indicates whether a particular enum value as integer of a feature of type VmbFeatureDataEnum is available
196 VmbErrorType Feature::IsValueAvailable( const VmbInt64_t nValue, bool &rbAvailable ) const
197 {
198  return m_pImpl->IsValueAvailable( nValue, rbAvailable );
199 }
200 
201 // Gets the value of a feature of type VmbFeatureDataString
202 VmbErrorType Feature::GetValue( char * const pStrValue, VmbUint32_t &rnLength ) const
203 {
204  return m_pImpl->GetValue( pStrValue, rnLength );
205 }
206 
207 // Gets the value of a feature of type VmbFeatureDataBool
208 VmbErrorType Feature::GetValue( bool &rbValue ) const
209 {
210  return m_pImpl->GetValue( rbValue );
211 }
212 
213 // Sets the value of a feature of type VmbFeatureDataBool
215 {
216  return m_pImpl->SetValue( bValue );
217 }
218 
219 // Executes a feature of type VmbFeatureDataCommand
221 {
222  return m_pImpl->RunCommand();
223 }
224 
225 // Indicates whether a feature of type VmbFeatureDataCommand finished execution
226 VmbErrorType Feature::IsCommandDone( bool &bIsDone ) const
227 {
228  return m_pImpl->IsCommandDone( bIsDone );
229 }
230 
231 // Gets the value of a feature of type VmbFeatureDataRaw
232 VmbErrorType Feature::GetValue( VmbUchar_t *pValue, VmbUint32_t &rnSize, VmbUint32_t &rnSizeFilled ) const
233 {
234  return m_pImpl->GetValue( pValue, rnSize, rnSizeFilled );
235 }
236 
237 // Sets the value of a feature of type VmbFeatureDataRaw
239 {
240  return m_pImpl->SetValue( pValue, nSize );
241 }
242 
243 VmbErrorType Feature::GetName( char * const pStrName, VmbUint32_t &rnLength ) const
244 {
245  return m_pImpl->GetName( pStrName, rnLength );
246 }
247 
248 VmbErrorType Feature::GetDisplayName( char * const pStrDisplayName, VmbUint32_t &rnLength ) const
249 {
250  return m_pImpl->GetDisplayName( pStrDisplayName, rnLength );
251 }
252 
254 {
255  return m_pImpl->GetDataType( reDataType );
256 }
257 
259 {
260  return m_pImpl->GetFlags( reFlags );
261 }
262 
263 VmbErrorType Feature::GetCategory( char * const pStrCategory, VmbUint32_t &rnLength ) const
264 {
265  return m_pImpl->GetCategory( pStrCategory, rnLength );
266 }
267 
269 {
270  return m_pImpl->GetPollingTime( rnPollingTime );
271 }
272 
273 VmbErrorType Feature::GetUnit( char * const pStrUnit, VmbUint32_t &rnLength ) const
274 {
275  return m_pImpl->GetUnit( pStrUnit, rnLength );
276 }
277 
278 VmbErrorType Feature::GetRepresentation( char * const pStrRepresentation, VmbUint32_t &rnLength ) const
279 {
280  return m_pImpl->GetRepresentation( pStrRepresentation, rnLength );
281 }
282 
284 {
285  return m_pImpl->GetVisibility( reVisibility );
286 }
287 
288 VmbErrorType Feature::GetToolTip( char * const pStrToolTip, VmbUint32_t &rnLength ) const
289 {
290  return m_pImpl->GetToolTip( pStrToolTip, rnLength );
291 }
292 
293 VmbErrorType Feature::GetDescription( char * const pStrDescription, VmbUint32_t &rnLength ) const
294 {
295  return m_pImpl->GetDescription( pStrDescription, rnLength );
296 }
297 
298 VmbErrorType Feature::GetSFNCNamespace( char * const pStrSFNCNamespace, VmbUint32_t &rnLength ) const
299 {
300  return m_pImpl->GetSFNCNamespace( pStrSFNCNamespace, rnLength );
301 }
302 
304 {
305  return m_pImpl->GetAffectedFeatures( pAffectedFeatures, rnSize );
306 }
307 
309 {
310  return m_pImpl->GetSelectedFeatures( pSelectedFeatures, rnSize );
311 }
312 
313 VmbErrorType Feature::IsReadable( bool &rbIsReadable )
314 {
315  return m_pImpl->IsReadable( rbIsReadable );
316 }
317 
318 VmbErrorType Feature::IsWritable( bool &rbIsWritable )
319 {
320  return m_pImpl->IsWritable( rbIsWritable );
321 }
322 
323 VmbErrorType Feature::IsStreamable( bool &rbIsStreamable ) const
324 {
325  return m_pImpl->IsStreamable( rbIsStreamable );
326 }
327 
328 
329 }} // namespace AVT::VmbAPI
IMEXPORT VmbErrorType GetSelectedFeatures(FeaturePtr *pSelectedFeatures, VmbUint32_t &nSize)
IMEXPORT VmbErrorType IsWritable(bool &isWritable)
Definition: Feature.cpp:318
BaseFeature * m_pImpl
Definition: Feature.h:577
IMEXPORT VmbErrorType GetDataType(VmbFeatureDataType &dataType) const
IMEXPORT VmbErrorType GetEntry(EnumEntry &entry, const char *pEntryName) const
Definition: Feature.cpp:178
VmbErrorType GetAffectedFeatures(FeaturePtrVector &affectedFeatures)
char VmbBool_t
IMEXPORT VmbErrorType IsStreamable(bool &isStreamable) const
Definition: Feature.cpp:323
IMEXPORT VmbErrorType GetVisibility(VmbFeatureVisibilityType &visibility) const
Definition: Feature.cpp:283
IMEXPORT VmbErrorType GetPollingTime(VmbUint32_t &pollingTime) const
VmbFeatureVisibilityType
Definition: VimbaC.h:181
virtual IMEXPORT VmbErrorType GetName(char *const pName, VmbUint32_t &length) const
VmbErrorType GetUnit(std::string &unit) const
IMEXPORT VmbErrorType IsWritable(bool &isWritable)
long long VmbInt64_t
IMEXPORT VmbErrorType GetDisplayName(char *const pDisplayName, VmbUint32_t &length) const
VmbErrorType GetDescription(std::string &description) const
int VmbInt32_t
IMEXPORT VmbErrorType GetToolTip(char *const pToolTip, VmbUint32_t &length) const
IMEXPORT VmbErrorType IsCommandDone(bool &isDone) const
Definition: Feature.cpp:226
IMEXPORT VmbErrorType UnregisterObserver(const IFeatureObserverPtr &pObserver)
Definition: Feature.cpp:95
VmbFeatureDataType
Definition: VimbaC.h:164
VmbErrorType GetRepresentation(std::string &representation) const
virtual IMEXPORT VmbErrorType IsValueAvailable(const char *pValue, bool &available) const
virtual IMEXPORT VmbErrorType IsCommandDone(bool &isDone) const
virtual IMEXPORT VmbErrorType GetValue(VmbInt64_t &value) const
virtual IMEXPORT VmbErrorType RunCommand()
virtual IMEXPORT VmbErrorType GetRange(VmbInt64_t &minimum, VmbInt64_t &maximum) const
VmbErrorType
virtual IMEXPORT VmbErrorType GetEntries(EnumEntry *pEntries, VmbUint32_t &size)
virtual IMEXPORT VmbErrorType SetValue(const VmbInt32_t &value)
unsigned char VmbUchar_t
IMEXPORT VmbErrorType GetPollingTime(VmbUint32_t &pollingTime) const
Definition: Feature.cpp:268
NetPointer< Feature, AVT::VmbAPINET::Feature > FeaturePtr
VmbErrorType GetSelectedFeatures(FeaturePtrVector &selectedFeatures)
IMEXPORT VmbErrorType GetFlags(VmbFeatureFlagsType &flags) const
IMEXPORT VmbErrorType GetIncrement(VmbInt64_t &increment) const
Definition: Feature.cpp:129
IMEXPORT VmbErrorType GetCategory(char *const pCategory, VmbUint32_t &length) const
IMEXPORT VmbErrorType RegisterObserver(const IFeatureObserverPtr &pObserver)
Definition: Feature.cpp:90
VmbErrorType GetCategory(std::string &category) const
virtual ~Feature()
Definition: Feature.cpp:80
IMEXPORT VmbErrorType HasIncrement(VmbBool_t &incrementSupported) const
Definition: Feature.cpp:124
virtual IMEXPORT VmbErrorType GetEntry(EnumEntry &entry, const char *pStrEntryName) const
IMEXPORT VmbErrorType GetRepresentation(char *const pRepresentation, VmbUint32_t &length) const
virtual IMEXPORT VmbErrorType HasIncrement(VmbBool_t &incrementSupported) const
IMEXPORT VmbErrorType IsValueAvailable(const char *pValue, bool &available) const
Definition: Feature.cpp:190
IMEXPORT VmbErrorType RegisterObserver(const IFeatureObserverPtr &observer)
IMEXPORT VmbErrorType GetFlags(VmbFeatureFlagsType &flags) const
Definition: Feature.cpp:258
IMEXPORT VmbErrorType GetDescription(char *const pDescription, VmbUint32_t &length) const
IMEXPORT VmbErrorType IsReadable(bool &isReadable)
Definition: Feature.cpp:313
VmbErrorType GetName(std::string &name) const
IMEXPORT VmbErrorType GetUnit(char *const pUnit, VmbUint32_t &length) const
VmbErrorType GetDisplayName(std::string &displayName) const
unsigned int VmbUint32_t
IMEXPORT VmbErrorType GetSFNCNamespace(char *const pSFNCNamespace, VmbUint32_t &length) const
IMEXPORT VmbErrorType RunCommand()
Definition: Feature.cpp:220
IMEXPORT VmbErrorType IsStreamable(bool &isStreamable) const
VmbErrorType GetToolTip(std::string &toolTip) const
IMEXPORT VmbErrorType GetValue(VmbInt64_t &value) const
Definition: Feature.cpp:101
VmbErrorType GetSFNCNamespace(std::string &sFNCNamespace) const
VmbFeatureFlagsType
Definition: VimbaC.h:194
IMEXPORT VmbErrorType GetAffectedFeatures(FeaturePtr *pAffectedFeatures, VmbUint32_t &nSize)
void ResetFeatureContainer()
Definition: Feature.cpp:85
IMEXPORT VmbErrorType SetValue(const VmbInt32_t &value)
Definition: Feature.cpp:113
IMEXPORT VmbErrorType UnregisterObserver(const IFeatureObserverPtr &observer)
IMEXPORT VmbErrorType GetRange(double &minimum, double &maximum) const
Definition: Feature.cpp:153
virtual IMEXPORT VmbErrorType GetValues(const char **pValues, VmbUint32_t &size)
virtual IMEXPORT VmbErrorType GetIncrement(VmbInt64_t &increment) const
IMEXPORT VmbErrorType GetDataType(VmbFeatureDataType &dataType) const
Definition: Feature.cpp:253
VmbErrorType GetEntries(EnumEntryVector &entries)
VmbErrorType GetValues(Int64Vector &values)
IMEXPORT VmbErrorType IsReadable(bool &isReadable)
VmbFeatureData_t featureDataType
Definition: VimbaC.h:211
IMEXPORT VmbErrorType GetVisibility(VmbFeatureVisibilityType &visibility) const


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