98 SParam param(data_loader, db_engine, saver);
115 m_DataLoader(param.m_DataLoader),
116 m_DBEngine (param.m_DBEngine),
117 m_EditSaver (param.m_EditSaver)
133 if (!sblobid.empty()) {
154 if (!sblobid.empty()) {
184 if (!sblobid.empty()) {
246 const TBlobId& blob_id = (*lock).GetBlobId();
255 entry->
Assign(*orig_entry);
257 nlock->
Assign(lock, entry);
316 switch(
cmd.Which()) {
382 "SeqEdit_Cmd is not set");
389 switch (
id.Which()) {
398 "SeqEdit_Id is not set");
409 "BioObjectId does not point to Bioseq");
420 "BioObjectId does not point to Bioseq_set");
431 "BioObjectId does not point to Bioseq_set");
445 "BioObjectId does not point to Seq_entry");
478 switch (
cmd.GetData().Which()) {
489 info.SetInst_Length(
cmd.GetData().GetLength());
517 switch (
cmd.GetWhat()) {
522 info.ResetInst_Repr();
525 info.ResetInst_Mol();
528 info.ResetInst_Length();
531 info.ResetInst_Fuzz();
534 info.ResetInst_Topology();
537 info.ResetInst_Strand();
540 info.ResetInst_Ext();
543 info.ResetInst_Hist();
546 info.ResetInst_Seq_data();
558 switch (
cmd.GetData().Which()) {
566 info.SetLevel(
cmd.GetData().GetLevel());
572 info.SetRelease(
const_cast<string&
>(
cmd.GetData().GetRelease()));
575 info.SetDate(
const_cast<CDate&
>(
cmd.GetData().GetDate()));
585 switch (
cmd.GetWhat()) {
678 if (
cmd.IsSetSeq_entry())
682 int index =
cmd.GetIndex();
683 info.AddEntry(*entry, index,
true);
692 info.RemoveEntry(
Ref(&entry_info));
701 info.AddAnnot(annot);
704 template<
typename T>
static inline
712 "Annotation object is not found");
723 if (
cmd.GetNamed()) {
727 switch (
cmd.GetData().Which()) {
739 "Annotation is not set");
748 if (
cmd.GetNamed()) {
755 if (
cmd.IsSetSearch_param() &&
758 switch (
cmd.GetData().Which()) {
760 annot_obj = finder.
Find(
info, annot_name,
761 cmd.GetSearch_param().GetObj().GetFeat());
764 annot_obj = finder.
Find(
info, annot_name,
765 cmd.GetSearch_param().GetObj().GetAlign());
768 annot_obj = finder.
Find(
info, annot_name,
769 cmd.GetSearch_param().GetObj().GetGraph());
773 "Annotation is not set");
777 "Seq_annot object is not found");
779 }
else if (
cmd.IsSetSearch_param() &&
780 cmd.GetSearch_param().Which()
783 cmd.GetSearch_param().GetDescr()));
789 "Seq_annot object is not found");
791 switch (
cmd.GetData().Which()) {
793 annot->
Add(
cmd.GetData().GetFeat());
796 annot->
Add(
cmd.GetData().GetAlign());
799 annot->
Add(
cmd.GetData().GetGraph());
803 "Annotation is not set");
807 template<
typename T>
static inline
810 const T& old_value,
const T& new_value)
816 "Annotation object is not found");
827 if (
cmd.GetNamed()) {
831 switch (
cmd.GetData().Which()) {
834 cmd.GetData().GetFeat().GetOvalue(),
835 cmd.GetData().GetFeat().GetNvalue());
839 cmd.GetData().GetAlign().GetOvalue(),
840 cmd.GetData().GetAlign().GetNvalue());
844 cmd.GetData().GetGraph().GetOvalue(),
845 cmd.GetData().GetGraph().GetNvalue());
849 "Annotation is not set");
864 typedef void(*TArgFuncType)(list<CPluginManager<CDataLoader>
867 ::EEntryPointRequest);
869 RegisterEntryPoint<CDataLoader>((TArgFuncType)
910 const string& data_loader =
913 const string& db_engine =
917 if ( !data_loader.empty() && !db_engine.empty() ) {
922 TDLManager dl_manager;
924 TDLManager::GetDefaultDrvVers(),
930 TDBManager db_manager;
932 TDBManager::GetDefaultDrvVers(),
934 const string& edit_saver =
939 if ( !edit_saver.empty() ) {
944 TESManager es_manager;
945 es = es_manager.CreateInstance(edit_saver,
946 TESManager::GetDefaultDrvVers(),
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
void SetNamed(const string &name)
const CSeq_annot_Info & GetSeq_annot_Info(void) const
TIndex GetAnnotIndex(void) const
CRef< CSeqdesc > RemoveSeqdesc(const CSeqdesc &d)
const TDescr & GetDescr(void) const
void AddSeq_descr(const TDescr &v)
bool AddSeqdesc(CSeqdesc &d)
const CSeq_entry_Info & GetParentSeq_entry_Info(void) const
bool RemoveId(const CSeq_id_Handle &id)
bool AddId(const CSeq_id_Handle &id)
Data Loader Factory for BlastDbDataLoader.
virtual ~CDLPatcher_DataLoaderCF(void)
Destructor.
CDLPatcher_DataLoaderCF(void)
Constructor.
virtual CDataLoader * CreateAndRegister(CObjectManager &om, const TPluginManagerParamTree *params) const
Create and register a data loader.
CObjectManager::TPriority GetPriority(const TPluginManagerParamTree *params) const
const string & GetDriverName(void) const
CObjectManager::EIsDefault GetIsDefault(const TPluginManagerParamTree *params) const
bool ValidParams(const TPluginManagerParamTree *params) const
static TRegisterLoaderInfo RegisterInObjectManager(CObjectManager &om, CRef< CDataLoader >, CRef< IEditsDBEngine >, CRef< IEditSaver > saver=CRef< IEditSaver >(), CObjectManager::EIsDefault is_default=CObjectManager::eNonDefault, CObjectManager::TPriority priority=CObjectManager::kPriority_NotSet)
void x_PatchLockSet(const TTSE_LockSet &orig_locks, TTSE_LockSet &new_locks)
virtual TEditSaver GetEditSaver() const
virtual ~CDataLoaderPatcher()
virtual void GetChunks(const TChunkSet &chunks)
CDataLoaderPatcher(const string &loader_name, const SParam ¶m)
CRef< IEditsDBEngine > m_DBEngine
CRef< CDataLoader > m_DataLoader
CRef< IEditSaver > m_EditSaver
bool x_IsPatchNeeded(const CTSE_Info &tse)
TTSE_Lock x_PatchLock(const TTSE_Lock &lock)
virtual TTSE_Lock GetBlobById(const TBlobId &blob_id)
virtual TBlobId GetBlobId(const CSeq_id_Handle &idh)
virtual TTSE_LockSet GetExternalRecords(const CBioseq_Info &bioseq)
Request from a datasource set of blobs with external annotations.
virtual bool CanGetBlobById(void) const
virtual TTSE_LockSet GetRecords(const CSeq_id_Handle &idh, EChoice choice)
Request from a datasource using handles and ranges instead of seq-loc The TSEs loaded in this call wi...
virtual TTSE_LockSet GetDetailedRecords(const CSeq_id_Handle &idh, const SRequestDetails &details)
Request from a datasource using handles and ranges instead of seq-loc The TSEs loaded in this call wi...
void x_ApplyPatches(CTSE_Info &tse)
virtual TBlobId GetBlobIdFromString(const string &str) const
virtual TBlobVersion GetBlobVersion(const TBlobId &id)
static string GetLoaderNameFromArgs(const SParam ¶m)
virtual void GetChunk(TChunk chunk_info)
CTSE_LoadLock GetTSE_LoadLock(const TBlobId &blob_id)
Data loader exceptions, used by GenBank loader.
CSeqEdit_Cmd_AttachAnnot –.
CSeqEdit_Cmd_AttachSeqEntry –.
CSeqEdit_Cmd_AttachSeq –.
CSeqEdit_Cmd_AttachSet –.
CSeqEdit_Cmd_ChangeSeqAttr –.
CSeqEdit_Cmd_ChangeSetAttr –.
CSeqEdit_Cmd_RemoveAnnot –.
CSeqEdit_Cmd_RemoveDesc –.
CSeqEdit_Cmd_RemoveSeqEntry –.
CSeqEdit_Cmd_ReplaceAnnot –.
CSeqEdit_Cmd_ResetDescr –.
CSeqEdit_Cmd_ResetSeqAttr –.
CSeqEdit_Cmd_ResetSeqEntry –.
CSeqEdit_Cmd_ResetSetAttr –.
const CAnnotObject_Info * Find(const CSeq_entry_Info &entry, const CAnnotName &name, const CSeq_feat &feat)
void Remove(TAnnotIndex index)
pair< TAnnotIndex, bool > Add(const CSeq_feat &new_obj)
bool Replace(TAnnotIndex index, const CSeq_feat &new_obj)
@Seq_descr.hpp User-defined methods of the data storage class.
CConstRef< TObject > GetSeq_entrySkeleton(void) const
const TBlobId & GetBlobId(void) const
CTSE_Info & Assign(const CTSE_Lock &tse)
CTSE_Info_Object * x_FindBioObject(const CBioObjectId &uniq_id) const
bool IsLoaded(void) const
definition of a Culling tree
virtual bool HasBlob(const string &blobid) const =0
list< CRef< CSeqEdit_Cmd > > TCommands
virtual void GetCommands(const string &blobid, TCommands &cmds) const =0
virtual bool FindSeqId(const CSeq_id_Handle &id, string &blobid) const =0
iterator_bool insert(const value_type &val)
static const char * str(char *buf, int n)
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
virtual bool Equals(const CSerialObject &object, ESerialRecursionMode how=eRecursive) const
Check if both objects contain the same values.
static CSeq_id_Handle GetHandle(const CSeq_id &id)
Normal way of getting a handle, works for any seq-id.
string ToString(void) const
TLoader * GetLoader(void) const
Get pointer to the loader.
virtual TBlobId GetBlobIdFromString(const string &str) const
string GetName(void) const
CDataSource * GetDataSource(void) const
virtual bool CanGetBlobById(void) const
virtual TTSE_Lock GetBlobById(const TBlobId &blob_id)
EChoice
main blob is blob with sequence all other blobs are external and contain external annotations
virtual TTSE_LockSet GetRecords(const CSeq_id_Handle &idh, EChoice choice)
Request from a datasource using handles and ranges instead of seq-loc The TSEs loaded in this call wi...
virtual TTSE_LockSet GetDetailedRecords(const CSeq_id_Handle &idh, const SRequestDetails &details)
Request from a datasource using handles and ranges instead of seq-loc The TSEs loaded in this call wi...
EIsDefault
Flag defining if the data loader is included in the "default" group.
TRegisterInfo GetRegisterInfo(void)
static void RegisterInObjectManager(CObjectManager &om, CLoaderMaker_Base &loader_maker, CObjectManager::EIsDefault is_default, CObjectManager::TPriority priority)
Register the loader only if the name is not yet registered in the object manager.
virtual TBlobVersion GetBlobVersion(const TBlobId &id)
virtual void GetChunks(const TChunkSet &chunks)
virtual TTSE_LockSet GetExternalRecords(const CBioseq_Info &bioseq)
Request from a datasource set of blobs with external annotations.
vector< TChunk > TChunkSet
virtual void GetChunk(TChunk chunk_info)
virtual TBlobId GetBlobId(const CSeq_id_Handle &idh)
CRef< C > Ref(C *object)
Helper functions to get CRef<> and CConstRef<> objects.
void Reset(void)
Reset reference object.
static void NCBI_EntryPointImpl(TDriverInfoList &info_list, EEntryPointRequest method)
Entry point implementation.
string GetParam(const string &driver_name, const TPluginManagerParamTree *params, const string ¶m_name, bool mandatory, const string &default_value) const
Utility function to get an element of parameter tree Throws an exception when mandatory parameter is ...
list< SDriverInfo > TDriverInfoList
List of driver information.
EEntryPointRequest
Actions performed by the entry point.
#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.
const TTreeType * FindNode(const TKeyType &key, TNodeSearchMode sflag=eImmediateAndTop) const
Search for node.
@ e_Hist
hist field of seq-inst object
@ e_Fuzz
fuzz field of seq-inst object
@ e_Mol
mol field of seq-inst object
@ e_Length
length field of seq-inst object
@ e_Seq_data
seq-data field of seq-inst object
@ e_Topology
topology field of seq-inst object
@ e_Repr
repr field of seq-inst object
@ e_Strand
strand field of seq-inst object
@ e_Ext
extr field of seq-inst object
@ e_Inst
whole seq-inst object
@ e_Remove_seqentry
Remove a seq entry from bioseq-set.
@ e_Add_descr
Add descriptors to an object.
@ e_Attach_seqentry
Attach a seq entry to bioseq-set.
@ e_Add_desc
Add a descriptor ot an object.
@ e_not_set
No variant selected.
@ e_Attach_seq
Attach a bioseq to seq entry.
@ e_Remove_id
Remove a seq-id from bioseq.
@ e_Reset_seqentry
Detach an object from seq entry.
@ e_Attach_annot
Add a compelte annotation.
@ e_Reset_setattr
Reset bioseq-set's attribute.
@ e_Reset_ids
Reset ids field of bioseq.
@ e_Add_annot
Add an annotaion object.
@ e_Remove_desc
Remove a descripor from an object.
@ e_Set_descr
Set an objects's descriptors.
@ e_Remove_annot
Remove an annotation object.
@ e_Change_setattr
Change bioseq-set's attribure.
@ e_Attach_set
Attach a bioseq-set to seq entry.
@ e_Replace_annot
Replace an annotation object.
@ e_Add_id
Add a new seq-id to bioseq.
@ e_Reset_descr
Reset an objects's descriptors.
@ e_Reset_seqattr
Reset bioseq's attribute.
@ e_Change_seqattr
Change bioseq's attribure.
@ e_Feat
otherwise use an annot object
@ eWhat_strand
strand field of seq-inst object
@ eWhat_repr
repr field of seq-inst object
@ eWhat_mol
mol field of seq-inst object
@ eWhat_ext
extr field of seq-inst object
@ eWhat_length
length field of seq-inst object
@ eWhat_hist
hist field of seq-inst object
@ eWhat_fuzz
fuzz field of seq-inst object
@ eWhat_topology
topology field of seq-inst object
@ eWhat_seq_data
seq-data field of seq-inst object
@ eWhat_inst
whole seq-inst object
@ e_Descr
If an annotation does not have any objects,.
list< CRef< CSeqdesc > > Tdata
ERepr
representation class
const Tdata & Get(void) const
Get the member data.
ETopology
topology of molecule
EMol
molecule class in living organism
EStrand
strandedness in living organism
CSeq_entry_Info & GetSeq_entry(CTSE_Info &tse, const CBioObjectId &id)
CBioseq_Info & GetBioseq(CTSE_Info &tse, const CBioObjectId &id)
CBioseq_set_Info & GetBioseq_set(CTSE_Info &tse, const CBioObjectId &id)
const string kDataLoader_Patcher_DriverName("dlpatcher")
void x_ApplyCmd(CTSE_Info &tse, const CSeqEdit_Cmd_AddId &cmd)
static CBioObjectId s_Convert(const CSeqEdit_Id &id)
static void x_MakeRemove(CTSE_Info &tse, const CSeq_entry_Info &info, const CAnnotName &name, const T &old_value)
void DataLoaders_Register_Patcher(void)
CBioseq_Base_Info & GetBase(CTSE_Info &tse, const CBioObjectId &id)
static void x_MakeReplace(CTSE_Info &tse, const CSeq_entry_Info &info, const CAnnotName &name, const T &old_value, const T &new_value)
void NCBI_EntryPoint_xloader_Patcher(CPluginManager< objects::CDataLoader >::TDriverInfoList &info_list, CPluginManager< objects::CDataLoader >::EEntryPointRequest method)
void NCBI_EntryPoint_DataLoader_Patcher(CPluginManager< CDataLoader >::TDriverInfoList &info_list, CPluginManager< CDataLoader >::EEntryPointRequest method)
const string kCFParam_DLP_EditsDBEngine
const string kCFParam_DLP_DataLoader
const string kCFParam_DLP_EditSaver
Helper classes and templates to implement plugins.
CRef< objects::CObjectManager > om
CRef< CDataLoader > m_DataLoader