Pleora Technologies Inc. eBUS SDK v6.5.1.6797 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 
247 
258 
267 
272 
273 
280 
288 
293 
298 
305 
312 
322 
329 
337 
344 
354 
355 
363 
371 
379 
384 
389 
397 
398 
407 
414 
424 
429 
434 
441 
448 
453 
458 
459 
464 
469 
474 
479 
484 
489 
494 
499 
504  struct Code
505  {
506  enum CodeEnum
507  {
508  OK = 0,
509  NOT_INITIALIZED = 0x0605,
510  NOT_FOUND = 0x0019,
511  CANNOT_OPEN_FILE = 0x0006,
512  NO_MORE_ITEM = 0x0015,
513  NOT_CONNECTED = 0x0017,
514  STATE_ERROR = 0x001c,
515  THREAD_ERROR = 0x001d,
516  INVALID_DATA_FORMAT = 0x0501,
517  ABORTED = 0x0001,
518  NOT_ENOUGH_MEMORY = 0x0018,
519  GENERIC_ERROR = 0x4000,
520  INVALID_PARAMETER = 0x4001,
521  CANCEL = 0x4002,
522  PENDING = 0xffff,
523  TIMEOUT = 0x001e,
524  NO_LICENSE = 0x0602,
525  GENICAM_XML_ERROR = 0x0904,
526  CANT_READ_MANIFEST = 0x0905,
527  NOT_IMPLEMENTED = 0x0604,
528  NOT_SUPPORTED = 0x001a,
529  FILE_ERROR = 0x0010,
530  ERR_OVERFLOW = 0x001b,
531  IMAGE_ERROR = 0x0025,
532  MISSING_PACKETS = 0x0027,
533  BUFFER_TOO_SMALL = 0x0004,
534  TOO_MANY_RESENDS = 0x0b00,
535  RESENDS_FAILURE = 0x0b01,
536  TOO_MANY_CONSECUTIVE_RESENDS = 0x0b03,
537  AUTO_ABORTED = 0x0b02,
538  BAD_VERSION = 0x0201,
539  NO_MORE_ENTRY = 0x0603,
540  NO_AVAILABLE_DATA = 0x0014,
541  NETWORK_ERROR = 0x0013,
542  NETWORK_CONFIG_ERROR = 0x0600,
543  RESYNC = 0x0028,
544  BUSY = 0x0202,
545  CORRUPTED_DATA = 0x0303
546  };
547  };
548 
549 private:
550 
551  uint32_t mCode;
552  uint32_t mInternalCode;
553  uint32_t mOSCode;
554  PvString* mDescription;
555 
556 };
557 
558 
559 //
560 // Direct #defines or the PvResult::Code - typically used to solve
561 // delay-loading issues
562 //
563 
564 #define PV_OK ( 0 )
565 #define PV_NOT_INITIALIZED ( 0x0605 )
566 #define PV_NOT_FOUND ( 0x0019 )
567 #define PV_CANNOT_OPEN_FILE (0x0006 )
568 #define PV_NO_MORE_ITEM ( 0x0015 )
569 #define PV_NOT_CONNECTED ( 0x0017 )
570 #define PV_STATE_ERROR ( 0x001c )
571 #define PV_THREAD_ERROR ( 0x001d )
572 #define PV_INVALID_DATA_FORMAT ( 0x0501 )
573 #define PV_ABORTED ( 0x0001 )
574 #define PV_NOT_ENOUGH_MEMORY ( 0x0018 )
575 #define PV_GENERIC_ERROR ( 0x4000 )
576 #define PV_INVALID_PARAMETER ( 0x4001 )
577 #define PV_CANCEL ( 0x4002 )
578 #define PV_PENDING ( 0xffff )
579 #define PV_TIMEOUT ( 0x001e )
580 #define PV_NO_LICENSE ( 0x0602 )
581 #define PV_GENICAM_XML_ERROR ( 0x0904 )
582 #define PV_CANT_READ_MANIFEST ( 0x0905 )
583 #define PV_NOT_IMPLEMENTED ( 0x0604 )
584 #define PV_NOT_SUPPORTED ( 0x001a )
585 #define PV_FILE_ERROR ( 0x0010 )
586 #define PV_ERR_OVERFLOW ( 0x001b )
587 #define PV_IMAGE_ERROR ( 0x0025 )
588 #define PV_MISSING_PACKETS ( 0x0027 )
589 #define PV_BUFFER_TOO_SMALL ( 0x0004 )
590 #define PV_TOO_MANY_RESENDS ( 0x0b00 )
591 #define PV_RESENDS_FAILURE ( 0x0b01 )
592 #define PV_TOO_MANY_CONSECUTIVE_RESENDS ( 0x0b03 )
593 #define PV_AUTO_ABORTED ( 0x0b02 )
594 #define PV_BAD_VERSION ( 0x0201 )
595 #define PV_NO_MORE_ENTRY ( 0x0603 )
596 #define PV_NO_AVAILABLE_DATA ( 0x0014 )
597 #define PV_NETWORK_ERROR ( 0x0013 )
598 #define PV_NETWORK_CONFIG_ERROR ( 0x0600 )
599 #define PV_RESYNC ( 0x0028 )
600 #define PV_BUSY ( 0x0202 )
601 #define PV_CORRUPTED_DATA ( 0x0303 )
602 
603 #endif
PvResult
Result information.
Definition: PvResult.h:29
PvResult::Code
Definition: PvResult.h:504
PvString
String class.
Definition: PvString.h:25
PvResult::Code::CodeEnum
CodeEnum
Definition: PvResult.h:506

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