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

NCBI C++ ToolKit: src/util/demo/cache_demo.cpp Source File

46  virtual void Init

(

void

);

47  virtual int Run

(

void

);

93

TSimpleCache cache(100);

95  for

(

int i

= 0;

i

< 1000;

i

++) {

97

TSimpleCache::EAddResult

result

;

98

cache.Add(

i

, element, 1, 0, &

result

);

103  for

(

int i

= 0;

i

< 1000;

i

++) {

107  _ASSERT

(element->GetSize() == (

size_t

)

i

*10);

162

THeapCache cache(100);

164  for

(

int i

= 0;

i

< 1000;

i

++) {

166

THeapCache::EAddResult

result

;

167

cache.Add(

i

, element, 1, 0, &

result

);

171  for

(

int i

= 0;

i

< 1000;

i

++) {

240  for

(

int i

= 0;

i

< 1000;

i

++) {

242

TMemCache::EAddResult

result

;

243

cache.Add(

i

, element, 1, 0, &

result

);

253  for

(

int i

= 0;

i

< 1000;

i

++) {

254

TElement element = cache.Get(

i

);

256  _ASSERT

(element->GetSize() == (

size_t

)

i

*10);

320

TEmptyOnOverflowCache cache(1);

321  for

(

int i

= 0;

i

< 1000;

i

++) {

323

TEmptyOnOverflowCache::EAddResult

result

;

324

cache.Add(

i

, element, 1, 0, &

result

);

326  _ASSERT

(cache.GetSize() == 1);

329  for

(

int i

= 0;

i

< 1000;

i

++) {

330

TElement element = cache.Get(

i

);

332  _ASSERT

(element->GetSize() == (

size_t

)

i

*10);

341 int main

(

int

argc,

const char

* argv[])

344  return

app.

AppMain

(argc, argv);

const size_t kMaxOverflowCacheSize

int main(int argc, const char *argv[])

const size_t kMaxMemCacheSize

virtual void Init(void)

Initialize the application.

void SimpleCacheDemo(void)

void MemoryCacheDemo(void)

virtual int Run(void)

Run the application.

void EmptyOnOverflowDemo(void)

ECache_InsertFlag CanInsertElement(const int &, const CRef< CObjElement > &value)

~CDemoHandler_EmptyOnOverflow(void)

void RemoveElement(const int &, CRef< CObjElement >)

void InsertElement(const int &, const CRef< CObjElement > &)

CRef< CObjElement > CreateValue(const int &)

CDemoHandler_EmptyOnOverflow(void)

void RemoveElement(const int &, CHeapElement *value)

CHeapElement * CreateValue(const int &)

void InsertElement(const int &, CHeapElement *)

ECache_InsertFlag CanInsertElement(const int &, const CHeapElement *value)

CRef< CObjElement > CreateValue(const int &)

void InsertElement(const int &, const CRef< CObjElement > &value)

ECache_InsertFlag CanInsertElement(const int &, const CRef< CObjElement > &value)

~CDemoHandler_MemSize(void)

CDemoHandler_MemSize(void)

void RemoveElement(const int &, CRef< CObjElement > value)

CHeapElement(size_t size)

size_t GetSize(void) const

CNoLock is a simple no-op lock which does no real locking.

size_t GetSize(void) const

int AppMain(int argc, const char *const *argv, const char *const *envp=0, EAppDiagStream diag=eDS_Default, const char *conf=NcbiEmptyCStr, const string &name=NcbiEmptyString)

Main function (entry point) for the NCBI application.

ECache_InsertFlag

Flag indicating if an element can be inserted into cache.

@ eCache_CanInsert

The element can be inserted.

@ eCache_DoNotCache

The element can not be inserted (e.g. too big)

@ eCache_CheckSize

Insert the element after checking max cache size.

@ eCache_NeedCleanup

Need to cleanup cache before inserting the element.

unsigned int

A callback function used to compare two keys in a database.

const struct ncbi::grid::netcache::search::fields::SIZE size

const GenericPointer< typename T::ValueType > T2 value

The NCBI C++ generic cache template.

Defines the CNcbiApplication and CAppException classes for creating NCBI applications.

Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.


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