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);
ConfigBase(fiftyoneDegreesConfigBase *config)
Constructs a new instance of the configuration with a reference to the C configuration provided.
Encapsulates the engine class to be extended by engine implementations.
Definition EngineBase.hpp:78
C++ class wrapper for the fiftyoneDegreesPropertiesRequired structure.
Definition RequiredPropertiesConfig.hpp:59
Shared classes.
Definition Collection.hpp:31

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.
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_'.
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.
void setReuseTempFile (bool reuse)
 Set whether or not a temporary file that already exists for a master file should be reused by another process.
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.
void setPropertyValueIndex (bool index)
 Set whether or not an index to speed up the retrieval of values for profiles and properties is created.

Getters

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

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
configpointer to the underlying configuration structure

Member Function Documentation

◆ getConcurrency()

virtual uint16_t FiftyoneDegrees::Common::ConfigBase::getConcurrency ( ) const
virtual

Get the expected number of concurrent accessors of the data set.

Returns
concurrency

Reimplemented in FiftyoneDegrees::DeviceDetection::Hash::ConfigHash.

◆ getPropertyValueIndex()

bool FiftyoneDegrees::Common::ConfigBase::getPropertyValueIndex ( ) const

Gets a flag indicating if an index of values for properties and profile is created.

Returns
true if an index should be created, or false if not.

◆ getReuseTempFile()

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

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 ( ) const

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 ( ) const

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 ( ) const

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.

◆ setPropertyValueIndex()

void FiftyoneDegrees::Common::ConfigBase::setPropertyValueIndex ( bool index)

Set whether or not an index to speed up the retrieval of values for profiles and properties is created.

Parameters
indexshould create an index

◆ 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
reuseshould 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
tempDirscollection 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
useshould 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
usewhether or not prefixed upper headers should be used

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