51Degrees Common C/C++  4.1

A shared functionality library that is used 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);

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...
void  setFreeData (bool shouldFree)
Set whether or not the memory allocated for the data should be freed. 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()

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

◆ getConcurrency()

uint16_t ConfigBase::getConcurrency ( )
virtual

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

Returns
concurrency

◆ getReuseTempFile()

bool 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 > 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 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 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.

◆ setFreeData()

void ConfigBase::setFreeData ( bool   shouldFree )

Set whether or not the memory allocated for the data should be freed.

This only applies when constructing an Engine from memory (when the pre allocated memory containing the data is passed in).

Parameters
shouldFree - should free the data

◆ setReuseTempFile()

void 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 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 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 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 files:
On This Page