NCBI C++ ToolKit
sequence_util_macros.hpp File Reference

Generic utility macros and templates for exploring NCBI objects. More...

#include <serial/iterator.hpp>
+ Include dependency graph for sequence_util_macros.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Go to the SVN repository for this file.

#define NCBI_SERIAL_TEST_EXPLORE(Test, Type, Var, Cont)   if (! (Test)) {} else for (CTypeConstIterator<Type> Var (Cont); Var; ++Var)
 @NAME Convenience macros for NCBI objects More...
 
#define NCBI_SERIAL_NC_EXPLORE(Test, Type, Var, Cont)   if (! (Test)) {} else for (CTypeIterator<Type> Var (Cont); Var; ++Var)
 
#define NCBI_CS_ITERATE(Test, Type, Var, Cont)   if (! (Test)) {} else ITERATE (Type, Var, Cont)
 Macros to iterate over standard template containers (non-recursive) More...
 
#define NCBI_NC_ITERATE(Test, Type, Var, Cont)   if (! (Test)) {} else ERASE_ITERATE (Type, Var, Cont)
 NCBI_NC_ITERATE base macro tests to see if loop should be entered. More...
 
#define NCBI_SWITCH(Test, Chs)   if (! (Test)) {} else switch(Chs)
 NCBI_SWITCH base macro tests to see if switch should be performed. More...
 
#define FOR_EACH(Base, Itr, Var)   NCBI_CS_ITERATE (Base##_Test(Var), Base##_Type, Itr, Base##_Get(Var))
 FOR_EACH base macro calls NCBI_CS_ITERATE with generated components. More...
 
#define EDIT_EACH(Base, Itr, Var)   NCBI_NC_ITERATE (Base##_Test(Var), Base##_Type, Itr, Base##_Set(Var))
 EDIT_EACH base macro calls NCBI_NC_ITERATE with generated components. More...
 
#define ADD_ITEM(Base, Var, Ref)   (Base##_Set(Var).push_back(Ref))
 ADD_ITEM base macro. More...
 
#define LIST_ERASE_ITEM(Base, Itr, Var)   (Base##_Set(Var).erase(Itr))
 LIST_ERASE_ITEM base macro. More...
 
#define VECTOR_ERASE_ITEM(Base, Itr, Var)   (VECTOR_ERASE (Itr, Base##_Set(Var)))
 VECTOR_ERASE_ITEM base macro. More...
 
#define ITEM_HAS(Base, Var)   (Base##_Test(Var))
 ITEM_HAS base macro. More...
 
#define FIELD_IS_EMPTY(Base, Var)    (Base##_Test(Var) && Base##_Get(Var).empty() )
 FIELD_IS_EMPTY base macro. More...
 
#define RAW_FIELD_IS_EMPTY(Var, Fld)    ( (Var).IsSet##Fld() && (Var).Get##Fld().empty() )
 RAW_FIELD_IS_EMPTY base macro. More...
 
#define FIELD_IS_EMPTY_OR_UNSET(Base, Var)    ( ! Base##_Test(Var) || Base##_Get(Var).empty() )
 FIELD_IS_EMPTY_OR_UNSET base macro. More...
 
#define RAW_FIELD_IS_EMPTY_OR_UNSET(Var, Fld)    ( ! (Var).IsSet##Fld() || (Var).Get##Fld().empty() )
 RAW_FIELD_IS_EMPTY_OR_UNSET macro. More...
 
#define RAW_FIELD_GET_SIZE_IF_SET(Var, Fld)    ( (Var).IsSet##Fld() ? (Var).Get##Fld().size() : 0 )
 RAW_FIELD_GET_SIZE_IF_SET. More...
 
#define SET_FIELD_IF_UNSET(Var, Fld, Val)    do { if( ! (Var).IsSet##Fld() ) { (Var).Set##Fld(Val); ChangeMade(CCleanupChange::eChangeQualifiers); } } while(false)
 SET_FIELD_IF_UNSET macro. More...
 
#define REMOVE_IF_EMPTY_FIELD(Base, Var)    do { if( FIELD_IS_EMPTY(Base, Var) ) { Base##_Reset(Var); ChangeMade(CCleanupChange::eChangeQualifiers); } } while(false)
 RESET_FIELD_IF_EMPTY base macro. More...
 
#define GET_STRING_OR_BLANK(Base, Var)    (Base##_Test(Var) ? Base##_Get(Var) : kEmptyStr )
 GET_STRING_OR_BLANK base macro. More...
 
#define CHOICE_IS(Base, Var, Chs)   (Base##_Test(Var) && Base##_Chs(Var) == Chs)
 CHOICE_IS base macro. More...
 
#define SWITCH_ON(Base, Var)   NCBI_SWITCH (Base##_Test(Var), Base##_Chs(Var))
 SWITCH_ON base macro calls NCBI_SWITCH with generated components. More...
 
#define IS_SORTED(Base, Var, Func)
 IS_SORTED base macro. More...
 
#define DO_LIST_SORT(Base, Var, Func)   (Base##_Set(Var).sort (Func))
 DO_LIST_SORT base macro. More...
 
#define DO_VECTOR_SORT(Base, Var, Func)
 DO_VECTOR_SORT base macro. More...
 
#define DO_LIST_SORT_HACK(Base, Var, Func)
 DO_LIST_SORT_HACK base macro. More...
 
#define IS_UNIQUE(Base, Var, Func)
 IS_UNIQUE base macro. More...
 
#define DO_UNIQUE(Base, Var, Func)
 DO_UNIQUE base macro. More...
 
#define UNIQUE_WITHOUT_SORT(Base, Var, FuncType, CleanupChangeType)
 
#define BEGIN_COMMA_END(container)    (container).begin(), (container).end()
 
#define STRING_IN_LIST_Type   list <string>
 list <string> macros More...
 
#define STRING_IN_LIST_Test(Var)   (! (Var).empty())
 
#define STRING_IN_LIST_Get(Var)   (Var)
 
#define STRING_IN_LIST_Set(Var)   (Var)
 
#define LIST_HAS_STRING(Var)   ITEM_HAS (STRING_IN_LIST, Var)
 LIST_HAS_STRING. More...
 
#define FOR_EACH_STRING_IN_LIST(Itr, Var)   FOR_EACH (STRING_IN_LIST, Itr, Var)
 FOR_EACH_STRING_IN_LIST EDIT_EACH_STRING_IN_LIST. More...
 
#define EDIT_EACH_STRING_IN_LIST(Itr, Var)   EDIT_EACH (STRING_IN_LIST, Itr, Var)
 
#define ADD_STRING_TO_LIST(Var, Ref)   ADD_ITEM (STRING_IN_LIST, Var, Ref)
 ADD_STRING_TO_LIST. More...
 
#define ERASE_STRING_IN_LIST(Itr, Var)   LIST_ERASE_ITEM (STRING_IN_LIST, Itr, Var)
 ERASE_STRING_IN_LIST. More...
 
#define STRING_IN_LIST_IS_SORTED(Var, Func)   IS_SORTED (STRING_IN_LIST, Var, Func)
 STRING_IN_LIST_IS_SORTED. More...
 
#define SORT_STRING_IN_LIST(Var, Func)   DO_LIST_SORT (STRING_IN_LIST, Var, Func)
 SORT_STRING_IN_LIST. More...
 
#define STRING_IN_LIST_IS_UNIQUE(Var, Func)   IS_UNIQUE (STRING_IN_LIST, Var, Func)
 STRING_IN_LIST_IS_UNIQUE. More...
 
#define UNIQUE_STRING_IN_LIST(Var, Func)   DO_UNIQUE (STRING_IN_LIST, Var, Func)
 UNIQUE_STRING_IN_LIST. More...
 
#define STRING_IN_VECTOR_Type   vector <string>
 vector <string> macros More...
 
#define STRING_IN_VECTOR_Test(Var)   (! (Var).empty())
 
#define STRING_IN_VECTOR_Get(Var)   (Var)
 
#define STRING_IN_VECTOR_Set(Var)   (Var)
 
#define VECTOR_HAS_STRING(Var)   ITEM_HAS (STRING_IN_VECTOR, Var)
 VECTOR_HAS_STRING. More...
 
#define FOR_EACH_STRING_IN_VECTOR(Itr, Var)   FOR_EACH (STRING_IN_VECTOR, Itr, Var)
 FOR_EACH_STRING_IN_VECTOR EDIT_EACH_STRING_IN_VECTOR. More...
 
#define EDIT_EACH_STRING_IN_VECTOR(Itr, Var)   EDIT_EACH (STRING_IN_VECTOR, Itr, Var)
 
#define ADD_STRING_TO_VECTOR(Var, Ref)   ADD_ITEM (STRING_IN_VECTOR, Var, Ref)
 ADD_STRING_TO_VECTOR. More...
 
#define ERASE_STRING_IN_VECTOR(Itr, Var)   VECTOR_ERASE_ITEM (STRING_IN_VECTOR, Itr, Var)
 ERASE_STRING_IN_VECTOR. More...
 
#define STRING_IN_VECTOR_IS_SORTED(Var, Func)   IS_SORTED (STRING_IN_VECTOR, Var, Func)
 STRING_IN_VECTOR_IS_SORTED. More...
 
#define SORT_STRING_IN_VECTOR(Var, Func)   DO_VECTOR_SORT (STRING_IN_VECTOR, Var, Func)
 SORT_STRING_IN_VECTOR. More...
 
#define STRING_IN_VECTOR_IS_UNIQUE(Var, Func)   IS_UNIQUE (STRING_IN_VECTOR, Var, Func)
 STRING_IN_VECTOR_IS_UNIQUE. More...
 
#define UNIQUE_STRING_IN_VECTOR(Var, Func)   DO_UNIQUE (STRING_IN_VECTOR, Var, Func)
 UNIQUE_STRING_IN_VECTOR. More...
 
#define CHAR_IN_STRING_Type   string
 <string> macros More...
 
#define CHAR_IN_STRING_Test(Var)   (! (Var).empty())
 
#define CHAR_IN_STRING_Get(Var)   (Var)
 
#define CHAR_IN_STRING_Set(Var)   (Var)
 
#define STRING_HAS_CHAR(Var)   ITEM_HAS (CHAR_IN_STRING, Var)
 STRING_HAS_CHAR. More...
 
#define FOR_EACH_CHAR_IN_STRING(Itr, Var)   FOR_EACH (CHAR_IN_STRING, Itr, Var)
 FOR_EACH_CHAR_IN_STRING EDIT_EACH_CHAR_IN_STRING. More...
 
#define EDIT_EACH_CHAR_IN_STRING(Itr, Var)   EDIT_EACH (CHAR_IN_STRING, Itr, Var)
 
#define ADD_CHAR_TO_STRING(Var, Ref)   ADD_ITEM (CHAR_IN_STRING, Var, Ref)
 ADD_CHAR_TO_STRING. More...
 
#define ERASE_CHAR_IN_STRING(Itr, Var)   LIST_ERASE_ITEM (CHAR_IN_STRING, Itr, Var)
 ERASE_CHAR_IN_STRING. More...
 
#define CHAR_IN_STRING_IS_SORTED(Var, Func)   IS_SORTED (CHAR_IN_STRING, Var, Func)
 CHAR_IN_STRING_IS_SORTED. More...
 
#define SORT_CHAR_IN_STRING(Var, Func)   DO_LIST_SORT (CHAR_IN_STRING, Var, Func)
 SORT_CHAR_IN_STRING. More...
 
#define CHAR_IN_STRING_IS_UNIQUE(Var, Func)   IS_UNIQUE (CHAR_IN_STRING, Var, Func)
 CHAR_IN_STRING_IS_UNIQUE. More...
 
#define UNIQUE_CHAR_IN_STRING(Var, Func)   DO_UNIQUE (CHAR_IN_STRING, Var, Func)
 UNIQUE_CHAR_IN_STRING. More...
 
#define CHAR_IN_STRING_IS_EMPTY(Var)    FIELD_IS_EMPTY(CHAR_IN_STRING, Var, Func)
 CHAR_IN_STRING_IS_EMPTY. More...
 
#define FIELD_IS(Var, Fld)    ((Var).Is##Fld())
 Generic FIELD macros. More...
 
#define FIELD_CHAIN_OF_2_IS(Var, Fld1, Fld2)
 FIELD_CHAIN_OF_2_IS base macro. More...
 
#define FIELD_IS_SET_AND_IS(Var, Fld, Chs)    ( (Var).IsSet##Fld() && (Var).Get##Fld().Is##Chs() )
 FIELD_IS_SET_AND_IS base macro. More...
 
#define FIELD_IS_AND_IS_SET(Var, Chs, Fld)    ( (Var).Is##Chs() && (Var).Get##Chs().IsSet##Fld() )
 FIELD_IS_AND_IS_SET base macro. More...
 
#define FIELD_IS_SET(Var, Fld)    ((Var).IsSet##Fld())
 FIELD_IS_SET base macro. More...
 
#define FIELD_CHAIN_OF_2_IS_SET(Var, Fld1, Fld2)
 FIELD_CHAIN_OF_2_IS_SET. More...
 
#define FIELD_CHAIN_OF_3_IS_SET(Var, Fld1, Fld2, Fld3)
 FIELD_CHAIN_OF_3_IS_SET. More...
 
#define FIELD_CHAIN_OF_4_IS_SET(Var, Fld1, Fld2, Fld3, Fld4)
 FIELD_CHAIN_OF_4_IS_SET. More...
 
#define FIELD_CHAIN_OF_5_IS_SET(Var, Fld1, Fld2, Fld3, Fld4, Fld5)
 FIELD_CHAIN_OF_5_IS_SET. More...
 
#define GET_FIELD(Var, Fld)    ((Var).Get##Fld())
 GET_FIELD base macro. More...
 
#define GET_FIELD_OR_DEFAULT(Var, Fld, Dflt)    ((Var).IsSet##Fld() ? (Var).Get##Fld() : Dflt )
 GET_FIELD_OR_DEFAULT base macro. More...
 
#define GET_FIELD_CHOICE_OR_DEFAULT(Var, Fld, Dflt)    ((Var).Is##Fld() ? (Var).Get##Fld() : Dflt )
 GET_FIELD_CHOICE_OR_DEFAULT base macro. More...
 
#define GET_MUTABLE(Var, Fld)    ((Var).Set##Fld())
 GET_MUTABLE base macro. More...
 
#define SET_FIELD(Var, Fld, Val)    ((Var).Set##Fld(Val))
 SET_FIELD base macro. More...
 
#define RESET_FIELD(Var, Fld)    ((Var).Reset##Fld())
 RESET_FIELD base macro. More...
 
#define STRING_FIELD_MATCH(Var, Fld, Str)    ((Var).IsSet##Fld() && NStr::EqualNocase((Var).Get##Fld(), Str))
 STRING_FIELD_MATCH base macro. More...
 
#define STRING_FIELD_MATCH_BUT_ONLY_CASE_INSENSITIVE(Var, Fld, Str)
 STRING_FIELD_MATCH_BUT_ONLY_CASE_INSENSITIVE base macro. More...
 
#define STRING_FIELD_CHOICE_MATCH(Var, Fld, Chs, Value)
 STRING_FIELD_CHOICE_MATCH base macro. More...
 
#define GET_STRING_FLD_OR_BLANK(Var, Fld)    ( (Var).IsSet##Fld() ? (Var).Get##Fld() : kEmptyStr )
 GET_STRING_FLD_OR_BLANK base macro. More...
 
#define STRING_FIELD_NOT_EMPTY(Var, Fld)    ( (Var).IsSet##Fld() && ! (Var).Get##Fld().empty() )
 STRING_FIELD_NOT_EMPTY base macro. More...
 
#define STRING_FIELD_APPEND(Var, Fld, Delim, Str)
 STRING_FIELD_APPEND base macro Appends Str to Var's Fld, putting Delim between if Fld was previously non-empty Nothing is done if Str is empty. More...
 
#define STRING_SET_MATCH(Var, Fld, Str)    ((Var).IsSet##Fld() && NStr::FindNoCase((Var).Get##Fld(), Str) != NULL)
 STRING_SET_MATCH base macro (for list or vectors) More...
 
#define FIELD_OUT_OF_RANGE(Var, Fld, Lower, Upper)    ( (Var).IsSet##Fld() && ( (Var).Get##Fld() < (Lower) || (Var).Get##Fld() > (Upper) ) )
 FIELD_OUT_OF_RANGE base macro. More...
 
#define FIELD_EQUALS(Var, Fld, Value)    ( (Var).IsSet##Fld() && (Var).Get##Fld() == (Value) )
 FIELD_EQUALS base macro. More...
 
#define FIELD_CHOICE_EQUALS(Var, Fld, Chs, Value)
 FIELD_CHOICE_EQUALS base macro. More...
 
#define FIELD_CHOICE_EMPTY(Var, Fld, Chs)
 
#define CALL_IF_SET(Func, Var, Fld)
 CALL_IF_SET base macro. More...
 
#define CALL_IF_SET_CHAIN_2(Func, Var, Fld1, Fld2)
 CALL_IF_SET_CHAIN_2 base macro. More...
 
#define CLONE_IF_SET_ELSE_RESET(DestVar, DestFld, SrcVar, SrcFld)
 CLONE_IF_SET base macro (Useful to copy and object from a variable of one type to a variable of another type) If SrcVar doesn't have SrcFld set, it's reset on the DestVar also. More...
 
#define ASSIGN_IF_SET_ELSE_RESET(DestVar, DestFld, SrcVar, SrcFld)
 ASSIGN_IF_SET_ELSE_RESET. More...
 
#define TEST_FIELD_CHOICE(Var, Fld, Chs)    ( (Var).IsSet##Fld() && (Var).Get##Fld().Which() == (Chs) )
 TEST_FIELD_CHOICE. More...
 
template<class Iter , class Comp >
bool seq_mac_is_sorted (Iter first, Iter last, Comp comp)
 
template<class Iterator , class Predicate >
bool seq_mac_is_unique (Iterator iter1, Iterator iter2, Predicate pred)
 

Detailed Description

Generic utility macros and templates for exploring NCBI objects.

Definition in file sequence_util_macros.hpp.

Macro Definition Documentation

◆ ADD_CHAR_TO_STRING

#define ADD_CHAR_TO_STRING (   Var,
  Ref 
)    ADD_ITEM (CHAR_IN_STRING, Var, Ref)

ADD_CHAR_TO_STRING.

Definition at line 434 of file sequence_util_macros.hpp.

◆ ADD_ITEM

#define ADD_ITEM (   Base,
  Var,
  Ref 
)    (Base##_Set(Var).push_back(Ref))

ADD_ITEM base macro.

Definition at line 94 of file sequence_util_macros.hpp.

◆ ADD_STRING_TO_LIST

#define ADD_STRING_TO_LIST (   Var,
  Ref 
)    ADD_ITEM (STRING_IN_LIST, Var, Ref)

ADD_STRING_TO_LIST.

Definition at line 322 of file sequence_util_macros.hpp.

◆ ADD_STRING_TO_VECTOR

#define ADD_STRING_TO_VECTOR (   Var,
  Ref 
)    ADD_ITEM (STRING_IN_VECTOR, Var, Ref)

ADD_STRING_TO_VECTOR.

Definition at line 378 of file sequence_util_macros.hpp.

◆ ASSIGN_IF_SET_ELSE_RESET

#define ASSIGN_IF_SET_ELSE_RESET (   DestVar,
  DestFld,
  SrcVar,
  SrcFld 
)
Value:
do { \
if( FIELD_IS_SET(SrcVar, SrcFld) ) { \
(DestVar).Set##DestFld( GET_FIELD(SrcVar, SrcFld) ); \
} else { \
(DestVar).Reset##DestFld(); \
} \
} while(0)
#define FIELD_IS_SET(Var, Fld)
FIELD_IS_SET base macro.
#define GET_FIELD(Var, Fld)
GET_FIELD base macro.

ASSIGN_IF_SET_ELSE_RESET.

Definition at line 666 of file sequence_util_macros.hpp.

◆ BEGIN_COMMA_END

#define BEGIN_COMMA_END (   container)     (container).begin(), (container).end()

Definition at line 278 of file sequence_util_macros.hpp.

◆ CALL_IF_SET

#define CALL_IF_SET (   Func,
  Var,
  Fld 
)
Value:
{ \
if( (Var).IsSet##Fld() ) { \
Func( GET_MUTABLE( (Var), Fld) ); \
} \
}
#define GET_MUTABLE(Var, Fld)
GET_MUTABLE base macro.

CALL_IF_SET base macro.

Definition at line 634 of file sequence_util_macros.hpp.

◆ CALL_IF_SET_CHAIN_2

#define CALL_IF_SET_CHAIN_2 (   Func,
  Var,
  Fld1,
  Fld2 
)
Value:
{ \
if( (Var).IsSet##Fld1() ) { \
CALL_IF_SET( Func, (Var).Set##Fld1(), Fld2 ); \
} \
}

CALL_IF_SET_CHAIN_2 base macro.

Definition at line 643 of file sequence_util_macros.hpp.

◆ CHAR_IN_STRING_Get

#define CHAR_IN_STRING_Get (   Var)    (Var)

Definition at line 414 of file sequence_util_macros.hpp.

◆ CHAR_IN_STRING_IS_EMPTY

#define CHAR_IN_STRING_IS_EMPTY (   Var)     FIELD_IS_EMPTY(CHAR_IN_STRING, Var, Func)

CHAR_IN_STRING_IS_EMPTY.

Definition at line 464 of file sequence_util_macros.hpp.

◆ CHAR_IN_STRING_IS_SORTED

#define CHAR_IN_STRING_IS_SORTED (   Var,
  Func 
)    IS_SORTED (CHAR_IN_STRING, Var, Func)

CHAR_IN_STRING_IS_SORTED.

Definition at line 444 of file sequence_util_macros.hpp.

◆ CHAR_IN_STRING_IS_UNIQUE

#define CHAR_IN_STRING_IS_UNIQUE (   Var,
  Func 
)    IS_UNIQUE (CHAR_IN_STRING, Var, Func)

CHAR_IN_STRING_IS_UNIQUE.

Definition at line 454 of file sequence_util_macros.hpp.

◆ CHAR_IN_STRING_Set

#define CHAR_IN_STRING_Set (   Var)    (Var)

Definition at line 415 of file sequence_util_macros.hpp.

◆ CHAR_IN_STRING_Test

#define CHAR_IN_STRING_Test (   Var)    (! (Var).empty())

Definition at line 413 of file sequence_util_macros.hpp.

◆ CHAR_IN_STRING_Type

#define CHAR_IN_STRING_Type   string

<string> macros

CHAR_IN_STRING macros

Definition at line 412 of file sequence_util_macros.hpp.

◆ CHOICE_IS

#define CHOICE_IS (   Base,
  Var,
  Chs 
)    (Base##_Test(Var) && Base##_Chs(Var) == Chs)

CHOICE_IS base macro.

Definition at line 157 of file sequence_util_macros.hpp.

◆ CLONE_IF_SET_ELSE_RESET

#define CLONE_IF_SET_ELSE_RESET (   DestVar,
  DestFld,
  SrcVar,
  SrcFld 
)
Value:
do { \
if( FIELD_IS_SET(SrcVar, SrcFld) ) { \
(DestVar).Set##DestFld( *SerialClone( GET_FIELD(SrcVar, SrcFld) ) ); \
} else { \
(DestVar).Reset##DestFld(); \
} \
} while(0)
C * SerialClone(const C &src)
Create on heap a clone of the source object.
Definition: serialbase.hpp:512

CLONE_IF_SET base macro (Useful to copy and object from a variable of one type to a variable of another type) If SrcVar doesn't have SrcFld set, it's reset on the DestVar also.

Definition at line 655 of file sequence_util_macros.hpp.

◆ DO_LIST_SORT

#define DO_LIST_SORT (   Base,
  Var,
  Func 
)    (Base##_Set(Var).sort (Func))

DO_LIST_SORT base macro.

Definition at line 213 of file sequence_util_macros.hpp.

◆ DO_LIST_SORT_HACK

#define DO_LIST_SORT_HACK (   Base,
  Var,
  Func 
)
Value:
do { \
vector< Base##_Type::value_type > vec; \
copy( Base##_Get(Var).begin(), Base##_Get(Var).end(), back_inserter(vec) ); \
stable_sort( vec.begin(), vec.end(), Func ); \
Base##_Set(Var).clear(); \
copy( vec.begin(), vec.end(), back_inserter(Base##_Set(Var)) ); \
} while(false)
constexpr auto begin(const ct_const_array< T, N > &in) noexcept
constexpr auto end(const ct_const_array< T, N > &in) noexcept

DO_LIST_SORT_HACK base macro.

Definition at line 230 of file sequence_util_macros.hpp.

◆ DO_UNIQUE

#define DO_UNIQUE (   Base,
  Var,
  Func 
)
Value:
{ \
Base##_Type::iterator it = unique (Base##_Set(Var).begin(), \
Base##_Set(Var).end(), \
Func); \
it = Base##_Set(Var).erase(it, Base##_Set(Var).end()); \
}

DO_UNIQUE base macro.

Definition at line 250 of file sequence_util_macros.hpp.

◆ DO_VECTOR_SORT

#define DO_VECTOR_SORT (   Base,
  Var,
  Func 
)
Value:
(stable_sort (Base##_Set(Var).begin(), \
Base##_Set(Var).end(), \
Func))

DO_VECTOR_SORT base macro.

Definition at line 218 of file sequence_util_macros.hpp.

◆ EDIT_EACH

#define EDIT_EACH (   Base,
  Itr,
  Var 
)    NCBI_NC_ITERATE (Base##_Test(Var), Base##_Type, Itr, Base##_Set(Var))

EDIT_EACH base macro calls NCBI_NC_ITERATE with generated components.

Definition at line 89 of file sequence_util_macros.hpp.

◆ EDIT_EACH_CHAR_IN_STRING

#define EDIT_EACH_CHAR_IN_STRING (   Itr,
  Var 
)    EDIT_EACH (CHAR_IN_STRING, Itr, Var)

Definition at line 429 of file sequence_util_macros.hpp.

◆ EDIT_EACH_STRING_IN_LIST

#define EDIT_EACH_STRING_IN_LIST (   Itr,
  Var 
)    EDIT_EACH (STRING_IN_LIST, Itr, Var)

Definition at line 317 of file sequence_util_macros.hpp.

◆ EDIT_EACH_STRING_IN_VECTOR

#define EDIT_EACH_STRING_IN_VECTOR (   Itr,
  Var 
)    EDIT_EACH (STRING_IN_VECTOR, Itr, Var)

Definition at line 373 of file sequence_util_macros.hpp.

◆ ERASE_CHAR_IN_STRING

#define ERASE_CHAR_IN_STRING (   Itr,
  Var 
)    LIST_ERASE_ITEM (CHAR_IN_STRING, Itr, Var)

ERASE_CHAR_IN_STRING.

Definition at line 439 of file sequence_util_macros.hpp.

◆ ERASE_STRING_IN_LIST

#define ERASE_STRING_IN_LIST (   Itr,
  Var 
)    LIST_ERASE_ITEM (STRING_IN_LIST, Itr, Var)

ERASE_STRING_IN_LIST.

Definition at line 327 of file sequence_util_macros.hpp.

◆ ERASE_STRING_IN_VECTOR

#define ERASE_STRING_IN_VECTOR (   Itr,
  Var 
)    VECTOR_ERASE_ITEM (STRING_IN_VECTOR, Itr, Var)

ERASE_STRING_IN_VECTOR.

Definition at line 383 of file sequence_util_macros.hpp.

◆ FIELD_CHAIN_OF_2_IS

#define FIELD_CHAIN_OF_2_IS (   Var,
  Fld1,
  Fld2 
)
Value:
( (Var).Is##Fld1() && \
(Var).Get##Fld1().Is##Fld2() )
const TYPE & Get(const CNamedParameterList *param)

FIELD_CHAIN_OF_2_IS base macro.

Definition at line 478 of file sequence_util_macros.hpp.

◆ FIELD_CHAIN_OF_2_IS_SET

#define FIELD_CHAIN_OF_2_IS_SET (   Var,
  Fld1,
  Fld2 
)
Value:
( (Var).IsSet##Fld1() && \
(Var).Get##Fld1().IsSet##Fld2() )

FIELD_CHAIN_OF_2_IS_SET.

Definition at line 499 of file sequence_util_macros.hpp.

◆ FIELD_CHAIN_OF_3_IS_SET

#define FIELD_CHAIN_OF_3_IS_SET (   Var,
  Fld1,
  Fld2,
  Fld3 
)
Value:
( (Var).IsSet##Fld1() && \
(Var).Get##Fld1().IsSet##Fld2() && \
(Var).Get##Fld1().Get##Fld2().IsSet##Fld3() )

FIELD_CHAIN_OF_3_IS_SET.

Definition at line 505 of file sequence_util_macros.hpp.

◆ FIELD_CHAIN_OF_4_IS_SET

#define FIELD_CHAIN_OF_4_IS_SET (   Var,
  Fld1,
  Fld2,
  Fld3,
  Fld4 
)
Value:
( (Var).IsSet##Fld1() && \
(Var).Get##Fld1().IsSet##Fld2() && \
(Var).Get##Fld1().Get##Fld2().IsSet##Fld3() && \
(Var).Get##Fld1().Get##Fld2().Get##Fld3().IsSet##Fld4() )

FIELD_CHAIN_OF_4_IS_SET.

Definition at line 512 of file sequence_util_macros.hpp.

◆ FIELD_CHAIN_OF_5_IS_SET

#define FIELD_CHAIN_OF_5_IS_SET (   Var,
  Fld1,
  Fld2,
  Fld3,
  Fld4,
  Fld5 
)
Value:
( (Var).IsSet##Fld1() && \
(Var).Get##Fld1().IsSet##Fld2() && \
(Var).Get##Fld1().Get##Fld2().IsSet##Fld3() && \
(Var).Get##Fld1().Get##Fld2().Get##Fld3().IsSet##Fld4() && \
(Var).Get##Fld1().Get##Fld2().Get##Fld3().Get##Fld4().IsSet##Fld5() )

FIELD_CHAIN_OF_5_IS_SET.

Definition at line 521 of file sequence_util_macros.hpp.

◆ FIELD_CHOICE_EMPTY

#define FIELD_CHOICE_EMPTY (   Var,
  Fld,
  Chs 
)
Value:
( ! (Var).IsSet##Fld() || ! (Var).Get##Fld().Is##Chs() || \
(Var).Get##Fld().Get##Chs().empty() )

Definition at line 628 of file sequence_util_macros.hpp.

◆ FIELD_CHOICE_EQUALS

#define FIELD_CHOICE_EQUALS (   Var,
  Fld,
  Chs,
  Value 
)
Value:
( (Var).IsSet##Fld() && (Var).Get##Fld().Is##Chs() && \
(Var).Get##Fld().Get##Chs() == (Value) )
GenericValue< UTF8<> > Value
GenericValue with UTF8 encoding.
Definition: document.h:2107

FIELD_CHOICE_EQUALS base macro.

Definition at line 624 of file sequence_util_macros.hpp.

◆ FIELD_EQUALS

#define FIELD_EQUALS (   Var,
  Fld,
  Value 
)     ( (Var).IsSet##Fld() && (Var).Get##Fld() == (Value) )

FIELD_EQUALS base macro.

Definition at line 619 of file sequence_util_macros.hpp.

◆ FIELD_IS

#define FIELD_IS (   Var,
  Fld 
)     ((Var).Is##Fld())

Generic FIELD macros.

FIELD_IS base macro

Definition at line 473 of file sequence_util_macros.hpp.

◆ FIELD_IS_AND_IS_SET

#define FIELD_IS_AND_IS_SET (   Var,
  Chs,
  Fld 
)     ( (Var).Is##Chs() && (Var).Get##Chs().IsSet##Fld() )

FIELD_IS_AND_IS_SET base macro.

Definition at line 489 of file sequence_util_macros.hpp.

◆ FIELD_IS_EMPTY

#define FIELD_IS_EMPTY (   Base,
  Var 
)     (Base##_Test(Var) && Base##_Get(Var).empty() )

FIELD_IS_EMPTY base macro.

Definition at line 114 of file sequence_util_macros.hpp.

◆ FIELD_IS_EMPTY_OR_UNSET

#define FIELD_IS_EMPTY_OR_UNSET (   Base,
  Var 
)     ( ! Base##_Test(Var) || Base##_Get(Var).empty() )

FIELD_IS_EMPTY_OR_UNSET base macro.

Definition at line 124 of file sequence_util_macros.hpp.

◆ FIELD_IS_SET

#define FIELD_IS_SET (   Var,
  Fld 
)     ((Var).IsSet##Fld())

FIELD_IS_SET base macro.

Definition at line 494 of file sequence_util_macros.hpp.

◆ FIELD_IS_SET_AND_IS

#define FIELD_IS_SET_AND_IS (   Var,
  Fld,
  Chs 
)     ( (Var).IsSet##Fld() && (Var).Get##Fld().Is##Chs() )

FIELD_IS_SET_AND_IS base macro.

Definition at line 484 of file sequence_util_macros.hpp.

◆ FIELD_OUT_OF_RANGE

#define FIELD_OUT_OF_RANGE (   Var,
  Fld,
  Lower,
  Upper 
)     ( (Var).IsSet##Fld() && ( (Var).Get##Fld() < (Lower) || (Var).Get##Fld() > (Upper) ) )

FIELD_OUT_OF_RANGE base macro.

Definition at line 614 of file sequence_util_macros.hpp.

◆ FOR_EACH

#define FOR_EACH (   Base,
  Itr,
  Var 
)    NCBI_CS_ITERATE (Base##_Test(Var), Base##_Type, Itr, Base##_Get(Var))

FOR_EACH base macro calls NCBI_CS_ITERATE with generated components.

Definition at line 84 of file sequence_util_macros.hpp.

◆ FOR_EACH_CHAR_IN_STRING

#define FOR_EACH_CHAR_IN_STRING (   Itr,
  Var 
)    FOR_EACH (CHAR_IN_STRING, Itr, Var)

FOR_EACH_CHAR_IN_STRING EDIT_EACH_CHAR_IN_STRING.

Definition at line 426 of file sequence_util_macros.hpp.

◆ FOR_EACH_STRING_IN_LIST

#define FOR_EACH_STRING_IN_LIST (   Itr,
  Var 
)    FOR_EACH (STRING_IN_LIST, Itr, Var)

FOR_EACH_STRING_IN_LIST EDIT_EACH_STRING_IN_LIST.

Definition at line 314 of file sequence_util_macros.hpp.

◆ FOR_EACH_STRING_IN_VECTOR

#define FOR_EACH_STRING_IN_VECTOR (   Itr,
  Var 
)    FOR_EACH (STRING_IN_VECTOR, Itr, Var)

FOR_EACH_STRING_IN_VECTOR EDIT_EACH_STRING_IN_VECTOR.

Definition at line 370 of file sequence_util_macros.hpp.

◆ GET_FIELD

#define GET_FIELD (   Var,
  Fld 
)     ((Var).Get##Fld())

GET_FIELD base macro.

Definition at line 530 of file sequence_util_macros.hpp.

◆ GET_FIELD_CHOICE_OR_DEFAULT

#define GET_FIELD_CHOICE_OR_DEFAULT (   Var,
  Fld,
  Dflt 
)     ((Var).Is##Fld() ? (Var).Get##Fld() : Dflt )

GET_FIELD_CHOICE_OR_DEFAULT base macro.

Definition at line 540 of file sequence_util_macros.hpp.

◆ GET_FIELD_OR_DEFAULT

#define GET_FIELD_OR_DEFAULT (   Var,
  Fld,
  Dflt 
)     ((Var).IsSet##Fld() ? (Var).Get##Fld() : Dflt )

GET_FIELD_OR_DEFAULT base macro.

Definition at line 535 of file sequence_util_macros.hpp.

◆ GET_MUTABLE

#define GET_MUTABLE (   Var,
  Fld 
)     ((Var).Set##Fld())

GET_MUTABLE base macro.

Definition at line 546 of file sequence_util_macros.hpp.

◆ GET_STRING_FLD_OR_BLANK

#define GET_STRING_FLD_OR_BLANK (   Var,
  Fld 
)     ( (Var).IsSet##Fld() ? (Var).Get##Fld() : kEmptyStr )

GET_STRING_FLD_OR_BLANK base macro.

Definition at line 580 of file sequence_util_macros.hpp.

◆ GET_STRING_OR_BLANK

#define GET_STRING_OR_BLANK (   Base,
  Var 
)     (Base##_Test(Var) ? Base##_Get(Var) : kEmptyStr )

GET_STRING_OR_BLANK base macro.

Definition at line 152 of file sequence_util_macros.hpp.

◆ IS_SORTED

#define IS_SORTED (   Base,
  Var,
  Func 
)
Value:
((! Base##_Test(Var)) || \
seq_mac_is_sorted (Base##_Set(Var).begin(), \
Base##_Set(Var).end(), \
Func))
bool seq_mac_is_sorted(Iter first, Iter last, Comp comp)

IS_SORTED base macro.

Definition at line 205 of file sequence_util_macros.hpp.

◆ IS_UNIQUE

#define IS_UNIQUE (   Base,
  Var,
  Func 
)
Value:
((! Base##_Test(Var)) || \
seq_mac_is_unique (Base##_Set(Var).begin(), \
Base##_Set(Var).end(), \
Func))
bool seq_mac_is_unique(Iterator iter1, Iterator iter2, Predicate pred)

IS_UNIQUE base macro.

Definition at line 242 of file sequence_util_macros.hpp.

◆ ITEM_HAS

#define ITEM_HAS (   Base,
  Var 
)    (Base##_Test(Var))

ITEM_HAS base macro.

Definition at line 109 of file sequence_util_macros.hpp.

◆ LIST_ERASE_ITEM

#define LIST_ERASE_ITEM (   Base,
  Itr,
  Var 
)    (Base##_Set(Var).erase(Itr))

LIST_ERASE_ITEM base macro.

Definition at line 99 of file sequence_util_macros.hpp.

◆ LIST_HAS_STRING

#define LIST_HAS_STRING (   Var)    ITEM_HAS (STRING_IN_LIST, Var)

LIST_HAS_STRING.

Definition at line 307 of file sequence_util_macros.hpp.

◆ NCBI_CS_ITERATE

#define NCBI_CS_ITERATE (   Test,
  Type,
  Var,
  Cont 
)    if (! (Test)) {} else ITERATE (Type, Var, Cont)

Macros to iterate over standard template containers (non-recursive)

NCBI_CS_ITERATE base macro tests to see if loop should be entered

Definition at line 66 of file sequence_util_macros.hpp.

◆ NCBI_NC_ITERATE

#define NCBI_NC_ITERATE (   Test,
  Type,
  Var,
  Cont 
)    if (! (Test)) {} else ERASE_ITERATE (Type, Var, Cont)

NCBI_NC_ITERATE base macro tests to see if loop should be entered.

Definition at line 72 of file sequence_util_macros.hpp.

◆ NCBI_SERIAL_NC_EXPLORE

#define NCBI_SERIAL_NC_EXPLORE (   Test,
  Type,
  Var,
  Cont 
)    if (! (Test)) {} else for (CTypeIterator<Type> Var (Cont); Var; ++Var)

Definition at line 54 of file sequence_util_macros.hpp.

◆ NCBI_SERIAL_TEST_EXPLORE

#define NCBI_SERIAL_TEST_EXPLORE (   Test,
  Type,
  Var,
  Cont 
)    if (! (Test)) {} else for (CTypeConstIterator<Type> Var (Cont); Var; ++Var)

@NAME Convenience macros for NCBI objects

NCBI_SERIAL_TEST_EXPLORE base macro tests to see if loop should be entered

Definition at line 51 of file sequence_util_macros.hpp.

◆ NCBI_SWITCH

#define NCBI_SWITCH (   Test,
  Chs 
)    if (! (Test)) {} else switch(Chs)

NCBI_SWITCH base macro tests to see if switch should be performed.

Definition at line 78 of file sequence_util_macros.hpp.

◆ RAW_FIELD_GET_SIZE_IF_SET

#define RAW_FIELD_GET_SIZE_IF_SET (   Var,
  Fld 
)     ( (Var).IsSet##Fld() ? (Var).Get##Fld().size() : 0 )

RAW_FIELD_GET_SIZE_IF_SET.

Definition at line 135 of file sequence_util_macros.hpp.

◆ RAW_FIELD_IS_EMPTY

#define RAW_FIELD_IS_EMPTY (   Var,
  Fld 
)     ( (Var).IsSet##Fld() && (Var).Get##Fld().empty() )

RAW_FIELD_IS_EMPTY base macro.

Definition at line 119 of file sequence_util_macros.hpp.

◆ RAW_FIELD_IS_EMPTY_OR_UNSET

#define RAW_FIELD_IS_EMPTY_OR_UNSET (   Var,
  Fld 
)     ( ! (Var).IsSet##Fld() || (Var).Get##Fld().empty() )

RAW_FIELD_IS_EMPTY_OR_UNSET macro.

Definition at line 129 of file sequence_util_macros.hpp.

◆ REMOVE_IF_EMPTY_FIELD

#define REMOVE_IF_EMPTY_FIELD (   Base,
  Var 
)     do { if( FIELD_IS_EMPTY(Base, Var) ) { Base##_Reset(Var); ChangeMade(CCleanupChange::eChangeQualifiers); } } while(false)

RESET_FIELD_IF_EMPTY base macro.

Definition at line 147 of file sequence_util_macros.hpp.

◆ RESET_FIELD

#define RESET_FIELD (   Var,
  Fld 
)     ((Var).Reset##Fld())

RESET_FIELD base macro.

Definition at line 556 of file sequence_util_macros.hpp.

◆ SET_FIELD

#define SET_FIELD (   Var,
  Fld,
  Val 
)     ((Var).Set##Fld(Val))

SET_FIELD base macro.

Definition at line 551 of file sequence_util_macros.hpp.

◆ SET_FIELD_IF_UNSET

#define SET_FIELD_IF_UNSET (   Var,
  Fld,
  Val 
)     do { if( ! (Var).IsSet##Fld() ) { (Var).Set##Fld(Val); ChangeMade(CCleanupChange::eChangeQualifiers); } } while(false)

SET_FIELD_IF_UNSET macro.

Definition at line 141 of file sequence_util_macros.hpp.

◆ SORT_CHAR_IN_STRING

#define SORT_CHAR_IN_STRING (   Var,
  Func 
)    DO_LIST_SORT (CHAR_IN_STRING, Var, Func)

SORT_CHAR_IN_STRING.

Definition at line 449 of file sequence_util_macros.hpp.

◆ SORT_STRING_IN_LIST

#define SORT_STRING_IN_LIST (   Var,
  Func 
)    DO_LIST_SORT (STRING_IN_LIST, Var, Func)

SORT_STRING_IN_LIST.

Definition at line 337 of file sequence_util_macros.hpp.

◆ SORT_STRING_IN_VECTOR

#define SORT_STRING_IN_VECTOR (   Var,
  Func 
)    DO_VECTOR_SORT (STRING_IN_VECTOR, Var, Func)

SORT_STRING_IN_VECTOR.

Definition at line 393 of file sequence_util_macros.hpp.

◆ STRING_FIELD_APPEND

#define STRING_FIELD_APPEND (   Var,
  Fld,
  Delim,
  Str 
)
Value:
do { \
const string sStr = (Str); \
if( ! sStr.empty() ) { \
if( ! (Var).IsSet##Fld() ) { \
(Var).Set##Fld(""); \
} \
string & field = (Var).Set##Fld(); \
if( ! field.empty() ) { \
field += (Delim); \
} \
field += sStr; \
} \
} while(false)

STRING_FIELD_APPEND base macro Appends Str to Var's Fld, putting Delim between if Fld was previously non-empty Nothing is done if Str is empty.

Definition at line 591 of file sequence_util_macros.hpp.

◆ STRING_FIELD_CHOICE_MATCH

#define STRING_FIELD_CHOICE_MATCH (   Var,
  Fld,
  Chs,
  Value 
)
Value:
( (Var).IsSet##Fld() && (Var).Get##Fld().Is##Chs() && \
NStr::EqualNocase((Var).Get##Fld().Get##Chs(), (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.
Definition: ncbistr.hpp:5353

STRING_FIELD_CHOICE_MATCH base macro.

Definition at line 573 of file sequence_util_macros.hpp.

◆ STRING_FIELD_MATCH

#define STRING_FIELD_MATCH (   Var,
  Fld,
  Str 
)     ((Var).IsSet##Fld() && NStr::EqualNocase((Var).Get##Fld(), Str))

STRING_FIELD_MATCH base macro.

Definition at line 562 of file sequence_util_macros.hpp.

◆ STRING_FIELD_MATCH_BUT_ONLY_CASE_INSENSITIVE

#define STRING_FIELD_MATCH_BUT_ONLY_CASE_INSENSITIVE (   Var,
  Fld,
  Str 
)
Value:
((Var).IsSet##Fld() && NStr::EqualNocase((Var).Get##Fld(), (Str)) && \
(Var).Get##Fld() != (Str) )

STRING_FIELD_MATCH_BUT_ONLY_CASE_INSENSITIVE base macro.

Definition at line 567 of file sequence_util_macros.hpp.

◆ STRING_FIELD_NOT_EMPTY

#define STRING_FIELD_NOT_EMPTY (   Var,
  Fld 
)     ( (Var).IsSet##Fld() && ! (Var).Get##Fld().empty() )

STRING_FIELD_NOT_EMPTY base macro.

Definition at line 585 of file sequence_util_macros.hpp.

◆ STRING_HAS_CHAR

#define STRING_HAS_CHAR (   Var)    ITEM_HAS (CHAR_IN_STRING, Var)

STRING_HAS_CHAR.

Definition at line 419 of file sequence_util_macros.hpp.

◆ STRING_IN_LIST_Get

#define STRING_IN_LIST_Get (   Var)    (Var)

Definition at line 302 of file sequence_util_macros.hpp.

◆ STRING_IN_LIST_IS_SORTED

#define STRING_IN_LIST_IS_SORTED (   Var,
  Func 
)    IS_SORTED (STRING_IN_LIST, Var, Func)

STRING_IN_LIST_IS_SORTED.

Definition at line 332 of file sequence_util_macros.hpp.

◆ STRING_IN_LIST_IS_UNIQUE

#define STRING_IN_LIST_IS_UNIQUE (   Var,
  Func 
)    IS_UNIQUE (STRING_IN_LIST, Var, Func)

STRING_IN_LIST_IS_UNIQUE.

Definition at line 342 of file sequence_util_macros.hpp.

◆ STRING_IN_LIST_Set

#define STRING_IN_LIST_Set (   Var)    (Var)

Definition at line 303 of file sequence_util_macros.hpp.

◆ STRING_IN_LIST_Test

#define STRING_IN_LIST_Test (   Var)    (! (Var).empty())

Definition at line 301 of file sequence_util_macros.hpp.

◆ STRING_IN_LIST_Type

#define STRING_IN_LIST_Type   list <string>

list <string> macros

STRING_IN_LIST macros

Definition at line 300 of file sequence_util_macros.hpp.

◆ STRING_IN_VECTOR_Get

#define STRING_IN_VECTOR_Get (   Var)    (Var)

Definition at line 358 of file sequence_util_macros.hpp.

◆ STRING_IN_VECTOR_IS_SORTED

#define STRING_IN_VECTOR_IS_SORTED (   Var,
  Func 
)    IS_SORTED (STRING_IN_VECTOR, Var, Func)

STRING_IN_VECTOR_IS_SORTED.

Definition at line 388 of file sequence_util_macros.hpp.

◆ STRING_IN_VECTOR_IS_UNIQUE

#define STRING_IN_VECTOR_IS_UNIQUE (   Var,
  Func 
)    IS_UNIQUE (STRING_IN_VECTOR, Var, Func)

STRING_IN_VECTOR_IS_UNIQUE.

Definition at line 398 of file sequence_util_macros.hpp.

◆ STRING_IN_VECTOR_Set

#define STRING_IN_VECTOR_Set (   Var)    (Var)

Definition at line 359 of file sequence_util_macros.hpp.

◆ STRING_IN_VECTOR_Test

#define STRING_IN_VECTOR_Test (   Var)    (! (Var).empty())

Definition at line 357 of file sequence_util_macros.hpp.

◆ STRING_IN_VECTOR_Type

#define STRING_IN_VECTOR_Type   vector <string>

vector <string> macros

STRING_IN_VECTOR macros

Definition at line 356 of file sequence_util_macros.hpp.

◆ STRING_SET_MATCH

#define STRING_SET_MATCH (   Var,
  Fld,
  Str 
)     ((Var).IsSet##Fld() && NStr::FindNoCase((Var).Get##Fld(), Str) != NULL)

STRING_SET_MATCH base macro (for list or vectors)

Definition at line 609 of file sequence_util_macros.hpp.

◆ SWITCH_ON

#define SWITCH_ON (   Base,
  Var 
)    NCBI_SWITCH (Base##_Test(Var), Base##_Chs(Var))

SWITCH_ON base macro calls NCBI_SWITCH with generated components.

Definition at line 163 of file sequence_util_macros.hpp.

◆ TEST_FIELD_CHOICE

#define TEST_FIELD_CHOICE (   Var,
  Fld,
  Chs 
)     ( (Var).IsSet##Fld() && (Var).Get##Fld().Which() == (Chs) )

TEST_FIELD_CHOICE.

Definition at line 677 of file sequence_util_macros.hpp.

◆ UNIQUE_CHAR_IN_STRING

#define UNIQUE_CHAR_IN_STRING (   Var,
  Func 
)    DO_UNIQUE (CHAR_IN_STRING, Var, Func)

UNIQUE_CHAR_IN_STRING.

Definition at line 459 of file sequence_util_macros.hpp.

◆ UNIQUE_STRING_IN_LIST

#define UNIQUE_STRING_IN_LIST (   Var,
  Func 
)    DO_UNIQUE (STRING_IN_LIST, Var, Func)

UNIQUE_STRING_IN_LIST.

Definition at line 347 of file sequence_util_macros.hpp.

◆ UNIQUE_STRING_IN_VECTOR

#define UNIQUE_STRING_IN_VECTOR (   Var,
  Func 
)    DO_UNIQUE (STRING_IN_VECTOR, Var, Func)

UNIQUE_STRING_IN_VECTOR.

Definition at line 403 of file sequence_util_macros.hpp.

◆ UNIQUE_WITHOUT_SORT

#define UNIQUE_WITHOUT_SORT (   Base,
  Var,
  FuncType,
  CleanupChangeType 
)
Value:
{ \
if( Base##_Test(Var) ) { \
set<Base##_Type::value_type, FuncType> valuesAlreadySeen; \
Base##_Type non_duplicate_items; \
FOR_EACH(Base, iter, Var ) { \
if( valuesAlreadySeen.find(*iter) == valuesAlreadySeen.end() ) { \
non_duplicate_items.push_back( *iter ); \
valuesAlreadySeen.insert( *iter ); \
} \
} \
if( Base##_Get(Var).size() != non_duplicate_items.size() ) { \
ChangeMade(CleanupChangeType); \
} \
Base##_Set(Var).swap( non_duplicate_items ); \
} \
}
const struct ncbi::grid::netcache::search::fields::SIZE size

Definition at line 259 of file sequence_util_macros.hpp.

◆ VECTOR_ERASE_ITEM

#define VECTOR_ERASE_ITEM (   Base,
  Itr,
  Var 
)    (VECTOR_ERASE (Itr, Base##_Set(Var)))

VECTOR_ERASE_ITEM base macro.

Definition at line 104 of file sequence_util_macros.hpp.

◆ VECTOR_HAS_STRING

#define VECTOR_HAS_STRING (   Var)    ITEM_HAS (STRING_IN_VECTOR, Var)

VECTOR_HAS_STRING.

Definition at line 363 of file sequence_util_macros.hpp.

Function Documentation

◆ seq_mac_is_sorted()

template<class Iter , class Comp >
bool seq_mac_is_sorted ( Iter  first,
Iter  last,
Comp  comp 
)

Definition at line 170 of file sequence_util_macros.hpp.

References first(), last(), and next().

Referenced by CorrectIntervalOrder(), and CCleanup::NormalizeDescriptorOrder().

◆ seq_mac_is_unique()

template<class Iterator , class Predicate >
bool seq_mac_is_unique ( Iterator  iter1,
Iterator  iter2,
Predicate  pred 
)
Modified on Wed Apr 24 14:19:06 2024 by modify_doxy.py rev. 669887