51Degrees Common C/C++  4.1

A shared functionality library that is used by 51Degrees products

CollectionConfig.hpp

1 /* *********************************************************************
2  * This Source Code Form is copyright of 51 Degrees Mobile Experts Limited.
3  * Copyright 2019 51 Degrees Mobile Experts Limited, 5 Charlotte Close,
4  * Caversham, Reading, Berkshire, United Kingdom RG4 7BY
5  *
6  * This Source Code Form is subject to the terms of the Mozilla Public
7  * License, v. 2.0.
8  *
9  * If a copy of the MPL was not distributed with this file, You can obtain
10  * one at http://mozilla.org/MPL/2.0/.
11  *
12  * This Source Code Form is "Incompatible With Secondary Licenses", as
13  * defined by the Mozilla Public License, v. 2.0.
14  * ******************************************************************** */
15 
16 #ifndef FIFTYONE_DEGREES_COLLECTION_CONFIG_HPP
17 #define FIFTYONE_DEGREES_COLLECTION_CONFIG_HPP
18 
19 #include "Exceptions.hpp"
20 #include "collection.h"
21 
22 namespace FiftyoneDegrees {
23  namespace Common {
44  public:
55 
63 
74  void setCapacity(uint32_t capacity);
75 
80  void setConcurrency(uint16_t concurrency);
81 
87  void setLoaded(uint32_t loaded);
88 
99  uint32_t getCapacity();
100 
105  uint16_t getConcurrency();
106 
112  uint32_t getLoaded();
113 
119 
124  private:
127  };
128  }
129 }
130 
131 #endif
C++ class wrapper for the fiftyoneDegreesCollectionConfig structure.
Definition: CollectionConfig.hpp:43
void setConcurrency(uint16_t concurrency)
Set the expected number of concurrent requests.
Definition: CollectionConfig.cpp:31
void setCapacity(uint32_t capacity)
Set the number of items the cache should store, 0 for no cache.
Definition: CollectionConfig.cpp:27
uint32_t getCapacity()
Get the number of items the cache should store, 0 for no cache.
Definition: CollectionConfig.cpp:39
51Degrees base namespace.
Definition: Collection.hpp:24
fiftyoneDegreesCollectionConfig * getConfig()
Get a pointer to the underlying configuration structure.
Definition: CollectionConfig.cpp:51
CollectionConfig()
Construct a new instance of CollectionConfig with the default configuration.
Definition: CollectionConfig.cpp:20
void setLoaded(uint32_t loaded)
Set the number of items to load into memory from the start of the collection.
Definition: CollectionConfig.cpp:35
uint16_t getConcurrency()
Get the expected number of concurrent requests.
Definition: CollectionConfig.cpp:43
Collection configuration structure which defines how the collection should be created by the create m...
Definition: collection.h:281
uint32_t getLoaded()
Get the number of items to load into memory from the start of the collection.
Definition: CollectionConfig.cpp:47