A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/ncbi__param__impl_8hpp_source.html below:

NCBI C++ ToolKit: include/corelib/impl/ncbi_param_impl.hpp Source File

1 #ifndef CORELIB___NCBI_PARAM_IMPL__HPP 2 #define CORELIB___NCBI_PARAM_IMPL__HPP 49 template

<

class

TValue>

72  operator

TValue& (void)

130  operator string

&(void)

141 template

<

class

TValue>

161 template

<

class

TValue>

170 template

<

class

TValue>

201 template

<

class

TEnum,

class

TParam>

218 template

<

class

TValue>

227 template

<

class

TDescription,

class

TParam>

240  "Can not initialize parameter from string: "

+

str

);

247 template

<

class

TDescription,

class

TParam>

333 template

<

class

TEnum,

class

TParam>

341  return

descr.

enums

[

i

].value;

346  "Can not initialize enum from string: "

+

str

);

353 template

<

class

TEnum,

class

TParam>

374 template

<

class

TDescription>

377

: m_ValueSet(

false

)

389 template

<

class

TDescription>

393  return

s_ParamValueLock;

397 template

<

class

TDescription>

401  bool

& def_init = TDescription::sm_DefaultInitialized;

402  _ASSERT

(TDescription::sm_ParamDescription.section);

404

TDescription::sm_Default = TDescription::sm_ParamDescription.default_value;

406

sx_GetSource() = eSource_Default;

410

TDescription::sm_Default = TDescription::sm_ParamDescription.default_value;

411

sx_GetState() = eState_NotSet;

412

sx_GetSource() = eSource_Default;

415  if

(sx_GetState() < eState_Func) {

416  _ASSERT

(sx_GetState() != eState_InFunc);

417  if

(sx_GetState() == eState_InFunc) {

420  "Recursion detected during CParam initialization."

);

422  if

( TDescription::sm_ParamDescription.init_func ) {

424

sx_GetState() = eState_InFunc;

426

TDescription::sm_Default = TParamParser::StringToValue(

427

TDescription::sm_ParamDescription.init_func(),

428

TDescription::sm_ParamDescription);

429

sx_GetSource() = eSource_Func;

432

sx_GetState() = eState_Error;

436

sx_GetState() = eState_Func;

439  if

(sx_GetState() < eState_Config) {

442  state

= eState_Config;

446  string

config_value =

448

TDescription::sm_ParamDescription.name,

449

TDescription::sm_ParamDescription.env_var_name,

452  if

( !config_value.empty() ) {

454

TDescription::sm_Default = TParamParser::StringToValue(config_value,

455

TDescription::sm_ParamDescription);

459

sx_GetState() = eState_Error;

460  ERR_POST

(

"Error reading CParam value "

<<

461

TDescription::sm_ParamDescription.section <<

"/"

<< TDescription::sm_ParamDescription.name);

467

? eState_Config : eState_EnvVar;

471  return

TDescription::sm_Default;

475 template

<

class

TDescription>

479  return

TDescription::sm_ValueTls;

483 template

<

class

TDescription>

487  return

TDescription::sm_State;

491 template

<

class

TDescription>

495  return

TDescription::sm_Source;

499 template

<

class

TDescription>

503  return

(TDescription::sm_ParamDescription.

flags

& flag) != 0;

507 template

<

class

TDescription>

513  if

(sourcing_complete) {

514

*sourcing_complete =

state

== eState_Config;

517

*param_source = sx_GetSource();

523 template

<

class

TDescription>

529  return

sx_GetDefault();

533 template

<

class

TDescription>

538

sx_GetDefault() =

val

;

540  if

(

state

< eState_User) {

543

sx_GetSource() = eSource_User;

547 template

<

class

TDescription>

552

sx_GetDefault(

true

);

556 template

<

class

TDescription>

571 template

<

class

TDescription>

577  "The parameter does not allow thread-local values"

);

579  TTls

& tls = sx_GetTls();

580

tls.SetValue(

new TValueType

(

val

), g_ParamTlsValueCleanup<TValueType>);

584 template

<

class

TDescription>

591

sx_GetTls().SetValue(

NULL

);

595 template

<

class

TDescription>

603 template

<

class

TDescription>

614

m_Value = GetThreadDefault();

615  if

(GetState() >= eState_Config) {

626 template

<

class

TDescription>

635 template

<

class

TDescription>

SParamEnumDescription< TEnum > TParamDesc

static TEnumType StringToEnum(const string &str, const TParamDesc &descr)

static string EnumToString(const TEnumType &val, const TParamDesc &descr)

SEnumDescription< TEnum > TEnumDesc

static CNcbiApplication * Instance(void)

Singleton method.

CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:

CSafeStatic< string > m_Value

CSafeStatic_Proxy & operator=(const string &value)

CSafeStatic_Proxy & operator=(const CSafeStatic_Proxy &proxy)

CSafeStatic_Proxy(const char *value)

CSafeStatic_Proxy(const CSafeStatic_Proxy &proxy)

CSafeStatic_Proxy & operator=(const char *value)

CSafeStatic_Proxy(const string &value)

CSafeStatic_Proxy(TValue value)

enable_if< std::is_scalar< TValue >::value, TValue >::type TStaticInit

CSafeStatic_Proxy & operator=(TValue value)

static const char * str(char *buf, int n)

static CNcbiApplicationGuard InstanceGuard(void)

Singleton method.

bool FinishedLoadingConfig(void) const

Check if the application has finished loading config file (successfully or not).

#define ERR_POST(message)

Error posting with file, line number information but without error codes.

#define NCBI_THROW(exception_class, err_code, message)

Generic macro to throw an exception, given the exception class, error code and message string.

static void ResetDefault(void)

Reload the global default value from the environment/registry or reset it to the initial value specif...

void Reset(void)

Reset value as if it has not been initialized yet.

EParamState

Current param state flag - indicates which possible sources for the param have been checked.

static EParamState GetState(bool *sourcing_complete=nullptr, EParamSource *param_source=nullptr)

Get current state of the param.

static void SetThreadDefault(const TValueType &val)

Set new thread-local default value.

static bool sx_IsSetFlag(ENcbiParamFlags flag)

TParamDescription::TValueType TValueType

void Set(const TValueType &val)

Set new parameter value (this instance only).

static TValueType GetThreadDefault(void)

Get thread-local default value if set or global default value.

static bool sx_CanGetDefault(void)

EParamCacheFlag

Caching default value on construction of a param.

static SSystemMutex & s_GetLock(void)

static TTls & sx_GetTls(void)

static string ValueToString(const TValueType &val, const TParamDesc &descr)

static EParamSource & sx_GetSource(void)

TValueType Get(void) const

Get current parameter value.

ENcbiParamFlags

ENcbiParamFlags.

TDescription::TValueType TValueType

static void ResetThreadDefault(void)

Reset thread default value as if it has not been set.

string g_GetConfigString(const char *section, const char *variable, const char *env_var_name, const char *default_value, CParamBase::EParamSource *src=nullptr)

Helper functions for getting values from registry/environment.

static void SetDefault(const TValueType &val)

Set new global default value.

static EParamState & sx_GetState(void)

EParamSource

Source of the value returned by CParam::GetDefault().

static TValueType GetDefault(void)

Get global default value.

static TValueType & sx_GetDefault(bool force_reset=false)

static TValueType StringToValue(const string &str, const TParamDesc &descr)

@ eParamCache_Force

Force caching currently set default value.

@ eParamCache_Defer

Do not try to cache the default value.

@ eParam_NoLoad

Do not load from registry or environment.

@ eParam_NoThread

Do not use per-thread values.

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

static bool StringToBool(const CTempString str)

Convert string to bool.

static string DoubleToString(double value, int precision=-1, TNumToStringFlags flags=0)

Convert double to string.

static int StringToInt(const CTempString str, TStringToNumFlags flags=0, int base=10)

Convert string to int.

static double StringToDouble(const CTempStringEx str, TStringToNumFlags flags=0)

Convert string to double.

static const string BoolToString(bool value)

Convert bool to string.

static string IntToString(int value, TNumToStringFlags flags=0, int base=10)

Convert int to string.

static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)

Case-insensitive equality of a substring with another string.

@ fAllowTrailingSpaces

Ignore trailing whitespace characters.

@ fAllowLeadingSpaces

Ignore leading whitespace characters in converted string.

@ fDecimalPosixOrLocal

StringToDouble*(): For decimal point, try both C and current locale.

@ fDoublePosix

DoubleToString*(): Use C locale for double conversions.

#define DEFINE_STATIC_MUTEX(id)

Define static mutex and initialize it.

const GenericPointer< typename T::ValueType > T2 value

void g_ParamTlsValueCleanup(TValue *value, void *)

Static variables safety - create on demand, destroy on application termination.

Common macro to detect used sanitizers and suppress memory leaks if run under LeakSanitizer.

#define NCBI_CLANG_ANALYZER_SUPPRESS

Suppress clang analyzer report.

NCBI C++ stream class wrappers for triggering between "new" and "old" C++ stream libraries.

std::istream & in(std::istream &in_, double &x_)

CSafeStatic_Proxy< TValue > TStaticValue

string(* FInitFunc)(void)

CSafeStatic_Proxy< TValue >::TStaticInit TStaticInit

TStaticInit default_value

const char * env_var_name


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4