61 for (
auto const&
id : bioseq_ids) {
78 if (!eh || !eh.
IsSet())
86 vector<CRef<CSeqdesc> > descs;
87 vector<const CSeqdesc*> to_remove;
89 for( ; desc_ci; ++desc_ci )
95 to_remove.push_back(&*desc_ci);
97 for (
const auto desc : to_remove)
104 for( ; direct_child_ci; ++direct_child_ci )
107 for (
size_t i = 0;
i < descs.size();
i++)
114 if ((*desc_it)->Equals(*new_desc))
130 if (
id.IsEmbl() ||
id.IsPir() ||
id.IsSwissprot() ||
131 id.IsDdbj() ||
id.IsPrf() ||
id.IsPdb() ||
132 id.IsTpe() ||
id.IsTpd()) {
142 for (
auto id : bsh.
GetId()) {
166 if (!eh || !eh.
IsSet())
176 for (; child_ci; ++child_ci) {
180 vector<const CSeqdesc*> to_remove;
183 to_remove.push_back(*desc_it);
186 for (
const auto desc : to_remove) {
192 new_desc->
Assign(*update_date_desc);
234 if(deadline.
IsExpired() || status != eIO_Closed) {
245 size_t x_written = 0;
246 size_t n_written_chunk = 0;
249 status = cli.
Write(
buf + n_written_chunk, datasize - n_written_chunk, &x_written);
250 n_written_chunk += x_written;
251 }
while (status ==
eIO_Success && n_written_chunk < datasize);
253 return n_written_chunk;
270 const char*
buf =
nullptr;
272 size_t total_written = 0;
277 throw runtime_error(
"Failed to connect to named pipe");
281 for (
size_t i = 0;
i < chunks; ++
i) {
288 if (total_written < msg.size()) {
289 buf = msg.data() + total_written;
293 if (total_written != msg.size()) {
294 throw runtime_error(
"Failed to write to named pipe");
321 vector<string> tokens;
323 if (tokens.size() != 2)
325 string pipe_name = tokens[0], objId = tokens[1];
328 ostr <<
"smart:update:" << objId <<
'\0';
343 vector<string> tokens;
345 if (tokens.size() != 2)
347 string pipe_name = tokens[0], objId = tokens[1];
350 ostr <<
"smart:cancel:" << objId <<
'\0';
359 const objects::CProjectItem& projitem,
361 switch (result_type) {
369 throw runtime_error(
"Unknown result type.");
User-defined methods of the data storage class.
User-defined methods of the data storage class.
void SetToTime(const CTime &time, EPrecision prec=ePrecision_second)
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
const CSerialObject * GetObject() const
retrieve the object pointed to as a CObject*
static bool ShouldStayInPlace(const objects::CSeqdesc &desc)
bool IsEntrys(void) const
Base class for all serializable objects.
static void SendResult(objects::CScope *scope, const objects::CProjectItem &projitem, EResultType result_type)
static void cleanup(void)
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
void Error(CExceptionArgs_Base &args)
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
const string & GetMsg(void) const
Get message string.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
C * SerialClone(const C &src)
Create on heap a clone of the source object.
#define MSerial_AsnText
I/O stream manipulators –.
CSeq_entry_EditHandle GetSeq_entryEditHandle(const CSeq_entry &entry)
vector< CSeq_id_Handle > TId
TClass GetClass(void) const
CRef< CSeqdesc > RemoveSeqdesc(const CSeqdesc &v) const
TSet ConvertSeqToSet(TClass set_class=CBioseq_set::eClass_not_set) const
Convert the entry from Bioseq to Bioseq-set.
CConstRef< CBioseq_set > GetCompleteBioseq_set(void) const
Return the complete bioseq-set object.
CSeq_entry_EditHandle GetEditHandle(void) const
Get 'edit' version of handle.
bool IsSetClass(void) const
CConstRef< CSeq_entry > GetCompleteSeq_entry(void) const
Complete and get const reference to the seq-entry.
bool AddSeqdesc(CSeqdesc &v) const
const TId & GetId(void) const
@ eNonRecursive
Deprecated.
EIO_Status Open(const string &pipename, const STimeout *timeout=kDefaultTimeout, size_t pipesize=0, TFlags flags=0)
Open a client-side pipe connection.
EIO_Status Write(const void *buf, size_t count, size_t *n_written=0)
Write data to the pipe.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)
Split a string using specified delimiters.
@ fSplit_Tokenize
All delimiters are merged and trimmed, to get non-empty tokens only.
bool IsExpired(void) const
Check if the deadline is expired.
@ eCurrent
Use current time. See also CCurrentTime.
CTimeout g_STimeoutToCTimeout(const STimeout *sto)
Convert STimeout to CTimeout.
@ eIO_Success
everything is fine, no error occurred
bool IsSetDb(void) const
name of database or system Check if a value has been assigned to Db data member.
const TDb & GetDb(void) const
Get the Db member data.
const TGeneral & GetGeneral(void) const
Get the variant data.
@ e_General
for other databases
bool IsSetSeq_set(void) const
Check if a value has been assigned to Seq_set data member.
const TSeq_set & GetSeq_set(void) const
Get the Seq_set member data.
@ eClass_genbank
converted genbank
TUpdate_date & SetUpdate_date(void)
Select the variant.
@ e_Update_date
date of last update
@ e_not_set
No variant selected.
bool IsSetData(void) const
Check if a value has been assigned to Data data member.
list< CRef< CSeq_entry > > TEntrys
const TEntrys & GetEntrys(void) const
Get the variant data.
const TData & GetData(void) const
Get the Data member data.
Portable interprocess named pipe API for: UNIX, MS-Win.
void SleepMilliSec(unsigned long ml_sec, EInterruptOnSignal onsignal=eRestartOnSignal)
static bool GetSeqId(const T &d, set< string > &labels, const string name="", bool detect=false, bool found=false)
Utility macros and typedefs for exploring NCBI objects from seqset.asn.
#define FOR_EACH_SEQDESC_ON_SEQENTRY(Itr, Var)
FOR_EACH_SEQDESC_ON_SEQENTRY EDIT_EACH_SEQDESC_ON_SEQENTRY.
static EIO_Status s_ConnectToNamedPipe(CNamedPipeClient &cli, const string &pipe_name)
bool s_IsExternalRecord(const CSeq_id &id)
static CNamedPipeClient & CreateClientPipe()
static void s_DescriptorPropagateDown(CSeq_entry_EditHandle eh)
static void s_WriteToNamedPipe(const string &pipe_name, const string &msg)
static void s_DoSmartProcessing(const CSeq_entry *entry, CScope &scope)
static void s_SaveToSmartClient(CScope *scope, const CProjectItem &projitem)
static void s_ActualizeUpdateDate(CSeq_entry_EditHandle eh)
static size_t s_WriteBuffer(CNamedPipeClient &cli, const char *buf, size_t datasize)
static void s_CancelEditingSession(const CProjectItem &projitem)
static CNamedPipeClient * client
const size_t cDefaultTimeout_Seconds
static bool s_FindSmartSeqId(CBioseq_Handle bh)