|
AVPKit
|
Maps from int return codes to defined Error values. More...
#include <IError.h>


Public Types | |
| enum | Type { ERROR_UNKNOWN , ERROR_IO , ERROR_NUMEXPECTED , ERROR_INVALIDDATA , ERROR_NOMEM , ERROR_NOFMT , ERROR_NOTSUPPORTED , ERROR_NOENT , ERROR_EOF , ERROR_RANGE , ERROR_AGAIN , ERROR_PATCHWELCOME , ERROR_INTERRUPTED } |
| A set of errors that AVPKit knows about. | |
| typedef enum com::avpkit::core::IError::Type | Type |
| A set of errors that AVPKit knows about. | |
Public Member Functions | |
| virtual Type | getType ()=0 |
| Get the OS-independent AVPKit type for this error. More... | |
| virtual const char * | getDescription ()=0 |
| Get a text description for this error. More... | |
| virtual int32_t | getErrorNumber ()=0 |
| Return the raw integer value that AVPKit returned and was used to create this IError. More... | |
Public Member Functions inherited from com::avpkit::ferry::RefCounted | |
| virtual int32_t | acquire () |
| Internal Only. More... | |
| virtual int32_t | release () |
| Internal Only. More... | |
| virtual RefCounted * | copyReference () |
| Create a new Java object that refers to the same native object. More... | |
| virtual int32_t | getCurrentRefCount () |
| Return the current reference count on this object. More... | |
| void | setJavaAllocator (void *allocator) |
| This method is public but not part of the standard API. More... | |
| void * | getJavaAllocator () |
| This method is public but not part of the standard API. More... | |
Static Public Member Functions | |
| static IError * | make (int32_t errorNumber) |
| Create a new IError object from a return value passed in from AVPKit. More... | |
| static IError * | make (Type type) |
| Create a new IError object from an IError.Type enum value. More... | |
| static Type | errorNumberToType (int32_t errorNo) |
| Translate an error number to a type. More... | |
| static int32_t | typeToErrorNumber (Type type) |
| Translate an a type to an error number. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from com::avpkit::ferry::RefCounted | |
| virtual void | destroy () |
| This method is called by RefCounted objects when their Ref Count reaches zero and they are about to be destroyed. | |
Protected Attributes inherited from com::avpkit::ferry::RefCounted | |
| AtomicInteger * | mRefCount |
| This is the internal reference count, represented as an AtomicInteger to make sure it is thread safe. | |
| void * | mAllocator |
| Not part of public API. | |
Maps from int return codes to defined Error values.
This class is used to map from AVPKit return codes (for example on IContainer#readNextPacket(IPacket) into an enum type if the error is known and a text description.
WARNING: Do not write code that depends on the integer values returned from AVPKit; instead use the integer value to create one of these objects. That's because integer values returned from methods can have different meanings on different OS systems (for example, ERROR_AGAIN is -11 on Linux, but a different value on MacOS). This class maps the error to a os-type-safe value.
Also, do not depend on the string messages staying constant. They are for debugging purposes only. And we can't control whether or not they are localized – that's up to your OS. Sorry.
|
static |
Translate an error number to a type.
| errorNo | The error returned from AVPKit |
Definition at line 62 of file IError.cpp.
|
pure virtual |
Get a text description for this error.
The description returned will be in whatever language the underlying OS decides to use, and no, we can't support localization here if the OS hasn't already done it.
Sorry.
Implemented in com::avpkit::core::Error.
|
pure virtual |
Return the raw integer value that AVPKit returned and was used to create this IError.
Note that this value can have different meanings on different operating systems. Use getType() instead for programmatic decisions.
Implemented in com::avpkit::core::Error.
|
pure virtual |
Get the OS-independent AVPKit type for this error.
Implemented in com::avpkit::core::Error.
|
static |
Create a new IError object from a return value passed in from AVPKit.
| errorNumber | The error number as returned from another AVPKit call. ErrorNumber must be < 0. |
Definition at line 44 of file IError.cpp.
Create a new IError object from an IError.Type enum value.
| type | The type to use for creation. |
Definition at line 50 of file IError.cpp.
|
static |
Translate an a type to an error number.
| type | The type |
Definition at line 56 of file IError.cpp.