1 #ifndef SRA__READER__BAM__BAMREAD_BASE__HPP
2 #define SRA__READER__BAM__BAMREAD_BASE__HPP
48 #ifndef NCBI_EXCEPTION3_VAR
50 # define NCBI_EXCEPTION3_VAR(name, exc_cls, err_code, msg, extra1, extra2) \
51 exc_cls name(DIAG_COMPILE_INFO, 0, exc_cls::err_code, msg, \
55 #ifndef NCBI_EXCEPTION3
56 # define NCBI_EXCEPTION3(exc_cls, err_code, msg, extra1, extra2) \
57 NCBI_EXCEPTION3_VAR(NCBI_EXCEPTION_EMPTY_NAME, \
58 exc_cls, err_code, msg, extra1, extra2)
62 # define NCBI_THROW3(exc_cls, err_code, msg, extra1, extra2) \
63 throw NCBI_EXCEPTION3(exc_cls, err_code, msg, extra1, extra2)
67 # define NCBI_RETHROW3(prev_exc, exc_cls, err_code, msg, extra1, extra2) \
68 throw exc_cls(DIAG_COMPILE_INFO, &(prev_exc), exc_cls::err_code, msg, \
112 const string& message,
117 const string& message,
123 const string& message,
134 virtual const char*
GetType(
void)
const;
153 static void ReportError(
const char*
msg,
rc_t rc);
168 template<
class Object>
173 #define SPECIALIZE_BAM_REF_TRAITS(T, Const) \
175 struct CBamRefTraits<Const T> \
177 static rc_t x_Release(const T* t); \
178 static rc_t x_AddRef (const T* t); \
180 #define DEFINE_BAM_REF_TRAITS(T, Const) \
181 rc_t CBamRefTraits<Const T>::x_Release(const T* t) \
182 { return T##Release(t); } \
183 rc_t CBamRefTraits<Const T>::x_AddRef (const T* t) \
184 { return T##AddRef(t); }
186 template<
class Object>
205 if (
this != &ref ) {
266 if (
rc_t rc = TTraits::x_AddRef(obj) ) {
268 "Cannot add ref", rc);
ostream & operator<<(ostream &out, const CBamRcFormatter &f)
EErrCode
Error types that CBamXxx classes can generate.
@ eAddRefFailed
AddRef failed.
@ eInvalidArg
Invalid argument error.
@ eInitFailed
Initialization failed.
@ eInvalidBAIFormat
Invalid data in BAM index file.
@ eInvalidBAMFormat
Invalid data in BAM file.
@ eBadCIGAR
Bad CIGAR string.
@ eNullPtr
Null pointer error.
int TErrCode
Translate from the error code value to its string representation.
const string & GetParam(void) const
static void ReportError(const char *msg, rc_t rc)
CBamRef(const TSelf &ref)
static TObject * s_AddRef(const TSelf &ref)
void SetReferencedPointer(TObject *ptr)
TSelf & operator=(const TSelf &ref)
TObject ** x_InitPtr(void)
CBamRefTraits< Object > TTraits
TObject * operator->(void) const
TObject & operator*(void) const
TObject * GetPointer(void) const
Incapsulate compile time information such as __FILE__, __LINE__, NCBI_MODULE, current function.
Include a standard set of the NCBI C++ Toolkit most basic headers.
std::ofstream out("events_result.xml")
main entry point for tests
EDiagSev
Severity level for the posted diagnostics.
@ eDiag_Error
Error message.
virtual void ReportExtra(ostream &out) const
Report "non-standard" attributes.
virtual const char * GetType(void) const
Get class name as a string.
TErrCode GetErrCode(void) const
Get error code.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
virtual const CException * x_Clone(void) const
Helper method for cloning the exception.
#define NCBI_THROW2(exception_class, err_code, message, extra)
Throw exception with extra parameter.
virtual const char * GetErrCodeString(void) const
Get error code interpreted as text.
#define EXCEPTION_VIRTUAL_BASE
Do not use virtual base classes in exception declaration at all, because in this case derived class s...
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define BEGIN_SCOPE(ns)
Define a new scope.
#define NCBI_BAMREAD_EXPORT
Defines NCBI C++ exception handling.
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)