本文整理汇总了C++中GetRCState函数的典型用法代码示例。如果您正苦于以下问题:C++ GetRCState函数的具体用法?C++ GetRCState怎么用?C++ GetRCState使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetRCState函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RefNameMake
static
rc_t RefNameMake ( RefName **objp, const VTable *tbl, const VCursor *native_curs )
{
rc_t rc;
/* create the object */
RefName *obj = malloc ( sizeof * obj );
if ( obj == NULL ) {
rc = RC ( rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted );
} else {
obj->curs=NULL;
/* open the reference cursor */
rc = AlignRefTableCursor(tbl, native_curs, &obj->curs, NULL);
if(rc == 0){
/* add columns to cursor */
rc = VCursorAddColumn(obj->curs, &obj->name_idx, "(utf8)REF_NAME");
if( GetRCObject(rc) == rcColumn && GetRCState(rc) == rcNotFound ) {
rc = VCursorAddColumn(obj->curs, &obj->name_idx, "(utf8)NAME");
}
if(GetRCState(rc) == rcExists){
rc = 0;
}
if( rc == 0 ) {
*objp = obj;
return 0;
}
VCursorRelease ( obj -> curs );
}
free ( obj );
}
return rc;
}
示例2: calloc
static char *translate_accession( SRAPath *my_sra_path,
const char *accession,
const size_t bufsize )
{
rc_t rc;
char * res = calloc( 1, bufsize );
if ( res == NULL ) return NULL;
rc = SRAPathFind( my_sra_path, accession, res, bufsize );
if ( GetRCState( rc ) == rcNotFound )
{
free( res );
return NULL;
}
else if ( GetRCState( rc ) == rcInsufficient )
{
free( res );
return translate_accession( my_sra_path, accession, bufsize * 2 );
}
else if ( rc != 0 )
{
free( res );
return NULL;
}
return res;
}
示例3: KCipherMakeInt
rc_t KCipherMakeInt (KCipher ** new_cipher, kcipher_type type)
{
rc_t rc;
*new_cipher = NULL;
#if 0
rc = KCipherVecAesNiMake (new_cipher, type);
if (rc)
{
if (GetRCState(rc) == rcUnsupported)
{
#if USE_SLOW_ONES
rc = KCipherVecRegMake (new_cipher, type);
if (rc)
{
if (GetRCState(rc) == rcUnsupported)
{
rc = KCipherVecMake (new_cipher, type);
if (GetRCState(rc) == rcUnsupported)
{
#endif
#endif
rc = KCipherByteMake (new_cipher, type);
#if 0
#if USE_SLOW_ONES
}
}
}
#endif
}
}
#endif
return rc;
}
示例4: walk_spot_group
static rc_t walk_spot_group( walk_data * data, walk_funcs * funcs )
{
rc_t rc;
do
{
rc = ReferenceIteratorNextSpotGroup ( data->ref_iter, &data->spotgroup, &data->spotgroup_len );
if ( GetRCState( rc ) != rcDone )
{
if ( rc != 0 )
{
LOGERR( klogInt, rc, "ReferenceIteratorNextPos() failed" );
}
else
{
if ( funcs->on_enter_spotgroup != NULL )
rc = funcs->on_enter_spotgroup( data );
if ( rc == 0 )
rc = walk_placements( data, funcs );
if ( rc == 0 && funcs->on_exit_spotgroup != NULL )
rc = funcs->on_exit_spotgroup( data );
}
}
} while ( rc == 0 );
if ( GetRCState( rc ) == rcDone ) { rc = 0; }
return rc;
}
示例5: walk_ref_window
static rc_t walk_ref_window( walk_data * data, walk_funcs * funcs )
{
rc_t rc;
do
{
rc = ReferenceIteratorNextWindow ( data->ref_iter, &data->ref_window_start, &data->ref_window_len );
if ( GetRCState( rc ) != rcDone )
{
if ( rc != 0 )
{
LOGERR( klogInt, rc, "ReferenceIteratorNextWindow() failed" );
}
else
{
if ( funcs->on_enter_ref_window != NULL )
rc = funcs->on_enter_ref_window( data );
if ( rc == 0 )
rc = walk_ref_pos( data, funcs );
if ( rc == 0 && funcs->on_exit_ref_window != NULL )
rc = funcs->on_exit_ref_window( data );
}
}
} while ( rc == 0 );
if ( GetRCState( rc ) == rcDone ) { rc = 0; }
return rc;
}
示例6: SRAReader_ColumnsOpen
static
rc_t SRAReader_ColumnsOpen(SRAReader *self)
{
rc_t rc = 0;
int i = 0;
while(self->cols[i].name != NULL) {
if( self->cols[i].opt == SRAREADER_COL_MANDATORY || (self->options & self->cols[i].opt) ) {
rc = SRATableOpenColumnRead(self->table, &self->cols[i].col, self->cols[i].name, self->cols[i].datatype);
if( rc != 0 ) {
if( ((self->cols[i].opt & SRAREADER_COL_OPTIONAL) && GetRCState(rc) == rcNotFound) ) {
PLOGERR(klogInfo, (klogWarn, rc, "column $(c)", PLOG_S(c), self->cols[i].name));
rc = 0;
} else if( GetRCState(rc) == rcExists ) {
rc = 0;
} else {
PLOGERR(klogInfo, (klogErr, rc, "column $(c)", PLOG_S(c), self->cols[i].name));
break;
}
}
}
i++;
}
return rc;
}
示例7: SDataPrepareCols
static rc_t SDataPrepareCols(struct SData* self,
const char* rdFilterName, const char* readFilterName)
{
rc_t rc = 0;
assert(self);
if (rc == 0) {
const char name[] = "NREADS";
rc = SRATableOpenColumnRead(self->_rdTbl,
&self->_NReadsCol, name, vdb_uint8_t);
if (rc != 0) {
if (GetRCState(rc) == rcNotFound) {
rc = 0;
}
else {
plogerr(klogErr, rc,
"while calling SRATableOpenColumnRead($name)", "name=%s",
name);
}
}
}
/* It the physical column exists, open it */
if (rc == 0) {
rc = SRATableOpenColumnRead(self->_rdTbl,
&self->_origFilterCol, rdFilterName, sra_read_filter_t);
if (rc == 0) {
plogmsg(klogDebug1,
"Found '$(name)' column", "name=%s", rdFilterName);
self->_existedRD_FILTER = true;
self->_origFilterColName = rdFilterName;
}
else if (GetRCState(rc) == rcNotFound) {
plogmsg(klogDebug1,
"Column '$(name)' does not exist", "name=%s", rdFilterName);
rc = 0;
}
else {
plogerr(klogErr, rc, "while calling SRATableOpenColumnRead($name)",
"name=%s", rdFilterName);
}
}
/* Otherwise open the virtual one */
if (rc == 0 && ! self->_existedRD_FILTER) {
rc = SRATableOpenColumnRead(self->_rdTbl,
&self->_origFilterCol, readFilterName, sra_read_filter_t);
if (rc != 0) {
plogerr(klogErr, rc,
"while calling SRATableOpenColumnRead($name)", "name=%s",
readFilterName);
}
}
return rc;
}
示例8: SFFLoaderFmtWriteDataFile
static
rc_t SFFLoaderFmtWriteDataFile(SFFLoaderFmt* self, const SRALoaderFile* file)
{
rc_t rc = 0;
while( rc == 0 ) {
if( self->curr_read_number == 0 ) {
if( (rc = SFFLoaderFmtReadCommonHeader(self, file)) == 0 ) {
DEBUG_MSG (5, ("%s: Common header ok: %u reads\n", self->file_name, self->header.number_of_reads));
DEBUG_MSG (8, ("%s: flow_chars: [%hu] %s\n", self->file_name, self->header.num_flows_per_read, self->flow_chars.data));
DEBUG_MSG (8, ("%s: key_seq: [%hu] %s\n", self->file_name, self->header.key_length, self->key_seq.data));
} else if( GetRCObject(rc) == (enum RCObject)rcData && GetRCState(rc) == rcIgnored ) {
rc = 0;
break;
}
}
if( rc == 0 && self->header.number_of_reads != 0 &&
(rc = SFFLoaderFmtSkipIndex(self, file)) == 0 &&
(rc = SFFLoaderFmtReadDataHeader(self, file)) == 0 &&
(rc = SFFLoaderFmtReadData(self, file)) == 0 ) {
if( self->w454 ) {
rc = SRAWriter454_WriteRead(self->w454, file, &self->name, &self->read, &self->quality,
self->skip_signal ? NULL : &self->signal,
self->skip_signal ? NULL : &self->position,
self->read_header.clip_quality_left, self->read_header.clip_quality_right,
self->read_header.clip_adapter_left, self->read_header.clip_adapter_right);
} else {
rc = SRAWriterIonTorrent_WriteRead(self->wIonTorrent, file, &self->name, &self->read, &self->quality,
self->skip_signal ? NULL : &self->signal,
self->skip_signal ? NULL : &self->position,
self->read_header.clip_quality_left, self->read_header.clip_quality_right,
self->read_header.clip_adapter_left, self->read_header.clip_adapter_right);
}
if( rc == 0 ) {
++self->curr_read_number;
}
}
if( rc != 0 && (GetRCObject(rc) != rcTransfer && GetRCState(rc) != rcDone) ) {
SRALoaderFile_LOG(file, klogErr, rc, "on or about read #$(i)", PLOG_U32(i), self->curr_read_number + 1);
} else if( self->curr_read_number == self->header.number_of_reads ) {
DEBUG_MSG(5, ("%s: done loading declared %u reads\n", self->file_name, self->curr_read_number));
self->curr_read_number = 0;
/* will skip indexes if they are at eof */
if( (rc = SFFLoaderFmtSkipIndex(self, file)) == 0 ) {
/* This should be the end of file and/or beginning of next */
if( (rc = SFFLoaderFmt_ReadBlock(self, file, 0, "EOF", false)) == 0 ) {
if( self->file_buf == NULL ) {
DEBUG_MSG(5, ("%s: EOF detected\n", self->file_name));
self->index_correction = 0;
break;
}
}
}
}
}
return rc;
}
示例9: AlignAccessAlignmentEnumeratorNext
LIB_EXPORT rc_t CC AlignAccessAlignmentEnumeratorNext(const AlignAccessAlignmentEnumerator *cself) {
rc_t rc;
AlignAccessAlignmentEnumerator *self = (AlignAccessAlignmentEnumerator *)cself;
int32_t refSeqID;
AGAIN:
if (self->innerSelf != NULL) {
BAMAlignmentRelease(self->innerSelf);
self->innerSelf = NULL;
}
if (self->atend != 0)
return AlignAccessAlignmentEnumeratorEOFCode;
if (self->slice == NULL) {
rc = BAMFileRead2(self->parent->innerSelf, &self->innerSelf);
if (rc) {
if (GetRCState(rc) == rcNotFound && GetRCObject(rc) == rcRow) {
self->atend = 1;
rc = AlignAccessAlignmentEnumeratorEOFCode;
}
}
return rc;
}
rc = BAMFileReadSlice(self->parent->innerSelf, &self->innerSelf, self->slice);
if (rc) {
if (GetRCState(rc) == rcNotFound && GetRCObject(rc) == rcRow) {
self->atend = 1;
rc = AlignAccessAlignmentEnumeratorEOFCode;
}
return rc;
}
if (!BAMAlignmentIsMapped(self->innerSelf))
goto AGAIN;
BAMAlignmentGetRefSeqId(self->innerSelf, &refSeqID);
if (self->refSeqID != refSeqID) {
self->atend = 1;
rc = AlignAccessAlignmentEnumeratorEOFCode;
}
else if (self->endpos != 0) {
int64_t pos;
uint32_t length;
BAMAlignmentGetPosition2(self->innerSelf, &pos, &length);
if (pos >= (int64_t)self->endpos) {
self->atend = 1;
rc = AlignAccessAlignmentEnumeratorEOFCode;
}
else {
int64_t const endpos = pos + length;
if (endpos <= self->startpos)
goto AGAIN;
}
}
return rc;
}
示例10: bam_header
static rc_t bam_header(const VDatabase* db) {
rc_t rc = 0;
const char path[] = "BAM_HEADER";
const KMetadata* meta = NULL;
const KMDataNode* node = NULL;
char* buffer = NULL;
assert(db);
if (rc == 0) {
rc = VDatabaseOpenMetadataRead(db, &meta);
DISP_RC(rc, "while calling VDatabaseOpenMetadataRead");
}
if (rc == 0) {
rc = KMetadataOpenNodeRead(meta, &node, "%s", path);
if (GetRCState(rc) == rcNotFound)
{ rc = 0; }
else {
DISP_RC2(rc, path, "while calling KMetadataOpenNodeRead");
if (rc == 0) {
int i = 0;
size_t bsize = 0;
size_t size = 1024;
for (i = 0; i < 2; ++i) {
free(buffer);
bsize = size + 1;
buffer = malloc(bsize);
if (buffer == NULL) {
rc = RC(rcExe, rcStorage, rcAllocating,
rcMemory, rcExhausted);
}
else {
rc = KMDataNodeReadCString(node, buffer, bsize, &size);
if (rc == 0) {
break;
}
else if (i == 0
&& GetRCObject(rc) == (enum RCObject)rcBuffer
&& GetRCState (rc) == rcInsufficient)
{
rc = 0;
}
}
DISP_RC2(rc, path, "while calling KMDataNodeReadCString");
}
}
}
}
if (rc == 0 && buffer)
{ OUTMSG(("BAM_HEADER: {\n%s}\n\n", buffer)); }
DESTRUCT(KMDataNode, node);
DESTRUCT(KMetadata, meta);
free(buffer);
return rc;
}
示例11: RefPosMake
static
rc_t RefPosMake ( RefPos **objp, const VTable *tbl, const VCursor *native_curs )
{
rc_t rc;
/* create the object */
RefPos *obj = malloc ( sizeof * obj );
if ( obj == NULL ) {
rc = RC ( rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted );
} else {
obj->curs=NULL;
BSTreeInit(&obj->tr_range);
/* open the reference table cursor*/
if( (rc = AlignRefTableCursor(tbl, native_curs, &obj->curs, NULL)) == 0 ) {
uint32_t itmp;
if( (rc = VCursorAddColumn(obj->curs, &itmp, "(U32)MAX_SEQ_LEN")) == 0 || GetRCState(rc) == rcExists) {
const void *base;
uint32_t row_len;
rc = VCursorCellDataDirect(obj->curs, 1, itmp, NULL, &base, NULL, &row_len);
if(rc == 0) {
assert(row_len == 1);
memcpy(&obj->max_seq_len, base, 4);
}
}
if( GetRCObject(rc) == rcColumn && GetRCState(rc) == rcNotFound ) {
/*** no MAX_SEQ_LEN means that REF_POS==REF_START **/
VCursorRelease(obj->curs);
obj->curs = NULL;
obj->max_seq_len = 0;
obj->name_range_idx = 0;
obj->name_idx = 0;
rc = 0;
} else if( rc == 0 ) {
/* add columns to cursor */
rc = VCursorAddColumn(obj->curs, &obj->name_idx, "(utf8)NAME");
if(rc == 0 || GetRCState(rc) == rcExists)
rc = VCursorAddColumn(obj->curs, &obj->name_range_idx, "NAME_RANGE");
if(GetRCState(rc) == rcExists)
rc = 0;
}
}
if( rc == 0 ) {
*objp = obj;
} else {
VCursorRelease(obj->curs);
free(obj);
}
}
return rc;
}
示例12: LocalRefIDMake
static
rc_t LocalRefIDMake ( LocalRefID **objp, const VTable *tbl, const VCursor *native_curs)
{
rc_t rc;
/* create the object */
LocalRefID *obj = malloc ( sizeof * obj );
if ( obj == NULL )
{
rc = RC( rcXF, rcFunction, rcConstructing, rcMemory, rcExhausted );
}
else
{
const VCursor *curs=NULL;
/* open the reference table cursor*/
rc = AlignRefTableCursor( tbl, native_curs, &curs, NULL );
if ( rc == 0 )
{
uint32_t itmp;
rc = VCursorAddColumn( curs, &itmp, "(U32)MAX_SEQ_LEN" );
if ( rc == 0 || GetRCState( rc ) == rcExists )
{
const void *base;
uint32_t row_len;
rc = VCursorCellDataDirect( curs, 1, itmp, NULL, &base, NULL, &row_len );
if ( rc == 0 )
{
assert( row_len == 1 );
memmove( &obj->max_seq_len, base, 4 );
}
}
if ( ( GetRCObject( rc ) == ( enum RCObject )rcColumn ) && ( GetRCState( rc ) == rcNotFound ) )
{
obj->max_seq_len = 0;
rc = 0;
}
VCursorRelease( curs );
if ( rc == 0 )
{
*objp = obj;
return 0;
}
}
free ( obj );
}
return rc;
}
示例13: m_Db
CVDBTable::CVDBTable(const CVDB& db,
const char* table_name,
EMissing missing)
: m_Db(db),
m_Name(table_name)
{
DECLARE_SDK_GUARD();
if ( rc_t rc = VDatabaseOpenTableRead(db, x_InitPtr(), table_name) ) {
*x_InitPtr() = 0;
RCState rc_state = GetRCState(rc);
int rc_object = GetRCObject(rc);
if ( rc_state == rcNotFound &&
(rc_object == rcParam ||
rc_object == rcPath) ) {
// missing table in the DB
if ( missing != eMissing_Throw ) {
return;
}
NCBI_THROW2_FMT(CSraException, eNotFoundTable,
"Cannot open VDB table: "<<*this, rc);
}
else {
// other errors
NCBI_THROW2_FMT(CSraException, eOtherError,
"Cannot open VDB table: "<<*this, rc);
}
}
}
示例14: resolve_accession
static rc_t resolve_accession( VFSManager * vfs_mgr, const char * accession, const String ** path )
{
VResolver * resolver;
rc_t rc = VFSManagerGetResolver( vfs_mgr, &resolver );
if ( rc == 0 )
{
const VPath * vpath;
rc = VPathMakeSysPath( ( VPath** )&vpath, accession );
if ( rc == 0 )
{
const VPath * rpath;
rc = VResolverLocal( resolver, vpath, &rpath );
if ( GetRCState( rc ) == rcNotFound )
rc = VResolverRemote( resolver, vpath, &rpath, NULL );
if ( rc == 0 )
{
const String * s;
rc = VPathMakeString( rpath, &s );
if ( rc == 0 )
{
rc = StringCopy ( path, s );
free ((void*)s);
}
VPathRelease ( rpath );
}
VPathRelease ( vpath );
}
VResolverRelease( resolver );
}
return rc;
}
示例15: nxt_avail_pos_cb
static void CC nxt_avail_pos_cb( DLNode * n, void * data )
{
pi_ref_nxt_avail_pos_ctx * ctx = ( pi_ref_nxt_avail_pos_ctx * ) data;
if ( ctx->rc == 0 )
{
pi_entry * pie = ( pi_entry * )n;
rc_t rc = PlacementIteratorNextAvailPos ( pie->pi, &(pie->nxt_avail.first), &(pie->nxt_avail.len) );
if ( rc == 0 )
{
/* OUTMSG(( "nxt_avail.first=%u w.last=%u\n", pie->nxt_avail.first, pie->w.last )); */
( ctx->count )++;
if ( ctx->min_pos_initialized )
{
if ( pie->nxt_avail.first < ctx->min_pos )
{
ctx->min_pos = pie->nxt_avail.first;
ctx->min_len = pie->nxt_avail.len;
}
}
else
{
ctx->min_pos = pie->nxt_avail.first;
ctx->min_len = pie->nxt_avail.len;
ctx->min_pos_initialized = true;
}
}
else
{
if ( GetRCState( rc ) != rcDone )
ctx->rc = rc;
}
}
}