51Degrees Device Detection C/C++  4.1

A device detection library that is used natively or by 51Degrees products

FiftyoneDegrees::Common::ConfigBase Class Reference

Detailed Description

C++ class wrapper for the fiftyoneDegreesConfigBase configuration structure.

See config.h.

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

Usage Example

using namespace FiftyoneDegrees::Common;
// Construct a new configuration
ConfigBase *config = new ConfigBase();
// Configure the engine to create a temporary data file, or reuse
// an existing temporary file if one exists
config->setUseTempFile(true);
config->setReuseTempFile(true);
// Use the configuration when constructing an engine
EngineBase *engine = new EngineBase(config, properties);

Inheritance diagram for FiftyoneDegrees::Common::ConfigBase:

[legend]

Public Member Functions

Constructors and Destructors

 ConfigBase (fiftyoneDegreesConfigBase *config)
Constructs a new instance of the configuration with a reference to the C configuration provided. More...
virtual  ~ConfigBase ()
Free any memory associated with temporary directories.

Setters

void  setUseUpperPrefixHeaders (bool use)
Set whether or not the HTTP header field might be prefixed with 'HTTP_'. More...
void  setUseTempFile (bool use)
Set whether or not a temporary file should be created from the original data file and used to initialise the data set. More...
void  setReuseTempFile (bool reuse)
Set whether or not a temporary file that already exists for a master file should be reused by another process. More...
void  setTempDirectories (vector< string > tempDirs)
Sets a collection of temporary directories to use if temporary file operation is required in the order in which the directories should be used. More...

Getters

bool  getUseUpperPrefixHeaders ()
Get whether or not an HTTP_ upper case prefixes should be considered when evaluating HTTP headers. More...
bool  getUseTempFile ()
Get whether or not a temporary file should be created from the original data file and used to initialise the data set. More...
bool  getReuseTempFile ()
Get whether temporary files can be reused across multiple processes. More...
vector< string >  getTempDirectories ()
Gets a vector of temporary directory strings which should be used to store temporary files. More...
virtual uint16_t  getConcurrency ()
Get the expected number of concurrent accessors of the data set. More...

Constructor & Destructor Documentation

◆ ConfigBase()

FiftyoneDegrees::Common::ConfigBase::ConfigBase ( fiftyoneDegreesConfigBase *   config )

Constructs a new instance of the configuration with a reference to the C configuration provided.

Parameters
config - pointer to the underlying configuration structure

Member Function Documentation

◆ getReuseTempFile()

bool FiftyoneDegrees::Common::ConfigBase::getReuseTempFile ( )

Get whether temporary files can be reused across multiple processes.

Returns
true if temporary files can be reused, otherwise false.

◆ getTempDirectories()

vector<string> FiftyoneDegrees::Common::ConfigBase::getTempDirectories ( )

Gets a vector of temporary directory strings which should be used to store temporary files.

Returns
a vector of temporary directories, or NULL if no temporary directories are to be used.

◆ getUseTempFile()

bool FiftyoneDegrees::Common::ConfigBase::getUseTempFile ( )

Get whether or not a temporary file should be created from the original data file and used to initialise the data set.

Returns
true if temporary files should be used, otherwise false.

◆ getUseUpperPrefixHeaders()

bool FiftyoneDegrees::Common::ConfigBase::getUseUpperPrefixHeaders ( )

Get whether or not an HTTP_ upper case prefixes should be considered when evaluating HTTP headers.

Returns
true if upper case HTTP_ prefixed header keys should be considered.

◆ setReuseTempFile()

void FiftyoneDegrees::Common::ConfigBase::setReuseTempFile ( bool   reuse )

Set whether or not a temporary file that already exists for a master file should be reused by another process.

Parameters
reuse - should create a temp files be reused

◆ setTempDirectories()

void FiftyoneDegrees::Common::ConfigBase::setTempDirectories ( vector< string >   tempDirs )

Sets a collection of temporary directories to use if temporary file operation is required in the order in which the directories should be used.

If no temporary directories are provided and temporary files should be used the temporary files will be placed in the same directory as the master file.

Parameters
tempDirs - collection of temporary directories.

◆ setUseTempFile()

void FiftyoneDegrees::Common::ConfigBase::setUseTempFile ( bool   use )

Set whether or not a temporary file should be created from the original data file and used to initialise the data set.

Parameters
use - should create a temp file

◆ setUseUpperPrefixHeaders()

void FiftyoneDegrees::Common::ConfigBase::setUseUpperPrefixHeaders ( bool   use )

Set whether or not the HTTP header field might be prefixed with 'HTTP_'.

Parameters
use - whether or not prefixed upper headers should be used

The documentation for this class was generated from the following file:
  • /home/vsts/work/1/s/apis/device-detection-cxx/src/common-cxx/ConfigBase.hpp