51Degrees Common C/C++  4.1

A shared functionality library that is used by 51Degrees products

FiftyoneDegrees::Common::CollectionConfig Class Reference

Detailed Description

C++ class wrapper for the fiftyoneDegreesCollectionConfig structure.

See collection.h.

Configuration options are set using setter methods and fetched using corresponding getter methods. The names are self explanatory.

Usage Example

// Configure a collection with a capacity of 100, with 20 preloaded
// items, which can be used by 4 threads concurrently
config->setCapacity(100);
config->setLoaded(20);
config->setConcurrency(4);

Public Member Functions

Constructors

 CollectionConfig ()
Construct a new instance of CollectionConfig with the default configuration.
 CollectionConfig (fiftyoneDegreesCollectionConfig *config)
Construct a new instance of CollectionConfig which references an existing instance of the C structure. More...

Setters

void  setCapacity (uint32_t capacity)
Set the number of items the cache should store, 0 for no cache. More...
void  setConcurrency (uint16_t concurrency)
Set the expected number of concurrent requests. More...
void  setLoaded (uint32_t loaded)
Set the number of items to load into memory from the start of the collection. More...

Getters

uint32_t  getCapacity ()
Get the number of items the cache should store, 0 for no cache. More...
uint16_t  getConcurrency ()
Get the expected number of concurrent requests. More...
uint32_t  getLoaded ()
Get the number of items to load into memory from the start of the collection. More...
fiftyoneDegreesCollectionConfig *  getConfig ()
Get a pointer to the underlying configuration structure. More...

Constructor & Destructor Documentation

◆ CollectionConfig()

CollectionConfig::CollectionConfig ( fiftyoneDegreesCollectionConfig *   config )

Construct a new instance of CollectionConfig which references an existing instance of the C structure.

Parameters
config - pointer to existing collection configuration structure

Member Function Documentation

◆ getCapacity()

uint32_t CollectionConfig::getCapacity ( )

Get the number of items the cache should store, 0 for no cache.

Returns
capacity value

◆ getConcurrency()

uint16_t CollectionConfig::getConcurrency ( )

Get the expected number of concurrent requests.

Returns
concurrency value

◆ getLoaded()

uint32_t CollectionConfig::getLoaded ( )

Get the number of items to load into memory from the start of the collection.

Returns
loaded value

◆ setCapacity()

void CollectionConfig::setCapacity ( uint32_t   capacity )

Set the number of items the cache should store, 0 for no cache.

Parameters
capacity - to set

◆ setConcurrency()

void CollectionConfig::setConcurrency ( uint16_t   concurrency )

Set the expected number of concurrent requests.

Parameters
concurrency - to set

◆ setLoaded()

void CollectionConfig::setLoaded ( uint32_t   loaded )

Set the number of items to load into memory from the start of the collection.

Parameters
loaded - to set

The documentation for this class was generated from the following files:
On This Page