Pleora Technologies Inc. eBUS SDK v7.0.1.7536 API



PvResult.h
Go to the documentation of this file.
1 // *****************************************************************************
2 //
3 // Copyright (c) 2007, Pleora Technologies Inc., All rights reserved.
4 //
5 // *****************************************************************************
6 
7 #ifndef __PVRESULT_H__
8 #define __PVRESULT_H__
9 
10 #include <PvString.h>
11 
29 class PV_BASE_API PvResult
30 {
31 
32 public:
33 
37  PvResult();
38 
44  PvResult( uint32_t aCode );
45 
52  PvResult( uint32_t aCode, uint32_t aOSCode );
53 
60  PvResult( uint32_t aCode, const PvString & aDescription );
61 
69  PvResult( uint32_t aCode, uint32_t aOSCode, const PvString & aDescription );
70 
76  PvResult( const PvResult& aResult );
77 
78  // The destructor is not virtual to make as much efficient as possible using
79  // the object as return value.
83  ~PvResult();
84 
88  operator const char * () const;
89 
90  PvResult& operator = (const PvResult & aB);
91 
99  bool operator == ( const PvResult & aB ) const;
100 
108  bool operator == ( const uint32_t aCode ) const;
109 
112  //
117  bool operator != ( const PvResult & aB ) const;
118 
126  bool operator != ( const uint32_t aCode ) const;
127 
135  const PvResult & operator |= ( const PvResult & aB );
136 
142  void SetCode( uint32_t aIn );
143 
149  uint32_t GetCode() const;
150 
156  PvString GetCodeString() const;
157 
163  PvString GetDescription() const;
164 
170  void SetDescription( const PvString & aDescription );
171 
177  bool HasDescription() const;
178 
184  bool IsFailure() const;
185 
191  bool IsOK() const;
192 
198  bool IsPending() const;
199 
212  bool IsSuccess() const;
213 
214 // Can be used to retrieve internal diagnostic information
226  uint32_t GetInternalCode() const;
227 
237  uint32_t GetOSCode() const;
238 
239 
242 
243 
247  struct Code
248  {
249  enum CodeEnum
250  {
252  OK = 0,
260  NOT_INITIALIZED = 0x0605,
266  NOT_FOUND = 0x0019,
268  CANNOT_OPEN_FILE = 0x0006,
270  NO_MORE_ITEM = 0x0015,
275  NOT_CONNECTED = 0x0017,
281  STATE_ERROR = 0x001c,
284  THREAD_ERROR = 0x001d,
286  INVALID_DATA_FORMAT = 0x0501,
288  ABORTED = 0x0001,
292  NOT_ENOUGH_MEMORY = 0x0018,
297  GENERIC_ERROR = 0x4000,
304  INVALID_PARAMETER = 0x4001,
308  CANCEL = 0x4002,
313  PENDING = 0xffff,
317  TIMEOUT = 0x001e,
325  NO_LICENSE = 0x0602,
330  GENICAM_XML_ERROR = 0x0904,
335  CANT_READ_MANIFEST = 0x0905,
340  NOT_IMPLEMENTED = 0x0604,
342  NOT_SUPPORTED = 0x001a,
344  FILE_ERROR = 0x0010,
349  ERR_OVERFLOW = 0x001b,
355  IMAGE_ERROR = 0x0025,
360  MISSING_PACKETS = 0x0027,
368  BUFFER_TOO_SMALL = 0x0004,
370  TOO_MANY_RESENDS = 0x0b00,
372  RESENDS_FAILURE = 0x0b01,
377  TOO_MANY_CONSECUTIVE_RESENDS = 0x0b03,
382  AUTO_ABORTED = 0x0b02,
384  BAD_VERSION = 0x0201,
386  NO_MORE_ENTRY = 0x0603,
388  NO_AVAILABLE_DATA = 0x0014,
390  NETWORK_ERROR = 0x0013,
393  NETWORK_CONFIG_ERROR = 0x0600,
395  RESYNC = 0x0028,
397  BUSY = 0x0202,
399  CORRUPTED_DATA = 0x0303
400  };
401  };
402 
403 private:
404 
405  uint32_t mCode;
406  uint32_t mInternalCode;
407  uint32_t mOSCode;
408  PvString* mDescription;
409 
410 };
411 
412 
413 //
414 // Direct #defines or the PvResult::Code - typically used to solve
415 // delay-loading issues
416 //
417 
418 #define PV_OK ( 0 )
419 #define PV_NOT_INITIALIZED ( 0x0605 )
420 #define PV_NOT_FOUND ( 0x0019 )
421 #define PV_CANNOT_OPEN_FILE (0x0006 )
422 #define PV_NO_MORE_ITEM ( 0x0015 )
423 #define PV_NOT_CONNECTED ( 0x0017 )
424 #define PV_STATE_ERROR ( 0x001c )
425 #define PV_THREAD_ERROR ( 0x001d )
426 #define PV_INVALID_DATA_FORMAT ( 0x0501 )
427 #define PV_ABORTED ( 0x0001 )
428 #define PV_NOT_ENOUGH_MEMORY ( 0x0018 )
429 #define PV_GENERIC_ERROR ( 0x4000 )
430 #define PV_INVALID_PARAMETER ( 0x4001 )
431 #define PV_CANCEL ( 0x4002 )
432 #define PV_PENDING ( 0xffff )
433 #define PV_TIMEOUT ( 0x001e )
434 #define PV_NO_LICENSE ( 0x0602 )
435 #define PV_GENICAM_XML_ERROR ( 0x0904 )
436 #define PV_CANT_READ_MANIFEST ( 0x0905 )
437 #define PV_NOT_IMPLEMENTED ( 0x0604 )
438 #define PV_NOT_SUPPORTED ( 0x001a )
439 #define PV_FILE_ERROR ( 0x0010 )
440 #define PV_ERR_OVERFLOW ( 0x001b )
441 #define PV_IMAGE_ERROR ( 0x0025 )
442 #define PV_MISSING_PACKETS ( 0x0027 )
443 #define PV_BUFFER_TOO_SMALL ( 0x0004 )
444 #define PV_TOO_MANY_RESENDS ( 0x0b00 )
445 #define PV_RESENDS_FAILURE ( 0x0b01 )
446 #define PV_TOO_MANY_CONSECUTIVE_RESENDS ( 0x0b03 )
447 #define PV_AUTO_ABORTED ( 0x0b02 )
448 #define PV_BAD_VERSION ( 0x0201 )
449 #define PV_NO_MORE_ENTRY ( 0x0603 )
450 #define PV_NO_AVAILABLE_DATA ( 0x0014 )
451 #define PV_NETWORK_ERROR ( 0x0013 )
452 #define PV_NETWORK_CONFIG_ERROR ( 0x0600 )
453 #define PV_RESYNC ( 0x0028 )
454 #define PV_BUSY ( 0x0202 )
455 #define PV_CORRUPTED_DATA ( 0x0303 )
456 
457 #endif
Result information.
Definition: PvResult.h:30
String class.
Definition: PvString.h:26
Definition: PvResult.h:248
CodeEnum
Definition: PvResult.h:250

Copyright (c) 2002-2026 Pleora Technologies Inc.
www.pleora.com