NCBI C++ ToolKit
|
#include <util/error_codes.hpp>
#include <corelib/ncbistd.hpp>
#include <corelib/ncbimtx.hpp>
#include <corelib/ncbi_param.hpp>
#include <utility>
#include <typeinfo>
#include <algorithm>
#include <functional>
Go to the source code of this file.
Go to the SVN repository for this file.
Classes | |
struct | SStaticPair< FirstType, SecondType > |
Template structure SStaticPair is simlified replacement of STL pair<> Main reason of introducing this structure is o allow static initialization by { xxx } construct. More... | |
struct | PLessByKey< KeyValueGetter, KeyCompare > |
class | PKeyValueSelf< Value > |
class | PKeyValuePair< Value > |
class | IObjectConverter |
Helper class for single object conversion from static type to work type. More... | |
class | CArrayHolder |
Helper class for holding and correct destruction of static array copy. More... | |
class | CObjectDestroyerGuard |
Helper class for destruction of field 'first' in pair<> if exception is thrown while constructing 'second'. More... | |
class | CObjectConverterBase< DstType, SrcType > |
class | CSimpleConverter< DstType, SrcType > |
Implementation of converter for a single-object conversion. More... | |
class | CPairConverter< DstType, SrcType > |
Implementation of converter for pair<> conversion. More... | |
class | CStaticArraySearchBase< KeyValueGetter, KeyCompare > |
class CStaticArraySet<> is an array adaptor that provides an STLish interface to statically-defined arrays, while making efficient use of the inherent sort order of such arrays. More... | |
class | CStaticArraySet< KeyType, KeyCompare > |
Macros | |
#define | DECLARE_CLASS_STATIC_ARRAY_MAP(Type, Var) static const Type Var |
#define | DEFINE_STATIC_ARRAY_MAP(Type, Var, Array) static const Type (Var)((Array), sizeof(Array), __FILE__, __LINE__) |
#define | DEFINE_CLASS_STATIC_ARRAY_MAP(Type, Var, Array) const Type (Var)((Array), sizeof(Array), __FILE__, __LINE__) |
#define | DEFINE_STATIC_ARRAY_MAP_WITH_COPY(Type, Var, Array) |
#define | DEFINE_CLASS_STATIC_ARRAY_MAP_WITH_COPY(Type, Var, Array) |
Enumerations | |
enum | ECopyWarn { eCopyWarn_default , eCopyWarn_show , eCopyWarn_hide } |
Functions | |
typedef | NCBI_PARAM_TYPE (NCBI, STATIC_ARRAY_COPY_WARNING) TParamStaticArrayCopyWarning |
typedef | NCBI_PARAM_TYPE (NCBI, STATIC_ARRAY_UNSAFE_TYPE_WARNING) TParamStaticArrayUnsafeTypeWarning |
BEGIN_NAMESPACE (NStaticArray) | |
Namespace for static array templates' implementation. More... | |
template<typename DstType , typename SrcType > | |
IObjectConverter * | MakeConverter (DstType *, SrcType *) |
template<typename DstType , typename SrcType > | |
IObjectConverter * | MakePairConverter (DstType *, SrcType *) |
template<typename DstType1 , typename DstType2 , typename SrcType1 , typename SrcType2 > | |
IObjectConverter * | MakeConverter (pair< DstType1, DstType2 > *dst_ptr, pair< SrcType1, SrcType2 > *src_ptr) |
template<typename DstType1 , typename DstType2 , typename SrcType1 , typename SrcType2 > | |
IObjectConverter * | MakeConverter (pair< DstType1, DstType2 > *dst_ptr, SStaticPair< SrcType1, SrcType2 > *src_ptr) |
template<typename DstType1 , typename DstType2 , typename SrcType1 , typename SrcType2 > | |
IObjectConverter * | MakeConverter (SStaticPair< DstType1, DstType2 > *dst_ptr, SStaticPair< SrcType1, SrcType2 > *src_ptr) |
void | ReportUnsafeStaticType (const char *type_name, const char *file, int line) |
Log error message about non-MT-safe static type (string, pair<>) if it's configured by TParamStaticArrayUnsafeTypeWarning parameter. More... | |
void | ReportIncorrectOrder (size_t curr_index, const char *file, int line) |
Log error message about wrong order of elements in array and abort. More... | |
template<typename Type > | |
void | CheckStaticType (const Type *, const char *, int) |
Template for checking if the static array type is MT-safe, i.e. More... | |
template<typename Type1 , typename Type2 > | |
void | CheckStaticType (const pair< Type1, Type2 > *type_ptr, const char *file, int line) |
template<typename Type1 , typename Type2 > | |
void | CheckStaticType (const SStaticPair< Type1, Type2 > *type_ptr, const char *file, int line) |
void | CheckStaticType (const string *, const char *file, int line) |
template<typename Type > | |
void | CheckStaticType (const char *file, int line) |
END_NAMESPACE (NStaticArray) | |
Variables | |
NCBI_XUTIL_EXPORT | |
Parameter to control printing diagnostic message about conversion of static array data from a different type. More... | |
bool | |
NCBI | |
STATIC_ARRAY_COPY_WARNING | |
STATIC_ARRAY_UNSAFE_TYPE_WARNING | |
Definition at line 885 of file static_set.hpp.
#define DEFINE_CLASS_STATIC_ARRAY_MAP | ( | Type, | |
Var, | |||
Array | |||
) | const Type (Var)((Array), sizeof(Array), __FILE__, __LINE__) |
Definition at line 891 of file static_set.hpp.
#define DEFINE_CLASS_STATIC_ARRAY_MAP_WITH_COPY | ( | Type, | |
Var, | |||
Array | |||
) |
Definition at line 898 of file static_set.hpp.
#define DEFINE_STATIC_ARRAY_MAP | ( | Type, | |
Var, | |||
Array | |||
) | static const Type (Var)((Array), sizeof(Array), __FILE__, __LINE__) |
Definition at line 888 of file static_set.hpp.
#define DEFINE_STATIC_ARRAY_MAP_WITH_COPY | ( | Type, | |
Var, | |||
Array | |||
) |
Definition at line 894 of file static_set.hpp.
enum ECopyWarn |
Enumerator | |
---|---|
eCopyWarn_default | |
eCopyWarn_show | |
eCopyWarn_hide |
Definition at line 182 of file static_set.hpp.
BEGIN_NAMESPACE | ( | NStaticArray | ) |
Namespace for static array templates' implementation.
Definition at line 506 of file static_set.hpp.
References CheckStaticType(), file, and Type.
|
inline |
Definition at line 480 of file static_set.hpp.
References CheckStaticType(), file, and ReportUnsafeStaticType().
|
inline |
Definition at line 494 of file static_set.hpp.
References CheckStaticType(), and file.
Definition at line 469 of file static_set.hpp.
References file, and ReportUnsafeStaticType().
Template for checking if the static array type is MT-safe, i.e.
doesn't have a constructor. Only few standard types are detected - std::string, and std::pair<>.
Definition at line 446 of file static_set.hpp.
Referenced by CheckStaticType().
END_NAMESPACE | ( | NStaticArray | ) |
|
inline |
Definition at line 332 of file static_set.hpp.
Referenced by CPairConverter< DstType, SrcType >::Convert(), and CStaticArraySearchBase< NStaticArray::PKeyValuePair< SStaticPair< KeyType, ValueType > >, less< KeyType > >::x_Set().
|
inline |
Definition at line 347 of file static_set.hpp.
References MakePairConverter().
|
inline |
Definition at line 357 of file static_set.hpp.
References MakePairConverter().
|
inline |
Definition at line 367 of file static_set.hpp.
References MakePairConverter().
|
inline |
Definition at line 419 of file static_set.hpp.
Referenced by MakeConverter().
typedef NCBI_PARAM_TYPE | ( | NCBI | , |
STATIC_ARRAY_COPY_WARNING | |||
) |
typedef NCBI_PARAM_TYPE | ( | NCBI | , |
STATIC_ARRAY_UNSAFE_TYPE_WARNING | |||
) |
Log error message about wrong order of elements in array and abort.
Definition at line 142 of file static_set.cpp.
References eDiag_Fatal, eDPF_Default, eDPF_File, eDPF_Line, eDPF_LongFilename, ErrCode, file, CNcbiDiag::GetRef(), NCBI_CURRENT_FUNCTION, NCBI_ERRCODE_X_NAME, NCBI_MAKE_MODULE, and NCBI_MODULE.
Referenced by CStaticArraySearchBase< NStaticArray::PKeyValuePair< SStaticPair< KeyType, ValueType > >, less< KeyType > >::x_Validate().
Log error message about non-MT-safe static type (string, pair<>) if it's configured by TParamStaticArrayUnsafeTypeWarning parameter.
Definition at line 118 of file static_set.cpp.
References eDiag_Warning, eDPF_Default, eDPF_File, eDPF_Line, eDPF_LongFilename, ErrCode, file, CNcbiDiag::GetRef(), NCBI_CURRENT_FUNCTION, NCBI_ERRCODE_X_NAME, NCBI_MAKE_MODULE, NCBI_MODULE, and type_name().
Referenced by CheckStaticType().
bool |
Definition at line 72 of file static_set.hpp.
NCBI |
Definition at line 72 of file static_set.hpp.
Referenced by CId1Reader::CId1Reader(), CId2Reader::CId2Reader(), CNcbiApplogApp::Cmd_Health(), CDir::Copy(), CUnicodeToAsciiTranslation::CUnicodeToAsciiTranslation(), CDir::GetAppTmpDir(), CNcbiApplogApp::Redirect(), CDirEntry::RemoveEntry(), CNcbiApplogApp::Run(), s_DirCreate(), CFileAPI::SetDeleteReadOnlyFiles(), CFileAPI::SetHonorUmask(), CFileAPI::SetLogging(), CObjectException::x_InitErrCode(), and CNcbiApplicationAPI::x_TryInit().
NCBI_XUTIL_EXPORT |
Parameter to control printing diagnostic message about conversion of static array data from a different type.
Parameter to control printing diagnostic message about unsafe static type.
Default value is "off".
Default value is "on".
Definition at line 72 of file static_set.hpp.
STATIC_ARRAY_COPY_WARNING |
Definition at line 72 of file static_set.hpp.
STATIC_ARRAY_UNSAFE_TYPE_WARNING |
Definition at line 78 of file static_set.hpp.