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/ns__util_8cpp_source.html below:

NCBI C++ ToolKit: src/app/netschedule/ns_util.cpp Source File

50

vector<string> & warnings,

51  bool

throw_port_exception,

52  bool

& decrypting_error);

54

list<string> & queues,

55

vector<string> & warnings);

57

vector<string> & warnings);

60

list<string> & queues,

61

vector<string> & warnings);

63  const

list<string> & queues,

64

vector<string> & warnings);

67  unsigned int

low_limit,

68  unsigned int

high_limit);

71  const string

& section,

73  unsigned int

default_max,

74  unsigned int

default_high_mark_percentage,

75  unsigned int

default_low_mark_percentage,

76  unsigned int

default_high_removal,

77  unsigned int

default_low_removal,

78  unsigned int

default_dirt_percentage,

79

vector<string> & warnings);

85  return "["

+ section +

"]/"

+ entry;

89  const string

& section,

const string

& entry,

90

vector<string> & warnings)

96  ". Expected a floating point value."

);

103  const string

& section,

const string

& entry,

104

vector<string> & warnings)

107

reg.

GetBool

(section, entry,

false

);

110  ". Expected boolean value."

);

117  const string

& section,

const string

& entry,

118

vector<string> & warnings)

121

reg.

GetInt

(section, entry, 0);

124  ". Expected integer value."

);

131  const string

& section,

const string

& entry,

132

vector<string> & warnings)

138  ". Expected string value."

);

146  const string

& section,

const string

& entry,

147

vector<string> & warnings)

149  if

(!reg.

HasEntry

(section, entry))

165  ". Expected data size value."

);

173  const string

& section,

const string

& entry,

174  unsigned int

default_val)

191  bool

throw_port_exception,

192  bool

& decrypting_error)

205

vector<string> & warnings,

206  bool

throw_port_exception,

207  bool

& decrypting_error)

209  const string

section =

"server"

;

215  int

port_val = reg.

GetInt

(section,

"port"

, 0);

218  " value. Allowed range: "

+

221  if

(throw_port_exception)

223

warnings.push_back(

msg

);

226  if

(throw_port_exception)

234  int val

= reg.

GetInt

(section,

"max_connections"

,

243

message +=

" Value "

+ to_string(

248

warnings.push_back(message +

" will be used when restarted"

);

262

max_threads_val =

val

;

275

init_threads_val =

val

;

278  if

(init_threads_val > max_threads_val)

282  " break the mandatory condition " 283  "init_threads <= max_threads"

);

290  int val

= reg.

GetInt

(section,

"network_timeout"

,

300  int val

= reg.

GetInt

(section,

"max_queues"

,

312  NS_ValidateBool

(reg, section,

"log_execution_watcher_thread"

, warnings);

320  int val

= reg.

GetInt

(section,

"del_batch_size"

,

327

del_batch_size_val =

val

;

333  int val

= reg.

GetInt

(section,

"markdel_batch_size"

,

340

markdel_batch_size_val =

val

;

346  int val

= reg.

GetInt

(section,

"scan_batch_size"

,

353

scan_batch_size_val =

val

;

366  if

(scan_batch_size_val < markdel_batch_size_val)

370  " break the mandatory condition " 371  "markdel_batch_size <= scan_batch_size"

);

373  if

(markdel_batch_size_val < del_batch_size_val)

377  " break the mandatory condition " 378  "del_batch_size <= markdel_batch_size"

);

383  int val

= reg.

GetInt

(section,

"stat_interval"

,

393  int val

= reg.

GetInt

(section,

"job_counters_interval"

,

403  int val

= reg.

GetInt

(section,

"max_client_data"

,

439  "state_transition_perf_log_queues"

, warnings);

441  "state_transition_perf_log_classes"

, warnings);

444

decrypting_error =

false

;

451  " decrypting error detected. "

+

453

decrypting_error =

true

;

457  " unknown decrypting error"

);

458

decrypting_error =

true

;

468

list<string> & queues,

469

vector<string> & warnings)

479

vector<string> & warnings)

482

list<string> sections;

486  ITERATE

(list<string>, it, sections) {

489  const string

& section_name = *it;

494  if

(queue_class.empty()) {

495

warnings.push_back(

g_ValidPrefix

+

"section "

+ section_name +

496  " does not have a queue class name"

);

500

warnings.push_back(

g_ValidPrefix

+

"section "

+ section_name +

501  " introduces a queue class which name length" 502  " exceeds the max allowed lenght of "

+

511

queue_classes[queue_class] = params;

515  return

queue_classes;

522

list<string> & queues,

523

vector<string> & warnings)

525

list<string> sections;

528  for

(list<string>::const_iterator k = sections.begin();

529

k != sections.end(); ++k) {

532  string

section_name = *k;

538  if

(queue_name.empty()) {

539

warnings.push_back(

g_ValidPrefix

+

"section "

+ section_name +

540  " does not have a queue name"

);

544

warnings.push_back(

g_ValidPrefix

+

"section "

+ section_name +

545  " introduces a queue which name length" 546  " exceeds the max allowed lenght of "

+

552  if

(params.

ReadQueue

(reg, section_name, qclasses, warnings)) {

554

queues.push_back(queue_name);

562  const

list<string> & queues,

563

vector<string> & warnings)

565  const string

section =

"service_to_queue"

;

569  for

(list<string>::const_iterator k =

entries

.begin();

571  string

service_name = *k;

572  string

qname = reg.

Get

(section, service_name);

576  " does not specify a queue name"

);

581  if

(find(queues.begin(), queues.end(), qname) == queues.end())

584  " does not point to an existing static queue"

);

591  const string

& entry,

592  unsigned int

low_limit,

593  unsigned int

high_limit)

596  " is out of limits ("

+ to_string(low_limit) +

"..."

+

597

to_string(high_limit) +

")"

;

606

vector<string> & warnings)

617  if

(access(

file_name

.c_str(), F_OK) != 0) {

618

warnings.push_back(

"Error computing config file checksum, " 619  "the file does not exist: "

+

file_name

);

623  if

(access(

file_name

.c_str(), R_OK) != 0) {

624

warnings.push_back(

"Error computing config file checksum, " 625  "there are no read permissions: "

+

file_name

);

630  string

checksum_as_string;

635  return

checksum_as_string;

636

}

catch

(

const

exception & ex) {

637

warnings.push_back(

"Error computing config file checksum. "

+

641

warnings.push_back(

"Unknown error of computing config file checksum"

);

649  const string

& section,

651  unsigned int

default_max,

652  unsigned int

default_high_mark_percentage,

653  unsigned int

default_low_mark_percentage,

654  unsigned int

default_high_removal,

655  unsigned int

default_low_removal,

656  unsigned int

default_dirt_percentage,

657

vector<string> & warnings)

662  if

(name ==

"affinity"

)

663

plural =

"affinities"

;

665

plural = name +

"s"

;

670  int val

= reg.

GetInt

(section,

"max_"

+ plural, default_max);

679  unsigned int

high_mark_percentage_val =

680

default_high_mark_percentage;

682  int val

= reg.

GetInt

(section, name +

"_high_mark_percentage"

,

683

default_high_mark_percentage);

684  if

(val <= 0 || val >= 100)

687  " must be between 0 and 100"

);

689

high_mark_percentage_val =

val

;

694  unsigned int

low_mark_percentage_val =

695

default_low_mark_percentage;

697  int val

= reg.

GetInt

(section, name +

"_low_mark_percentage"

,

698

default_low_mark_percentage);

699  if

(val <= 0 || val >= 100)

702  " must be between 0 and 100"

);

704

low_mark_percentage_val =

val

;

708  unsigned int

high_removal_val = default_high_removal;

710  int val

= reg.

GetInt

(section, name +

"_high_removal"

,

711

default_high_removal);

717

high_removal_val =

val

;

721  unsigned int

low_removal_val = default_low_removal;

723  int val

= reg.

GetInt

(section, name +

"_low_removal"

,

724

default_low_removal);

730

low_removal_val =

val

;

734  unsigned int

dirt_percentage_val = default_dirt_percentage;

736  int val

= reg.

GetInt

(section, name +

"_dirt_percentage"

,

737

default_dirt_percentage);

738  if

(val <= 0 || val >= 100)

741  " must be between 0 and 100"

);

743

dirt_percentage_val =

val

;

746  if

(low_mark_percentage_val >= high_mark_percentage_val)

751  " break the mandatory condition "

+

752

name +

"_low_mark_percentage < "

+

753

name +

"_high_mark_percentage"

);

755  if

(dirt_percentage_val >= low_mark_percentage_val)

760  " break the mandatory condition "

+

761

name +

"_dirt_percentage < "

+

762

name +

"_low_mark_percentage"

);

764  if

(high_removal_val < low_removal_val)

769  " break the mandatory condition "

+

770

name +

"_low_removal <= "

+

771

name +

"_high_removal"

);

Algorithms for bvector<> (main include)

Checksum and hash calculation classes.

CChecksum – Checksum calculator.

NetSchedule internal exception.

definition of a Culling tree

#define ITERATE(Type, Var, Cont)

ITERATE macro to sequence through container elements.

@ eNoOwnership

No ownership is assumed.

void AddFile(const string &file_path)

Update checksum with the file data.

void GetMD5Digest(unsigned char digest[16]) const

Return calculated MD5 digest.

#define NCBI_THROW(exception_class, err_code, message)

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

const TParamTree * GetTree() const

Uint8 GetDataSize(const string &driver_name, const string &param_name, EErrAction on_error, unsigned int default_value, const list< string > *synonyms=NULL)

Utility function to get an integer element of parameter tree Throws an exception when mandatory param...

@ eErr_NoThrow

Return default value on error.

@ eErr_Throw

Throw an exception on error.

virtual bool GetBool(const string &section, const string &name, bool default_value, TFlags flags=0, EErrAction err_action=eThrow) const

Get boolean value of specified parameter name.

virtual void EnumerateSections(list< string > *sections, TFlags flags=fAllLayers) const

Enumerate section names.

virtual const string & Get(const string &section, const string &name, TFlags flags=0) const

Get the parameter value.

virtual int GetInt(const string &section, const string &name, int default_value, TFlags flags=0, EErrAction err_action=eThrow) const

Get integer value of specified parameter name.

virtual double GetDouble(const string &section, const string &name, double default_value, TFlags flags=0, EErrAction err_action=eThrow) const

Get double value of specified parameter name.

virtual bool HasEntry(const string &section, const string &name=kEmptyStr, TFlags flags=0) const

virtual void EnumerateEntries(const string &section, list< string > *entries, TFlags flags=fAllLayers) const

Enumerate parameter names for a specified section.

string GetEncryptedString(const string &section, const string &name, TFlags flags=0, const string &password=kEmptyStr) const

Get a value that was (potentially) stored encrypted.

virtual string GetString(const string &section, const string &name, const string &default_value, TFlags flags=0) const

Get the parameter string value.

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

static int CompareNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)

Case-insensitive compare of a substring with another string.

static bool SplitInTwo(const CTempString str, const CTempString delim, string &str1, string &str2, TSplitFlags flags=0)

Split a string into two pieces using the specified delimiters.

const TTreeType * FindSubNode(const TKeyType &key) const

Non recursive linear scan of all subnodes, with key comparison.

const unsigned short port_high_limit

const unsigned int default_group_low_removal

const unsigned int default_affinity_low_mark_percentage

const unsigned int default_group_dirt_percentage

const unsigned int default_max_threads

const unsigned int default_scope_high_removal

const unsigned int default_scope_high_mark_percentage

const double default_purge_timeout

const unsigned int default_group_high_mark_percentage

const unsigned int default_init_threads

const unsigned int default_stat_interval

const unsigned int default_max_scopes

const unsigned int default_max_client_data

const unsigned int default_max_groups

const unsigned int default_group_high_removal

const unsigned short port_low_limit

const unsigned int default_group_low_mark_percentage

const unsigned int default_scope_low_removal

const unsigned int default_markdel_batch_size

const unsigned int default_max_queues

const unsigned int max_threads_high_limit

const unsigned int default_affinity_low_removal

const unsigned int default_affinity_high_mark_percentage

const unsigned int default_del_batch_size

const unsigned int default_job_counters_interval

const unsigned int default_scope_low_mark_percentage

const unsigned int max_connections_low_limit

const unsigned int default_max_connections

const unsigned int default_affinity_high_removal

const unsigned int default_max_affinities

const unsigned int default_scope_dirt_percentage

const unsigned int max_threads_low_limit

const unsigned int init_threads_high_limit

const unsigned int init_threads_low_limit

const unsigned int max_connections_high_limit

const unsigned int default_affinity_dirt_percentage

const unsigned int default_scan_batch_size

const unsigned int default_network_timeout

const unsigned kMaxQueueNameSize

bool NS_ValidateDouble(const IRegistry &reg, const string &section, const string &entry, vector< string > &warnings)

void NS_ValidateConfigFile(const IRegistry &reg, vector< string > &warnings, bool throw_port_exception, bool &decrypting_error)

bool NS_ValidateBool(const IRegistry &reg, const string &section, const string &entry, vector< string > &warnings)

static void NS_ValidateRegistrySettings(const IRegistry &reg, const string &section, const string &name, unsigned int default_max, unsigned int default_high_mark_percentage, unsigned int default_low_mark_percentage, unsigned int default_high_removal, unsigned int default_low_removal, unsigned int default_dirt_percentage, vector< string > &warnings)

static void NS_ValidateQueuesAndClasses(const IRegistry &reg, list< string > &queues, vector< string > &warnings)

string NS_RegValName(const string &section, const string &entry)

static string NS_OutOfLimitMessage(const string &section, const string &entry, unsigned int low_limit, unsigned int high_limit)

string NS_GetConfigFileChecksum(const string &file_name, vector< string > &warnings)

unsigned int NS_GetDataSize(const IRegistry &reg, const string &section, const string &entry, unsigned int default_val)

static const string s_ErrorGettingChecksum

static TQueueParams NS_ValidateClasses(const IRegistry &reg, vector< string > &warnings)

static void NS_ValidateServiceToQueueSection(const IRegistry &reg, const list< string > &queues, vector< string > &warnings)

static void NS_ValidateServerSection(const IRegistry &reg, vector< string > &warnings, bool throw_port_exception, bool &decrypting_error)

static void NS_ValidateQueues(const IRegistry &reg, const TQueueParams &qclasses, list< string > &queues, vector< string > &warnings)

bool NS_ValidateInt(const IRegistry &reg, const string &section, const string &entry, vector< string > &warnings)

bool NS_ValidateDataSize(const IRegistry &reg, const string &section, const string &entry, vector< string > &warnings)

bool NS_ValidateString(const IRegistry &reg, const string &section, const string &entry, vector< string > &warnings)

const string g_WarnPrefix

const string g_ValidPrefix

static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)

bool ReadQueueClass(const IRegistry &reg, const string &sname, vector< string > &warnings)

bool ReadQueue(const IRegistry &reg, const string &sname, const map< string, SQueueParameters, PNocase > &queue_classes, vector< string > &warnings)

static wxAcceleratorEntry entries[3]


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