NCBI C++ ToolKit
|
Useful/utility classes and methods. More...
Go to the source code of this file.
Go to the SVN repository for this file.
Classes | |
struct | p_equal_to< T > |
Check for equality of objects pointed to by pointer. More... | |
struct | PPtrLess< T > |
Compare objects pointed to by (smart) pointer. More... | |
struct | pair_equal_to< Pair > |
Check whether a pair's second element matches a given value. More... | |
struct | CNameGetter< Value > |
Get name attribute for Value object. More... | |
class | CBestChoiceTracker< T, F > |
Tracks the best score (lowest value). More... | |
Functions | |
template<class X > | |
X * | NotNull (X *object) |
Check for not null value (after C malloc, strdup etc.). More... | |
template<class Key , class Element > | |
Element | GetMapElement (const map< Key, Element > &m, const Key &key, const Element &def=0) |
Get map element (pointer) or NULL if absent. More... | |
template<class Key , class Element > | |
void | SetMapElement (map< Key, Element * > &m, const Key &key, Element *data) |
Set map element – if data is null, erase the existing key. More... | |
template<class Key , class Element > | |
bool | InsertMapElement (map< Key, Element * > &m, const Key &key, Element *data) |
Insert map element. More... | |
template<class Key > | |
string | GetMapString (const map< Key, string > &m, const Key &key) |
Get string map element or "" if absent. More... | |
template<class Key > | |
void | SetMapString (map< Key, string > &m, const Key &key, const string &data) |
Set string map element – if data is null erase the existing key. More... | |
template<class Cnt > | |
void | DeleteElements (Cnt &cnt) |
Delete all elements from a container of pointers (list, vector, set, multiset); clear the container afterwards. More... | |
template<class Key , class Element > | |
void | DeleteElements (map< Key, Element * > &m) |
Delete all elements from map containing pointers; clear container afterwards. More... | |
template<class Key , class Element > | |
void | DeleteElements (multimap< Key, Element * > &m) |
Delete all elements from multimap containing pointers; clear container afterwards. More... | |
template<class Result , class Source , class ToKey > | |
Result & | AutoMap (unique_ptr< Result > &cache, const Source &source, const ToKey &toKey) |
Retrieve the result from the result cache - if cache is empty, insert into cache from the supplied source. More... | |
template<typename C , typename F > | |
C::value_type | FindBestChoice (const C &container, F score_func) |
Find the best choice (lowest score) for values in a container. More... | |
template<class Iterator > | |
BEGIN_STD_SCOPE bool | is_sorted (Iterator iter1, Iterator iter2) |
is_sorted is provided by some implementations of the STL and may be included in future releases of all standard-conforming implementations This is provided here for future compatibility More... | |
template<class Iterator , class Predicate > | |
bool | is_sorted (Iterator iter1, Iterator iter2, Predicate pred) |
Useful/utility classes and methods.
Definition in file ncbiutil.hpp.