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);
C++ class wrapper for the fiftyoneDegreesCollectionConfig structure.
Definition CollectionConfig.hpp:51
void setCapacity(uint32_t capacity)
Set the number of items the cache should store, 0 for no cache.

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.

Setters

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

Getters

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

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
configpointer 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
capacityto set

◆ setConcurrency()

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

Set the expected number of concurrent requests.

Parameters
concurrencyto 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
loadedto set

The documentation for this class was generated from the following file: