77 #define NCBI_USE_ERRCODE_X Objtools_Rd_Process
105 for (
size_t i = 0;
i <
sizeof(m); ++p, ++
i ) {
109 m = (m << 8) | (*p & 0xff);
115 class COSSReader :
public IReader
118 typedef vector<char> TOctetString;
119 typedef list<TOctetString*> TOctetStringSequence;
121 COSSReader(
const TOctetStringSequence&
in)
130 size_t* bytes_read = 0)
132 size_t pending = x_Pending();
137 if ( pending == 0 ) {
149 size_t pending = x_Pending();
158 m_CurSize = m_CurVec == m_Input.end()? 0: (**m_CurVec).size();
160 size_t x_Pending(
void)
163 while ( (
size = m_CurSize - m_CurPos) == 0 &&
164 m_CurVec != m_Input.end() ) {
171 const TOctetStringSequence& m_Input;
172 TOctetStringSequence::const_iterator m_CurVec;
191 const char*
data =
static_cast<const char*
>(
buffer);
214 #define GB_STATS_STOP(action, stat, size) \
215 LogStat(action, blob_id, stat, r, size, result)
227 : m_Dispatcher(&dispatcher)
258 "CProcessor::ProcessObjStream() is not implemented");
267 if ( !
data.IsSetData() ) {
269 "CProcessor::ProcessBlobFromID2Data() no data");
271 if (
data.GetData_format() !=
data.eData_format_asn_binary ) {
273 "CProcessor::ProcessBlobFromID2Data() is not implemented");
278 switch (
data.GetData_compression() ) {
294 "CProcessor::ProcessBlobFromID2Data() is not implemented");
317 if ( !TPackStrings::GetDefault() ) {
321 TPackStrings::SetDefault(
false);
365 type.FindMember(
"key").SetLocalReadHook(
in,
387 type.FindMember(
"val").SetLocalReadHook(
in,
391 type.FindMember(
"key").SetLocalReadHook(
in,
419 static atomic<TIntId> gi_offset;
420 static atomic<bool> initialized;
421 if ( !initialized.load(memory_order_acquire) ) {
422 gi_offset.store(
NCBI_PARAM_TYPE(GENBANK, GI_OFFSET)::GetDefault(), memory_order_relaxed);
423 initialized.store(
true, memory_order_release);
425 return gi_offset.load(memory_order_relaxed);
441 else if (
id.IsGeneral() ) {
442 CDbtag& dbtag =
id.SetGeneral();
448 const string& s =
tag.GetStr();
464 if (
tag.GetId8(id8) &&
467 tag.SetId8(id8 + gi_offset);
490 if (
OffsetId(*seq_id, gi_offset) ) {
511 switch ( req.
Which() ) {
549 OffsetGi(it->SetStart(), gi_offset);
559 if ( (*it2)->IsGi() ) {
560 OffsetGi((*it2)->SetGi(), gi_offset);
565 if ( it->SetId().IsGi() ) {
566 OffsetGi(it->SetId().SetGi(), gi_offset);
579 it->second.m_SNP_annot_Info->OffsetGi(gi_offset);
675 "double load of "<<blob_id<<
'/'<<chunk_id);
684 size_t data_size = 0;
693 "CProcessor_ID1: read data",
703 result.SetAndSaveBlobState(blob_id, entry.second);
712 "CProcessor_ID1: attached entry",
718 if ( writer &&
version >= 0 ) {
731 switch ( reply.
Which() ) {
742 if (
info.GetBlob_state() < 0 ) {
752 if (
info.GetSuppress() & 5 ) {
754 (
info.GetSuppress() == 4)
758 if (
info.GetWithdrawn() ) {
763 if (
info.GetConfidential() ) {
789 "ID1server-back.error "<<
error);
792 "ID1server-back.error "<<
error);
794 "CProcessor_ID1::GetSeq_entry: "
795 "ID1server-back.error "<<
error);
802 "CProcessor_ID1::GetSeq_entry: "
803 "bad ID1server-back type: "<<reply.
Which());
812 switch ( reply.
Which() ) {
829 _ASSERT(writer && byte_source);
831 (OpenStream(writer,
result, blob_id, chunk_id,
this));
852 (OpenStream(writer,
result, blob_id, chunk_id,
this));
904 "CProcessor_ID1_SNP: "
905 "double load of "<<blob_id<<
'/'<<chunk_id);
909 size_t data_size = 0;
919 "CProcessor_ID1: read SNP data",
928 result.SetAndSaveBlobState(blob_id, entry.second);
931 if ( writer &&
version >= 0 ) {
946 *entry.first, entry.second, *set_info);
959 "CProcessor_ID1: attached entry",
1005 "double load of "<<blob_id<<
'/'<<chunk_id);
1016 size_t data_size = 0;
1020 obj_stream >> *seq_entry;
1025 "CProcessor_SE: read seq-entry",
1037 "CProcessor_SE: attached entry",
1043 result.GetAddWGSMasterDescr() ) {
1065 const char* processor_name)
const
1067 if ( !
result.IsLoadedBlobVersion(blob_id) ) {
1068 ERR_POST_X(4,
"CProcessor_"<<processor_name<<
"::ProcessObjStream: "
1069 "blob version is not set");
1073 ERR_POST_X(5,
"CProcessor_"<<processor_name<<
"::ProcessObjStream: "
1074 "state no_data is set");
1118 "CProcessor_SE_SNP: "
1119 "double load of "<<blob_id<<
'/'<<chunk_id);
1123 size_t data_size = 0;
1137 "CProcessor_SE_SNP: parse SNP data",
1176 "CProcessor_SE_SNP: attached SNP entry to OM",
1227 "CProcessor_St_SE: read state",
1231 result.SetAndSaveBlobState(blob_id, blob_state);
1245 blob_state, writer);
1307 (OpenStream(writer,
result, blob_id, chunk_id,
this));
1330 (OpenStream(writer,
result, blob_id, chunk_id,
this));
1353 (OpenStream(writer,
result, blob_id, chunk_id,
this));
1362 obj_stream << seq_entry;
1379 (OpenStream(writer,
result, blob_id, chunk_id,
this));
1429 "CProcessor_St_SE_SNPT: "
1430 "double load of "<<blob_id<<
'/'<<chunk_id);
1434 result.SetAndSaveBlobState(blob_id, blob_state);
1449 "CProcessor_St_SE_SNPT: read SNP table",
1455 SaveSNPBlob(
result, blob_id, chunk_id, writer, *seq_entry, blob_state, *set_info);
1465 "CProcessor_St_SE_SNPT: attached SNP table",
1482 (OpenStream(writer,
result, blob_id, chunk_id,
this));
1536 blob_state = obj_stream.
ReadInt4();
1541 "CProcessor_ID2: read data",
1559 if ( chunk_id >= 0 ) {
1564 "double load of "<<blob_id<<
'/'<<chunk_id);
1569 "double load of "<<blob_id<<
'/'<<chunk_id);
1572 size_t data_size = 0;
1573 switch (
data.GetData_type() ) {
1577 if ( split_version != 0 || skel ) {
1580 "plain Seq-entry with extra ID2S-Split-Info");
1585 "plain Seq-entry in chunk reply");
1596 "CProcessor_ID2: parsed Seq-entry",
1600 result.SetAndSaveBlobState(blob_id, blob_state);
1610 result.GetAddWGSMasterDescr() ) {
1616 "CProcessor_ID2: attached Seq-entry",
1624 if (
data.GetData_format() ==
data.eData_format_asn_binary &&
1625 data.GetData_compression() ==
data.eData_compression_none &&
1633 blob_state, writer,
data.GetData());
1647 "plain ID2S-Split-Info in non-main reply");
1658 "CProcessor_ID2: parsed split info",
1663 if ( !with_skeleton ) {
1668 "ID2S-Split-Info without skeleton Seq-entry");
1678 "CProcessor_ID2: parsed Seq-entry",
1683 result.SetAndSaveBlobState(blob_id, blob_state);
1694 result.GetAddWGSMasterDescr() ) {
1700 "CProcessor_ID2: attached entry",
1709 if ( with_skeleton ) {
1715 writer, split_version,
data);
1724 writer, split_version,
data, *skel);
1735 "ID2S-Chunk in main reply");
1749 "CProcessor_ID2: parsed split chunk",
1761 "CProcessor_ID2: attached chunk",
1775 "invalid data type: "<<
data.GetData_type());
1789 (OpenStream(writer,
result, blob_id, chunk_id,
this));
1827 data.SetData_type(
data.GetData_type()+1);
1846 stream.write(&(**it)[0], (*it)->size());
1858 switch (
data.GetData_format() ) {
1870 "CId2Reader::x_ReadData(): unknown data format");
1872 unique_ptr<IReader> reader(
new COSSReader(
data.GetData()));
1873 unique_ptr<CNcbiIstream> stream;
1874 switch (
data.GetData_compression() ) {
1882 stream.reset(
new CRStream(reader.release(),
1890 "CId2Reader::x_ReadData(): unknown data compression");
1892 if ( !stream.get() ) {
1893 stream.reset(
new CRStream(reader.release(),
1896 unique_ptr<CObjectIStream>
in;
1898 return in.release();
1907 switch (
data.GetData_type() ) {
1909 if (
object.GetTypeInfo() != CSeq_entry::GetTypeInfo() ) {
1911 "CId2Reader::x_ReadData(): unexpected Seq-entry");
1915 if (
object.GetTypeInfo() != CID2S_Split_Info::GetTypeInfo() ) {
1917 "CId2Reader::x_ReadData(): unexpected ID2S-Split-Info");
1921 if (
object.GetTypeInfo() != CID2S_Chunk::GetTypeInfo() ) {
1923 "CId2Reader::x_ReadData(): unexpected ID2S-Chunk");
1928 "CId2Reader::x_ReadData(): unknown data type");
1934 data_size += size_t(
in->GetStreamPos());
1945 switch (
data.GetData_type() ) {
1947 type = CSeq_entry::GetTypeInfo();
1950 type = CID2S_Split_Info::GetTypeInfo();
1953 type = CID2S_Chunk::GetTypeInfo();
2003 blob_state = obj_stream.
ReadInt4();
2004 split_version = obj_stream.
ReadInt4();
2005 obj_stream >> split_data;
2009 "CProcessor_ID2_Split: read skel",
2014 split_data, split_version);
2028 (OpenStream(writer,
result, blob_id, chunk_id,
this));
2055 obj_stream <<
split;
2099 blob_state = obj_stream.
ReadInt4();
2100 split_version = obj_stream.
ReadInt4();
2101 obj_stream >> split_data;
2102 obj_stream >> skel_data;
2106 "CProcessor_ID2AndSkel: read skel",
2111 split_data, split_version,
ConstRef(&skel_data));
2126 (OpenStream(writer,
result, blob_id, chunk_id,
this));
2156 obj_stream <<
split;
2232 "CProcessor_ExtAnnot: "
2233 "bad blob "<<blob_id<<
'/'<<chunk_id);
2239 "CProcessor_ExtAnnot: "
2240 "double load of "<<blob_id<<
'/'<<chunk_id);
2245 vector<SAnnotTypeSelector> more_types;
2251 db_name =
"Annot:SNP";
2256 db_name =
"Annot:SNP graph";
2262 db_name =
"Annot:CDD";
2267 db_name =
"Annot:MGC";
2272 db_name =
"Annot:HPRD";
2277 db_name =
"Annot:STS";
2282 db_name =
"Annot:tRNA";
2288 db_name =
"Annot:microRNA";
2293 db_name =
"Annot:Exon";
2296 _ASSERT(0 &&
"unknown annot type");
2313 ITERATE ( vector<SAnnotTypeSelector>, it, more_types ) {
2327 (OpenStream(writer,
result, blob_id, chunk_id,
this));
2372 "CProcessor_AnnotInfo: "
2373 "double load of "<<blob_id);
2378 info.GetAnnotInfo()->GetAnnotInfo();
2389 vector<SAnnotTypeSelector>
types;
2399 int feat_type = finfo.
GetType();
2400 if ( feat_type == 0 ) {
2425 if (
names.size() == 1 ) {
2445 m_StatType(stat_type), m_Descr(descr),
2446 m_Blob_id(blob_id), m_ChunkId(chunk_id)
2455 string GetErrMsg(
void)
const {
2462 string GetStatisticsDescription(
void)
const
2465 str << m_Descr <<
' ' << m_Blob_id;
2466 if ( m_ChunkId >= 0 && m_ChunkId <
kMax_Int )
2467 str <<
'.' << m_ChunkId;
2472 const string m_Descr;
2486 stat_type, descr, blob_id);
2499 stat_type, descr, blob_id, chunk_id);
User-defined methods of the data storage class.
void SetNamed(const string &name)
const string & GetName(void) const
Class holding information about root of non-modifiable object hierarchy Do not use it directly.
vector< CConstRef< CID2S_Seq_annot_Info > > TAnnotInfo
TSatKey GetSatKey() const
TSubSat GetSubSat() const
@ID1server_back.hpp User-defined methods of the data storage class.
CID2S_Feat_type_Info –.
CID2S_Seq_annot_Info –.
bool IsLoadedChunk(void) const
void SetSeq_entry(CSeq_entry &entry, CTSE_SetObjectInfo *set_info=0)
CTSE_Split_Info & GetSplitInfo(void)
CTSE_Chunk_Info & GetTSE_Chunk_Info(void)
bool IsLoaded(void) const
CTSE_LoadLock & GetTSE_LoadLock(void)
TBlobState GetBlobState(void) const
Data loader exceptions, used by GenBank loader.
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
list< TOctetString * > TOctetStringSequence
virtual ERW_Result Flush(void)
Flush pending data (if any) down to the output device.
COSSWriter(TOctetStringSequence &out)
TOctetStringSequence & m_Output
vector< char > TOctetString
virtual ERW_Result Write(const void *buffer, size_t count, size_t *written)
Write up to "count" bytes from the buffer pointed to by the "buf" argument onto the output device.
CObjectIStreamAsnBinary –.
CObjectOStreamAsnBinary –.
static bool TryStringPack(void)
CProcessor_AnnotInfo(CReadDispatcher &dispatcher)
~CProcessor_AnnotInfo(void)
TMagic GetMagic(void) const
EType GetType(void) const
static void LoadBlob(CReaderRequestResult &result, const CBlob_Info &blob_info)
TMagic GetMagic(void) const
CProcessor_ExtAnnot(CReadDispatcher &dispatcher)
void Process(CReaderRequestResult &result, const TBlobId &blob_id, TChunkId chunk_id) const
EType GetType(void) const
~CProcessor_ExtAnnot(void)
void ProcessStream(CReaderRequestResult &result, const TBlobId &blob_id, TChunkId chunk_id, CNcbiIstream &stream) const
static bool IsExtAnnot(const TBlobId &blob_id)
EType GetType(void) const
~CProcessor_ID1_SNP(void)
TMagic GetMagic(void) const
void ProcessObjStream(CReaderRequestResult &result, const TBlobId &blob_id, TChunkId chunk_id, CObjectIStream &obj_stream) const
CProcessor_ID1_SNP(CReadDispatcher &dispatcher)
TSeqEntryInfo GetSeq_entry(CReaderRequestResult &result, const TBlobId &blob_id, CID1server_back &reply) const
CProcessor_ID1(CReadDispatcher &dispatcher)
TBlobVersion GetVersion(const CID1server_back &reply) const
TMagic GetMagic(void) const
void SaveBlob(CReaderRequestResult &result, const TBlobId &blob_id, TChunkId chunk_id, CWriter *writer, CRef< CByteSource > byte_source) const
void ProcessObjStream(CReaderRequestResult &result, const TBlobId &blob_id, TChunkId chunk_id, CObjectIStream &obj_stream) const
pair< CRef< CSeq_entry >, int > TSeqEntryInfo
EType GetType(void) const
~CProcessor_ID2AndSkel(void)
void ProcessObjStream(CReaderRequestResult &result, const TBlobId &blob_id, TChunkId chunk_id, CObjectIStream &obj_stream) const
CProcessor_ID2AndSkel(CReadDispatcher &dispatcher)
void SaveDataAndSkel(CReaderRequestResult &result, const TBlobId &blob_id, TBlobState blob_state, TChunkId chunk_id, CWriter *writer, TSplitVersion split_version, const CID2_Reply_Data &split_data, const CID2_Reply_Data &skel_data) const
TMagic GetMagic(void) const
EType GetType(void) const
CProcessor_ID2_Split(CReadDispatcher &dispatcher)
void SaveSplitData(CReaderRequestResult &result, const TBlobId &blob_id, TBlobState blob_state, TChunkId chunk_id, CWriter *writer, TSplitVersion split_version, const CID2_Reply_Data &split_data) const
~CProcessor_ID2_Split(void)
TMagic GetMagic(void) const
void ProcessObjStream(CReaderRequestResult &result, const TBlobId &blob_id, TChunkId chunk_id, CObjectIStream &obj_stream) const
EType GetType(void) const
static CObjectIStream * x_OpenDataStream(const CID2_Reply_Data &data)
static void x_FixDataFormat(CID2_Reply_Data &data)
EType GetType(void) const
void SaveData(CReaderRequestResult &result, const TBlobId &blob_id, TBlobState blob_state, TChunkId chunk_id, CWriter *writer, const CID2_Reply_Data &data) const
TMagic GetMagic(void) const
static void x_ReadData(const CID2_Reply_Data &data, const CObjectInfo &object, size_t &data_size)
CProcessor_ID2(CReadDispatcher &dispatcher)
static void DumpDataAsText(const CID2_Reply_Data &data, CNcbiOstream &out)
void ProcessData(CReaderRequestResult &result, const TBlobId &blob_id, TBlobState blob_state, TChunkId chunk_id, const CID2_Reply_Data &data, TSplitVersion split_version=0, const CID2_Reply_Data *skel=0) const
static void x_FixCompression(CID2_Reply_Data &data)
void ProcessObjStream(CReaderRequestResult &result, const TBlobId &blob_id, TChunkId chunk_id, CObjectIStream &obj_stream) const
TMagic GetMagic(void) const
CProcessor_SE_SNP(CReadDispatcher &dispatcher)
EType GetType(void) const
void ProcessObjStream(CReaderRequestResult &result, const TBlobId &blob_id, TChunkId chunk_id, CObjectIStream &obj_stream) const
EType GetType(void) const
CWriter * x_GetWriterToSaveBlob(CReaderRequestResult &result, const CBlob_id &blob_id, CLoadLockSetter &setter, const char *processor_name) const
CProcessor_SE(CReadDispatcher &dispatcher)
TMagic GetMagic(void) const
void ProcessObjStream(CReaderRequestResult &result, const TBlobId &blob_id, TChunkId chunk_id, CObjectIStream &obj_stream) const
~CProcessor_St_SE_SNPT(void)
EType GetType(void) const
void ProcessStream(CReaderRequestResult &result, const TBlobId &blob_id, TChunkId chunk_id, CNcbiIstream &stream) const
TMagic GetMagic(void) const
void SaveSNPBlob(CReaderRequestResult &result, const TBlobId &blob_id, TChunkId chunk_id, CWriter *writer, const CSeq_entry &seq_entry, TBlobState blob_state, const CTSE_SetObjectInfo &set_info) const
CProcessor_St_SE_SNPT(CReadDispatcher &dispatcher)
CProcessor_St_SE(CReadDispatcher &dispatcher)
void WriteBlobState(CNcbiOstream &stream, TBlobState blob_state) const
TBlobState ReadBlobState(CNcbiIstream &stream) const
TMagic GetMagic(void) const
list< TOctetString * > TOctetStringSequence
void SaveBlob(CReaderRequestResult &result, const TBlobId &blob_id, TChunkId chunk_id, TBlobState blob_state, CWriter *writer, CRef< CByteSource > byte_source) const
void SaveNoBlob(CReaderRequestResult &result, const TBlobId &blob_id, TChunkId chunk_id, TBlobState blob_state, CWriter *writer) const
void ProcessObjStream(CReaderRequestResult &result, const TBlobId &blob_id, TChunkId chunk_id, CObjectIStream &obj_stream) const
EType GetType(void) const
CWriter * GetWriter(const CReaderRequestResult &result) const
static bool TrySNPTable(void)
virtual void ProcessObjStream(CReaderRequestResult &result, const TBlobId &blob_id, TChunkId chunk_id, CObjectIStream &obj_stream) const
static bool TryStringPack(void)
static void OffsetAllGisToOM(CBeginInfo obj, CTSE_SetObjectInfo *set_info=0)
static int CollectStatistics(void)
@ eType_St_Seq_entry_SNPT
static TGi ConvertGiToOM(TGi gi)
static void RegisterAllProcessors(CReadDispatcher &dispatcher)
virtual void ProcessStream(CReaderRequestResult &result, const TBlobId &blob_id, TChunkId chunk_id, CNcbiIstream &stream) const
static bool TrySNPSplit(void)
static void OffsetAllGis(CBeginInfo obj, TIntId gi_offset)
CProcessor(CReadDispatcher &dispatcher)
virtual ~CProcessor(void)
void ProcessBlobFromID2Data(CReaderRequestResult &result, const TBlobId &blob_id, TChunkId chunk_id, const CID2_Reply_Data &data) const
static void SetSeqEntryReadHooks(CObjectIStream &in)
static TIntId GetGiOffset(void)
static void OffsetGi(TGi &gi, TIntId gi_offset)
static bool OffsetId(CSeq_id &id, TIntId gi_offset)
static void LogStat(CReaderRequestResultRecursion &recursion, const CBlob_id &blob_id, CGBRequestStatistics::EStatType stat_type, const char *descr, double size)
static void SetSNPReadHooks(CObjectIStream &in)
CReadDispatcher * m_Dispatcher
static void OffsetAllGisFromOM(CBeginInfo obj)
Note about the "buf_size" parameter for streams in this API.
static void LogStat(CReadDispatcherCommand &command, CReaderRequestResultRecursion &recursion)
const CProcessor & GetProcessor(CProcessor::EType type) const
void InsertProcessor(CRef< CProcessor > processor)
CWriter * GetWriter(const CReaderRequestResult &result, CWriter::EType type) const
CReaderRequestResult & GetResult(void) const
@ eSubtype_misc_difference
static void Write(CNcbiOstream &stream, const CSeq_annot_SNP_Info &snp_info)
static void Read(CNcbiIstream &stream, CSeq_annot_SNP_Info &snp_info)
static void Parse(CObjectIStream &in, CSeq_entry &tse, CTSE_SetObjectInfo &set_info)
static void Attach(CTSE_Info &tse, const CID2S_Split_Info &split)
static void x_ParseLocation(TLocationSet &vec, const CID2S_Seq_loc &loc)
static void Load(CTSE_Chunk_Info &chunk, const CID2S_Chunk &data)
Guard class for CObjectIStream::StartDelayBuffer/EndDelayBuffer.
vector< TLocation > TLocationSet
void x_AddBioseqPlace(TBioseq_setId id)
void x_AddAnnotType(const CAnnotName &annot_name, const SAnnotTypeSelector &annot_type, const TLocationId &location_id)
void x_AddBioseqId(const TBioseqId &id)
void SetName(const CAnnotName &name)
CTSE_Split_Info & GetSplitInfo(void)
bool x_NeedsDelayedMainChunk(void) const
TSeq_annot_InfoMap m_Seq_annot_InfoMap
void AddChunk(CTSE_Chunk_Info &chunk_info)
void SetSplitVersion(TSplitVersion version)
CTypeInfo class contains all information about C++ types (both basic and classes): members and layout...
Template class for iteration on objects of class C.
static void AddWGSMaster(CTSE_LoadLock &lock)
Writer-based output stream.
virtual CRef< CBlobStream > OpenBlobStream(CReaderRequestResult &result, const TBlobId &blob_id, TChunkId chunk_id, const CProcessor &processor)=0
static void WriteBytes(CNcbiOstream &stream, CRef< CByteSource > bs)
CZipStreamCompressor – zlib based compression stream processor.
CZipStreamDecompressor – zlib based decompression stream processor.
A very basic data-read interface.
A very basic data-write interface.
const unsigned char kMagic[2]
std::ofstream out("events_result.xml")
main entry point for tests
static const struct name_t names[]
static const char * str(char *buf, int n)
static const struct type types[]
#define GI_FROM(T, value)
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
@ eTakeOwnership
An object can take ownership of another.
#define ERR_POST_X(err_subcode, message)
Error posting with default error code and given error subcode.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
#define NCBI_THROW_FMT(exception_class, err_code, message)
The same as NCBI_THROW but with message processed as output to ostream.
void Info(CExceptionArgs_Base &args)
C * SerialClone(const C &src)
Create on heap a clone of the source object.
ESerialDataFormat
Data file format.
@ eSerialSkipUnknown_Yes
do skip
@ eSerial_AsnText
ASN.1 text.
@ eSerial_AsnBinary
ASN.1 binary.
static CSeq_id_Handle GetGiHandle(TGi gi)
Faster way to create a handle for a gi.
static CSeq_id_Handle GetHandle(const CSeq_id &id)
Normal way of getting a handle, works for any seq-id.
CConstBeginInfo ConstBegin(const C &obj)
Get starting point of non-modifiable object hierarchy.
CBeginInfo Begin(C &obj)
Get starting point of object hierarchy.
CRef< CByteSource > EndDelayBuffer(void)
Redirect call to protected CObjectIStream After this call guarding is finished.
TFlags SetFlags(TFlags flags)
static CObjectOStream * Open(ESerialDataFormat format, CNcbiOstream &outStream, bool deleteOutStream)
Create serial object writer and attach it to an output stream.
virtual void WriteInt4(Int4 data)=0
CNcbiStreampos GetStreamPos(void) const
Get the current stream position.
static CObjectIStream * Open(ESerialDataFormat format, CNcbiIstream &inStream, bool deleteInStream)
Create serial object reader and attach it to an input stream.
void StartDelayBuffer(CObjectIStream &istr)
Start deley buffer collection on a given CObjectIStream object.
virtual Int4 ReadInt4(void)
void Copy(const CObjectTypeInfo &type)
Copy data.
bool ExtractZoomLevel(const string &full_name, string *acc_ptr, int *zoom_level_ptr)
Extract optional zoom level suffix from named annotation string.
CConstRef< C > ConstRef(const C *object)
Template function for conversion of const object pointer to CConstRef.
#define NCBI_PARAM_TYPE(section, name)
Generate typename for a parameter from its {section, name} attributes.
@ eParam_NoThread
Do not use per-thread values.
uint32_t Uint4
4-byte (32-bit) unsigned integer
int64_t Int8
8-byte (64-bit) signed integer
#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.
virtual CRef< CByteSourceReader > Open(void)=0
ERW_Result
Result codes for I/O operations.
Int8 NcbiStreamposToInt8(NCBI_NS_STD::char_traits< char >::pos_type stream_pos)
Convert stream position to 64-bit int.
virtual ERW_Result PendingCount(size_t *count)=0
Via parameter "count" (which is guaranteed to be supplied non-NULL) return the number of bytes that a...
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
virtual ERW_Result Read(void *buf, size_t count, size_t *bytes_read=0)=0
Read as many as "count" bytes into a buffer pointed to by the "buf" argument.
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
@ eRW_Eof
End of data, should be considered permanent.
@ eRW_Success
Everything is okay, I/O completed.
NCBI_NS_STD::string::size_type SIZE_TYPE
static TNumeric StringToNumeric(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to a numeric value.
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another string.
static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)
Convert numeric value to string.
@ fConvErr_NoThrow
Do not throw an exception on error.
@ eNocase
Case insensitive compare.
void SetTag(TTag &value)
Assign a value to Tag data member.
const TDb & GetDb(void) const
Get the Db member data.
void SetDb(const TDb &value)
Assign a value to Db data member.
const TGotblobinfo & GetGotblobinfo(void) const
Get the variant data.
TBlob_state GetBlob_state(void) const
Get the Blob_state member data.
TGetgihist & SetGetgihist(void)
Select the variant.
TGetgirev & SetGetgirev(void)
Select the variant.
TGotgi & SetGotgi(void)
Select the variant.
E_Choice Which(void) const
Which variant is currently selected.
TError GetError(void) const
Get the variant data.
bool IsGotgi(void) const
Check if variant Gotgi is selected.
const TGotsewithinfo & GetGotsewithinfo(void) const
Get the variant data.
TGetgistate & SetGetgistate(void)
Select the variant.
E_Choice Which(void) const
Which variant is currently selected.
void SetBlob(TBlob &value)
Assign a value to Blob data member.
TGotseqentry & SetGotseqentry(void)
Select the variant.
TGotdeadseqentry & SetGotdeadseqentry(void)
Select the variant.
TGetseqidsfromgi & SetGetseqidsfromgi(void)
Select the variant.
TGotsewithinfo & SetGotsewithinfo(void)
Select the variant.
const TBlob_info & GetBlob_info(void) const
Get the Blob_info member data.
bool IsSetBlob(void) const
Check if a value has been assigned to Blob data member.
@ e_Getgihist
get an historical list of gis
@ e_Getgirev
get a revision history of gi
@ e_Getseqidsfromgi
get all Seq-ids of given gi
@ e_Getgistate
get a state of gi
TData & SetData(void)
Assign a value to Data data member.
list< vector< char > * > TData
@ eData_type_id2s_split_info
@ eData_compression_nlmzip
@ eData_format_asn_binary
list< CRef< C_E > > Tdata
const TSubtypes & GetSubtypes(void) const
Get the Subtypes member data.
bool IsSetSkeleton(void) const
Check if a value has been assigned to Skeleton data member.
const TSeq_loc & GetSeq_loc(void) const
Get the Seq_loc member data.
bool IsSetGraph(void) const
Check if a value has been assigned to Graph data member.
list< CRef< CID2S_Feat_type_Info > > TFeat
bool IsSetAlign(void) const
Check if a value has been assigned to Align data member.
bool IsSetSubtypes(void) const
Check if a value has been assigned to Subtypes data member.
void SetSkeleton(TSkeleton &value)
Assign a value to Skeleton data member.
bool IsWhole_gi(void) const
Check if variant Whole_gi is selected.
const TName & GetName(void) const
Get the Name member data.
const TFeat & GetFeat(void) const
Get the Feat member data.
bool IsSetFeat(void) const
Check if a value has been assigned to Feat data member.
TWhole_gi & SetWhole_gi(void)
Select the variant.
TType GetType(void) const
Get the Type member data.
TGeneral & SetGeneral(void)
Select the variant.
@ e_General
for other databases
const string version
version string
string Execute(const string &cmmd, const vector< string > &args, const string &data=kEmptyStr)
const struct ncbi::grid::netcache::search::fields::SIZE size
string s_Value(TValue value)
std::istream & in(std::istream &in_, double &x_)
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
void split(std::vector< std::string > *strVec, const std::string &str_, const std::string &split_)
static bool s_UseMemoryPool(void)
NCBI_PARAM_DEF_EX(bool, GENBANK, SNP_PACK_STRINGS, true, eParam_NoThread, GENBANK_SNP_PACK_STRINGS)
static bool s_CacheRecompress(void)
static bool s_CanBeWGSBlob(const CBlob_id &blob_id)
static bool GetSeqId(const T &d, set< string > &labels, const string name="", bool detect=false, bool found=false)
Reader-writer based streams.