NCBI C++ ToolKit
Classes | Macros | Enumerations | Functions | Variables
static_set.hpp File Reference
#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>
+ Include dependency graph for static_set.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.

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 >
IObjectConverterMakeConverter (DstType *, SrcType *)
 
template<typename DstType , typename SrcType >
IObjectConverterMakePairConverter (DstType *, SrcType *)
 
template<typename DstType1 , typename DstType2 , typename SrcType1 , typename SrcType2 >
IObjectConverterMakeConverter (pair< DstType1, DstType2 > *dst_ptr, pair< SrcType1, SrcType2 > *src_ptr)
 
template<typename DstType1 , typename DstType2 , typename SrcType1 , typename SrcType2 >
IObjectConverterMakeConverter (pair< DstType1, DstType2 > *dst_ptr, SStaticPair< SrcType1, SrcType2 > *src_ptr)
 
template<typename DstType1 , typename DstType2 , typename SrcType1 , typename SrcType2 >
IObjectConverterMakeConverter (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
 

Macro Definition Documentation

◆ DECLARE_CLASS_STATIC_ARRAY_MAP

#define DECLARE_CLASS_STATIC_ARRAY_MAP (   Type,
  Var 
)     static const Type Var

Definition at line 885 of file static_set.hpp.

◆ DEFINE_CLASS_STATIC_ARRAY_MAP

#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_CLASS_STATIC_ARRAY_MAP_WITH_COPY

#define DEFINE_CLASS_STATIC_ARRAY_MAP_WITH_COPY (   Type,
  Var,
  Array 
)
Value:
const Type (Var)((Array), sizeof(Array), __FILE__, __LINE__, \
@ eCopyWarn_hide
Definition: static_set.hpp:185
#define Type

Definition at line 898 of file static_set.hpp.

◆ DEFINE_STATIC_ARRAY_MAP

#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_STATIC_ARRAY_MAP_WITH_COPY

#define DEFINE_STATIC_ARRAY_MAP_WITH_COPY (   Type,
  Var,
  Array 
)
Value:
static const Type (Var)((Array), sizeof(Array), __FILE__, __LINE__, \

Definition at line 894 of file static_set.hpp.

Enumeration Type Documentation

◆ ECopyWarn

enum ECopyWarn
Enumerator
eCopyWarn_default 
eCopyWarn_show 
eCopyWarn_hide 

Definition at line 182 of file static_set.hpp.

Function Documentation

◆ BEGIN_NAMESPACE()

BEGIN_NAMESPACE ( NStaticArray  )

Namespace for static array templates' implementation.

◆ CheckStaticType() [1/5]

template<typename Type >
void CheckStaticType ( const char *  file,
int  line 
)
inline

Definition at line 506 of file static_set.hpp.

References CheckStaticType(), file, and Type.

◆ CheckStaticType() [2/5]

template<typename Type1 , typename Type2 >
void CheckStaticType ( const pair< Type1, Type2 > *  type_ptr,
const char *  file,
int  line 
)
inline

Definition at line 480 of file static_set.hpp.

References CheckStaticType(), file, and ReportUnsafeStaticType().

◆ CheckStaticType() [3/5]

template<typename Type1 , typename Type2 >
void CheckStaticType ( const SStaticPair< Type1, Type2 > *  type_ptr,
const char *  file,
int  line 
)
inline

Definition at line 494 of file static_set.hpp.

References CheckStaticType(), and file.

◆ CheckStaticType() [4/5]

void CheckStaticType ( const string ,
const char *  file,
int  line 
)
inline

Definition at line 469 of file static_set.hpp.

References file, and ReportUnsafeStaticType().

◆ CheckStaticType() [5/5]

template<typename Type >
void CheckStaticType ( const Type ,
const char *  ,
int   
)
inline

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()

END_NAMESPACE ( NStaticArray  )

◆ MakeConverter() [1/4]

template<typename DstType , typename SrcType >
IObjectConverter* MakeConverter ( DstType *  ,
SrcType *   
)
inline

◆ MakeConverter() [2/4]

template<typename DstType1 , typename DstType2 , typename SrcType1 , typename SrcType2 >
IObjectConverter* MakeConverter ( pair< DstType1, DstType2 > *  dst_ptr,
pair< SrcType1, SrcType2 > *  src_ptr 
)
inline

Definition at line 347 of file static_set.hpp.

References MakePairConverter().

◆ MakeConverter() [3/4]

template<typename DstType1 , typename DstType2 , typename SrcType1 , typename SrcType2 >
IObjectConverter* MakeConverter ( pair< DstType1, DstType2 > *  dst_ptr,
SStaticPair< SrcType1, SrcType2 > *  src_ptr 
)
inline

Definition at line 357 of file static_set.hpp.

References MakePairConverter().

◆ MakeConverter() [4/4]

template<typename DstType1 , typename DstType2 , typename SrcType1 , typename SrcType2 >
IObjectConverter* MakeConverter ( SStaticPair< DstType1, DstType2 > *  dst_ptr,
SStaticPair< SrcType1, SrcType2 > *  src_ptr 
)
inline

Definition at line 367 of file static_set.hpp.

References MakePairConverter().

◆ MakePairConverter()

template<typename DstType , typename SrcType >
IObjectConverter * MakePairConverter ( DstType *  ,
SrcType *   
)
inline

Definition at line 419 of file static_set.hpp.

Referenced by MakeConverter().

◆ NCBI_PARAM_TYPE() [1/2]

typedef NCBI_PARAM_TYPE ( NCBI  ,
STATIC_ARRAY_COPY_WARNING   
)

◆ NCBI_PARAM_TYPE() [2/2]

typedef NCBI_PARAM_TYPE ( NCBI  ,
STATIC_ARRAY_UNSAFE_TYPE_WARNING   
)

◆ ReportIncorrectOrder()

void ReportIncorrectOrder ( size_t  curr_index,
const char *  file,
int  line 
)

◆ ReportUnsafeStaticType()

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.

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().

Variable Documentation

◆ bool

bool

Definition at line 72 of file static_set.hpp.

◆ NCBI

NCBI

◆ NCBI_XUTIL_EXPORT

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".

Examples
/home/coremake/doxygen/cxx/include/util/scheduler.hpp.

Definition at line 72 of file static_set.hpp.

◆ STATIC_ARRAY_COPY_WARNING

STATIC_ARRAY_COPY_WARNING

Definition at line 72 of file static_set.hpp.

◆ STATIC_ARRAY_UNSAFE_TYPE_WARNING

STATIC_ARRAY_UNSAFE_TYPE_WARNING

Definition at line 78 of file static_set.hpp.

Modified on Fri Sep 20 14:57:57 2024 by modify_doxy.py rev. 669887