NCBI C++ ToolKit
|
Generic utility macros and templates for exploring NCBI objects. More...
#include <serial/iterator.hpp>
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) |
Generic utility macros and templates for exploring NCBI objects.
Definition in file sequence_util_macros.hpp.
ADD_CHAR_TO_STRING.
Definition at line 434 of file sequence_util_macros.hpp.
ADD_ITEM base macro.
Definition at line 94 of file sequence_util_macros.hpp.
ADD_STRING_TO_LIST.
Definition at line 322 of file sequence_util_macros.hpp.
ADD_STRING_TO_VECTOR.
Definition at line 378 of file sequence_util_macros.hpp.
#define ASSIGN_IF_SET_ELSE_RESET | ( | DestVar, | |
DestFld, | |||
SrcVar, | |||
SrcFld | |||
) |
ASSIGN_IF_SET_ELSE_RESET.
Definition at line 666 of file sequence_util_macros.hpp.
#define BEGIN_COMMA_END | ( | container | ) | (container).begin(), (container).end() |
Definition at line 278 of file sequence_util_macros.hpp.
#define CALL_IF_SET | ( | Func, | |
Var, | |||
Fld | |||
) |
CALL_IF_SET base macro.
Definition at line 634 of file sequence_util_macros.hpp.
#define CALL_IF_SET_CHAIN_2 | ( | Func, | |
Var, | |||
Fld1, | |||
Fld2 | |||
) |
CALL_IF_SET_CHAIN_2 base macro.
Definition at line 643 of file sequence_util_macros.hpp.
#define CHAR_IN_STRING_Get | ( | Var | ) | (Var) |
Definition at line 414 of file sequence_util_macros.hpp.
#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.
#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.
#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.
#define CHAR_IN_STRING_Set | ( | Var | ) | (Var) |
Definition at line 415 of file sequence_util_macros.hpp.
#define CHAR_IN_STRING_Test | ( | Var | ) | (! (Var).empty()) |
Definition at line 413 of file sequence_util_macros.hpp.
#define CHAR_IN_STRING_Type string |
#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.
#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.
Definition at line 655 of file sequence_util_macros.hpp.
#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.
#define DO_LIST_SORT_HACK | ( | Base, | |
Var, | |||
Func | |||
) |
DO_LIST_SORT_HACK base macro.
Definition at line 230 of file sequence_util_macros.hpp.
#define DO_UNIQUE | ( | Base, | |
Var, | |||
Func | |||
) |
DO_UNIQUE base macro.
Definition at line 250 of file sequence_util_macros.hpp.
#define DO_VECTOR_SORT | ( | Base, | |
Var, | |||
Func | |||
) |
DO_VECTOR_SORT base macro.
Definition at line 218 of file sequence_util_macros.hpp.
#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.
#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.
#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.
#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.
#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.
#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.
#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.
#define FIELD_CHAIN_OF_2_IS | ( | Var, | |
Fld1, | |||
Fld2 | |||
) |
FIELD_CHAIN_OF_2_IS base macro.
Definition at line 478 of file sequence_util_macros.hpp.
#define FIELD_CHAIN_OF_2_IS_SET | ( | Var, | |
Fld1, | |||
Fld2 | |||
) |
FIELD_CHAIN_OF_2_IS_SET.
Definition at line 499 of file sequence_util_macros.hpp.
#define FIELD_CHAIN_OF_3_IS_SET | ( | Var, | |
Fld1, | |||
Fld2, | |||
Fld3 | |||
) |
FIELD_CHAIN_OF_3_IS_SET.
Definition at line 505 of file sequence_util_macros.hpp.
#define FIELD_CHAIN_OF_4_IS_SET | ( | Var, | |
Fld1, | |||
Fld2, | |||
Fld3, | |||
Fld4 | |||
) |
FIELD_CHAIN_OF_4_IS_SET.
Definition at line 512 of file sequence_util_macros.hpp.
#define FIELD_CHAIN_OF_5_IS_SET | ( | Var, | |
Fld1, | |||
Fld2, | |||
Fld3, | |||
Fld4, | |||
Fld5 | |||
) |
FIELD_CHAIN_OF_5_IS_SET.
Definition at line 521 of file sequence_util_macros.hpp.
#define FIELD_CHOICE_EMPTY | ( | Var, | |
Fld, | |||
Chs | |||
) |
Definition at line 628 of file sequence_util_macros.hpp.
#define FIELD_CHOICE_EQUALS | ( | Var, | |
Fld, | |||
Chs, | |||
Value | |||
) |
FIELD_CHOICE_EQUALS base macro.
Definition at line 624 of file sequence_util_macros.hpp.
#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.
#define FIELD_IS | ( | Var, | |
Fld | |||
) | ((Var).Is##Fld()) |
#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.
#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.
#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.
#define FIELD_IS_SET | ( | Var, | |
Fld | |||
) | ((Var).IsSet##Fld()) |
FIELD_IS_SET base macro.
Definition at line 494 of file sequence_util_macros.hpp.
#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.
#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.
#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.
#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.
#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.
#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.
#define GET_FIELD | ( | Var, | |
Fld | |||
) | ((Var).Get##Fld()) |
GET_FIELD base macro.
Definition at line 530 of file sequence_util_macros.hpp.
#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.
#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.
#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 base macro.
Definition at line 580 of file sequence_util_macros.hpp.
#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.
#define IS_SORTED | ( | Base, | |
Var, | |||
Func | |||
) |
IS_SORTED base macro.
Definition at line 205 of file sequence_util_macros.hpp.
#define IS_UNIQUE | ( | Base, | |
Var, | |||
Func | |||
) |
IS_UNIQUE base macro.
Definition at line 242 of file sequence_util_macros.hpp.
#define ITEM_HAS | ( | Base, | |
Var | |||
) | (Base##_Test(Var)) |
ITEM_HAS base macro.
Definition at line 109 of file sequence_util_macros.hpp.
#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.
#define LIST_HAS_STRING | ( | Var | ) | ITEM_HAS (STRING_IN_LIST, Var) |
LIST_HAS_STRING.
Definition at line 307 of file sequence_util_macros.hpp.
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.
#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.
#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.
#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 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.
Definition at line 135 of file sequence_util_macros.hpp.
#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.
#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.
#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.
#define RESET_FIELD | ( | Var, | |
Fld | |||
) | ((Var).Reset##Fld()) |
RESET_FIELD base macro.
Definition at line 556 of file sequence_util_macros.hpp.
#define SET_FIELD | ( | Var, | |
Fld, | |||
Val | |||
) | ((Var).Set##Fld(Val)) |
SET_FIELD base macro.
Definition at line 551 of file sequence_util_macros.hpp.
#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.
#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.
#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.
#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.
#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.
Definition at line 591 of file sequence_util_macros.hpp.
#define STRING_FIELD_CHOICE_MATCH | ( | Var, | |
Fld, | |||
Chs, | |||
Value | |||
) |
STRING_FIELD_CHOICE_MATCH base macro.
Definition at line 573 of file sequence_util_macros.hpp.
#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.
#define STRING_FIELD_MATCH_BUT_ONLY_CASE_INSENSITIVE | ( | Var, | |
Fld, | |||
Str | |||
) |
STRING_FIELD_MATCH_BUT_ONLY_CASE_INSENSITIVE base macro.
Definition at line 567 of file sequence_util_macros.hpp.
#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.
#define STRING_HAS_CHAR | ( | Var | ) | ITEM_HAS (CHAR_IN_STRING, Var) |
STRING_HAS_CHAR.
Definition at line 419 of file sequence_util_macros.hpp.
#define STRING_IN_LIST_Get | ( | Var | ) | (Var) |
Definition at line 302 of file sequence_util_macros.hpp.
#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.
#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.
#define STRING_IN_LIST_Set | ( | Var | ) | (Var) |
Definition at line 303 of file sequence_util_macros.hpp.
#define STRING_IN_LIST_Test | ( | Var | ) | (! (Var).empty()) |
Definition at line 301 of file sequence_util_macros.hpp.
#define STRING_IN_LIST_Type list <string> |
#define STRING_IN_VECTOR_Get | ( | Var | ) | (Var) |
Definition at line 358 of file sequence_util_macros.hpp.
#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.
#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.
#define STRING_IN_VECTOR_Set | ( | Var | ) | (Var) |
Definition at line 359 of file sequence_util_macros.hpp.
#define STRING_IN_VECTOR_Test | ( | Var | ) | (! (Var).empty()) |
Definition at line 357 of file sequence_util_macros.hpp.
#define STRING_IN_VECTOR_Type vector <string> |
vector <string> macros
STRING_IN_VECTOR macros
Definition at line 356 of file sequence_util_macros.hpp.
#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.
#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.
#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.
#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.
#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.
#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.
#define UNIQUE_WITHOUT_SORT | ( | Base, | |
Var, | |||
FuncType, | |||
CleanupChangeType | |||
) |
Definition at line 259 of file sequence_util_macros.hpp.
#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.
#define VECTOR_HAS_STRING | ( | Var | ) | ITEM_HAS (STRING_IN_VECTOR, Var) |
VECTOR_HAS_STRING.
Definition at line 363 of file sequence_util_macros.hpp.
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().
bool seq_mac_is_unique | ( | Iterator | iter1, |
Iterator | iter2, | ||
Predicate | pred | ||
) |
Definition at line 188 of file sequence_util_macros.hpp.
References prev().
Referenced by CPCRSetList::AreSetsUnique(), and CValidError_bioseq::ValidateSeqFeatContext().