\r\n

51Degrees Device Detection C/C++  4.4

A device detection library that is used natively or 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. More...
 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 () const
Get the number of items the cache should store, 0 for no cache. More...
uint16_t  getConcurrency () const
Get the expected number of concurrent requests. More...
uint32_t  getLoaded () const
Get the number of items to load into memory from the start of the collection. More...
fiftyoneDegreesCollectionConfig *  getConfig () const
Get a pointer to the underlying configuration structure. More...

Constructor & Destructor Documentation

◆ CollectionConfig() [1/2]

FiftyoneDegrees::Common::CollectionConfig::CollectionConfig ( )

Construct a new instance of CollectionConfig with the default configuration.

This method does not set the internal config structure, so an extending class must do this if calling this constructor.

◆ CollectionConfig() [2/2]

FiftyoneDegrees::Common::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 FiftyoneDegrees::Common::CollectionConfig::getCapacity ( ) const

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

Returns
capacity value

◆ getConcurrency()

uint16_t FiftyoneDegrees::Common::CollectionConfig::getConcurrency ( ) const

Get the expected number of concurrent requests.

Returns
concurrency value

◆ getConfig()

fiftyoneDegreesCollectionConfig* FiftyoneDegrees::Common::CollectionConfig::getConfig ( ) const

Get a pointer to the underlying configuration structure.

Returns
C structure pointer

◆ getLoaded()

uint32_t FiftyoneDegrees::Common::CollectionConfig::getLoaded ( ) const

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

Returns
loaded value

◆ setCapacity()

void FiftyoneDegrees::Common::CollectionConfig::setCapacity ( uint32_t   capacity )

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

Parameters
capacity - to set

◆ setConcurrency()

void FiftyoneDegrees::Common::CollectionConfig::setConcurrency ( uint16_t   concurrency )

Set the expected number of concurrent requests.

Parameters
concurrency - to set

◆ setLoaded()

void FiftyoneDegrees::Common::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 file:
  • /home/runner/work/device-detection-cxx/device-detection-cxx/common/device-detection-cxx/src/common-cxx/CollectionConfig.hpp