Pleora Technologies Inc. eBUS SDK v6.2.8.5877 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 
12 
13 class PV_BASE_API PvResult
14 {
15 
16 public:
17 
18  PvResult();
19  PvResult( uint32_t aCode );
20  PvResult( uint32_t aCode, uint32_t aOSCode );
21  PvResult( uint32_t aCode, const PvString & aDescription );
22  PvResult( uint32_t aCode, uint32_t aOSCode, const PvString & aDescription );
23 
24  // copy constructor
25  PvResult( const PvResult& aResult );
26 
27  // The destructor is not virtual to make as much efficient as possible using
28  // the object as return value.
29  ~PvResult();
30 
31  operator const char * () const;
32  PvResult& operator = (const PvResult & aB);
33  bool operator == ( const PvResult & aB ) const;
34  bool operator == ( const uint32_t aCode ) const;
35  bool operator != ( const PvResult & aB ) const;
36  bool operator != ( const uint32_t aCode ) const;
37  const PvResult & operator |= ( const PvResult & aB );
38 
39  void SetCode( uint32_t aIn );
40  uint32_t GetCode() const;
41  PvString GetCodeString() const;
42  PvString GetDescription() const;
43  void SetDescription( const PvString & aDescription );
44  bool HasDescription() const;
45 
46  bool IsFailure() const;
47  bool IsOK() const;
48  bool IsPending() const;
49  bool IsSuccess() const;
50 
51  // Can be used to retrieve internal diagnostic information
52  uint32_t GetInternalCode() const;
53  uint32_t GetOSCode() const;
54 
55  struct Code
56  {
57  enum CodeEnum
58  {
59  OK = 0,
60  NOT_INITIALIZED = 0x0605,
61  NOT_FOUND = 0x0019,
62  CANNOT_OPEN_FILE = 0x0006,
63  NO_MORE_ITEM = 0x0015,
64  NOT_CONNECTED = 0x0017,
65  STATE_ERROR = 0x001c,
66  THREAD_ERROR = 0x001d,
67  INVALID_DATA_FORMAT = 0x0501,
68  ABORTED = 0x0001,
69  NOT_ENOUGH_MEMORY = 0x0018,
70  GENERIC_ERROR = 0x4000,
71  INVALID_PARAMETER = 0x4001,
72  CANCEL = 0x4002,
73  PENDING = 0xffff,
74  TIMEOUT = 0x001e,
75  NO_LICENSE = 0x0602,
76  GENICAM_XML_ERROR = 0x0904,
77  CANT_READ_MANIFEST = 0x0905,
78  NOT_IMPLEMENTED = 0x0604,
79  NOT_SUPPORTED = 0x001a,
80  FILE_ERROR = 0x0010,
81  ERR_OVERFLOW = 0x001b,
82  IMAGE_ERROR = 0x0025,
83  MISSING_PACKETS = 0x0027,
84  BUFFER_TOO_SMALL = 0x0004,
85  TOO_MANY_RESENDS = 0x0b00,
86  RESENDS_FAILURE = 0x0b01,
87  TOO_MANY_CONSECUTIVE_RESENDS = 0x0b03,
88  AUTO_ABORTED = 0x0b02,
89  BAD_VERSION = 0x0201,
90  NO_MORE_ENTRY = 0x0603,
91  NO_AVAILABLE_DATA = 0x0014,
92  NETWORK_ERROR = 0x0013,
93  RESYNC = 0x0028,
94  BUSY = 0x0202,
95  CORRUPTED_DATA = 0x0303
96  };
97  };
98 
99 private:
100 
101  uint32_t mCode;
102  uint32_t mInternalCode;
103  uint32_t mOSCode;
104  PvString* mDescription;
105 
106 };
107 
108 
109 //
110 // Direct #defines or the PvResult::Code - typically used to solve
111 // delay-loading issues
112 //
113 
114 #define PV_OK ( 0 )
115 #define PV_NOT_INITIALIZED ( 0x0605 )
116 #define PV_NOT_FOUND ( 0x0019 )
117 #define PV_CANNOT_OPEN_FILE (0x0006 )
118 #define PV_NO_MORE_ITEM ( 0x0015 )
119 #define PV_NOT_CONNECTED ( 0x0017 )
120 #define PV_STATE_ERROR ( 0x001c )
121 #define PV_THREAD_ERROR ( 0x001d )
122 #define PV_INVALID_DATA_FORMAT ( 0x0501 )
123 #define PV_ABORTED ( 0x0001 )
124 #define PV_NOT_ENOUGH_MEMORY ( 0x0018 )
125 #define PV_GENERIC_ERROR ( 0x4000 )
126 #define PV_INVALID_PARAMETER ( 0x4001 )
127 #define PV_CANCEL ( 0x4002 )
128 #define PV_PENDING ( 0xffff )
129 #define PV_TIMEOUT ( 0x001e )
130 #define PV_NO_LICENSE ( 0x0602 )
131 #define PV_GENICAM_XML_ERROR ( 0x0904 )
132 #define PV_CANT_READ_MANIFEST ( 0x0905 )
133 #define PV_NOT_IMPLEMENTED ( 0x0604 )
134 #define PV_NOT_SUPPORTED ( 0x001a )
135 #define PV_FILE_ERROR ( 0x0010 )
136 #define PV_ERR_OVERFLOW ( 0x001b )
137 #define PV_IMAGE_ERROR ( 0x0025 )
138 #define PV_MISSING_PACKETS ( 0x0027 )
139 #define PV_BUFFER_TOO_SMALL ( 0x0004 )
140 #define PV_TOO_MANY_RESENDS ( 0x0b00 )
141 #define PV_RESENDS_FAILURE ( 0x0b01 )
142 #define PV_TOO_MANY_CONSECUTIVE_RESENDS ( 0x0b03 )
143 #define PV_AUTO_ABORTED ( 0x0b02 )
144 #define PV_BAD_VERSION ( 0x0201 )
145 #define PV_NO_MORE_ENTRY ( 0x0603 )
146 #define PV_NO_AVAILABLE_DATA ( 0x0014 )
147 #define PV_NETWORK_ERROR ( 0x0013 )
148 #define PV_RESYNC ( 0x0028 )
149 #define PV_BUSY ( 0x0202 )
150 #define PV_CORRUPTED_DATA ( 0x0303 )
151 
152 #endif
PvResult
Result information.
Definition: PvResult.h:13
PvResult::Code
Definition: PvResult.h:55
PvString
String class.
Definition: PvString.h:21
PvResult::Code::CodeEnum
CodeEnum
Definition: PvResult.h:57

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