◆ EngineBase()
FiftyoneDegrees::Common::EngineBase::EngineBase | ( | ConfigBase * | config, |
RequiredPropertiesConfig * | properties | ||
) |
Construct a new instance of the engine class with the configuration and properties provided.
- Parameters
-
- config - used to build the engine
- properties - the properties expected to be fetched from results
Member Function Documentation
◆ addKey()
void FiftyoneDegrees::Common::EngineBase::addKey ( string key ) protectedAdds a key to the list of keys which should be added as evidence.
This is called by the key init methods.
- Parameters
-
- key - to add
◆ appendString()
virtual void FiftyoneDegrees::Common::EngineBase::appendString ( stringstream & stream, fiftyoneDegreesCollection * strings, uint32_t offset ) const protected virtualGets a string from a strings collection, and appends to a stream.
- Parameters
-
- stream - to append the string to
- strings - collection to get the string from
- offset - of the string in the collection
◆ getAutomaticUpdatesEnabled()
bool FiftyoneDegrees::Common::EngineBase::getAutomaticUpdatesEnabled ( ) const Gets whether or not automatic updates are enabled.
If they are, then this tells an external service that it should update the data set.
- Returns
- true if updates are enabled
◆ getDataFilePath()
virtual string FiftyoneDegrees::Common::EngineBase::getDataFilePath ( ) const pure virtualGet the path to the data file the current data set was initialised from.
- Returns
- data file path
Implemented in FiftyoneDegrees::DeviceDetection::Hash::EngineHash.
◆ getDataFileTempPath()
virtual string FiftyoneDegrees::Common::EngineBase::getDataFileTempPath ( ) const pure virtualGet the path to the temporary data file created by the engine, or an empty string if one was not created.
- Returns
- temp data file path or empty string
Implemented in FiftyoneDegrees::DeviceDetection::Hash::EngineHash.
◆ getDataUpdateUrl()
virtual string FiftyoneDegrees::Common::EngineBase::getDataUpdateUrl ( ) const virtualGet the URL to be used when updating the data file, or an empty string if this is not set.
- Returns
- URL to download new data file from
◆ getIsThreadSafe()
bool FiftyoneDegrees::Common::EngineBase::getIsThreadSafe ( ) const Get whether or not the engine was compiled with thread-safe support.
If it was not then certain precautions should be taken.
- Returns
- true if the engine is thread-safe
◆ getKeys()
const vector<string>* FiftyoneDegrees::Common::EngineBase::getKeys ( ) const Get the list of keys which the engine accepts as evidence.
This is a pointer to an internal vector should not (and cannot) be freed.
- Returns
- pointer to the list of evidence keys
◆ getMetaData()
MetaData* FiftyoneDegrees::Common::EngineBase::getMetaData ( ) const Return the a pointer to the meta data class which contains meta data for the properties, values, profiles and components that exist within the engine.
- Returns
- pointer to the meta data class
- Examples
- Hash/MetaData.cpp.
◆ getProduct()
virtual string FiftyoneDegrees::Common::EngineBase::getProduct ( ) const pure virtualGet the name of the data set being used e.g.
Pattern or Hash.
- Returns
- product name
Implemented in FiftyoneDegrees::DeviceDetection::Hash::EngineHash.
◆ getPublishedTime()
virtual Date FiftyoneDegrees::Common::EngineBase::getPublishedTime ( ) const pure virtualGet the date at which the current data set was published.
- Returns
- data set published date
Implemented in FiftyoneDegrees::DeviceDetection::Hash::EngineHash.
◆ getType()
virtual string FiftyoneDegrees::Common::EngineBase::getType ( ) const pure virtualGet the tier of the data set being used e.g.
Premium or Enterprise.
- Returns
- data set type
Implemented in FiftyoneDegrees::DeviceDetection::Hash::EngineHash.
◆ getUpdateAvailableTime()
virtual Date FiftyoneDegrees::Common::EngineBase::getUpdateAvailableTime ( ) const pure virtualGet the date at which a new data file will be available to download from the URL returned by getDataUpdateUrl().
- Returns
- new data set available date
Implemented in FiftyoneDegrees::DeviceDetection::Hash::EngineHash.
◆ initHttpHeaderKeys()
virtual void FiftyoneDegrees::Common::EngineBase::initHttpHeaderKeys ( fiftyoneDegreesHeaders * uniqueHeaders ) protected virtualInitialise the HTTP header keys which are used by this engine.
These are the pieces of evidence which should be passed in if available.
- Parameters
-
- uniqueHeaders - to get the keys from
◆ initOverrideKeys()
void FiftyoneDegrees::Common::EngineBase::initOverrideKeys ( fiftyoneDegreesOverridePropertyArray * overrideProperties ) protectedInitialise the override keys which are used by this engine.
These are additional pieces of evidence which should be passed in if available.
- Parameters
-
- overrideProperties - to get the keys from
◆ processBase()
virtual ResultsBase* FiftyoneDegrees::Common::EngineBase::processBase ( EvidenceBase * evidence ) const pure virtualProcesses the evidence provided and returns the result.
- Parameters
-
- evidence - to process. The keys in getKeys() will be the only ones considered by the engine.
- Returns
- a new results instance with the values for all requested properties
Implemented in FiftyoneDegrees::DeviceDetection::Hash::EngineHash.
◆ refreshData() [1/4]
virtual void FiftyoneDegrees::Common::EngineBase::refreshData ( ) const pure virtualRefresh the data set from the original file location.
This should be implemented by the extending class.
Implemented in FiftyoneDegrees::DeviceDetection::Hash::EngineHash.
◆ refreshData() [2/4]
virtual void FiftyoneDegrees::Common::EngineBase::refreshData ( const char * fileName ) const pure virtualRefresh the data set from the file location provided.
- Parameters
-
- fileName - of the new data file
Implemented in FiftyoneDegrees::DeviceDetection::Hash::EngineHash.
◆ refreshData() [3/4]
virtual void FiftyoneDegrees::Common::EngineBase::refreshData ( void * data, long length ) const pure virtualRefresh the data set from the memory location provided.
- Parameters
-
- data - pointer to the data in memory
- length - length of the data in memory
Implemented in FiftyoneDegrees::DeviceDetection::Hash::EngineHash.
◆ refreshData() [4/4]
virtual void FiftyoneDegrees::Common::EngineBase::refreshData ( unsigned char data[], long length ) const pure virtualRefresh the data set from the memory location provided.
- Parameters
-
- data - pointer to the data in memory
- length - of the data in memory
Implemented in FiftyoneDegrees::DeviceDetection::Hash::EngineHash.
◆ setDataUpdateUrl()
void FiftyoneDegrees::Common::EngineBase::setDataUpdateUrl ( const string & updateUrl ) Sets the URL to be used when updating the data set.
- Parameters
-
- updateUrl - to set
◆ setLicenseKey()
void FiftyoneDegrees::Common::EngineBase::setLicenseKey ( const string & licenseKey ) Sets the license key to be used when updating the data set.
- Parameters
-
- licenseKey - to set
Field Documentation
◆ config
ConfigBase* FiftyoneDegrees::Common::EngineBase::config protectedPointer to the configuration used to build the engine.
◆ defaultDataKey
string FiftyoneDegrees::Common::EngineBase::defaultDataKey protectedThe default key to use when adding the results to a dictionary.
◆ keys
vector<string> FiftyoneDegrees::Common::EngineBase::keys protectedKeys which should be added to evidence.
◆ licenceKey
string FiftyoneDegrees::Common::EngineBase::licenceKey protectedLicense key used to update the data set.
May be empty.
◆ manager
shared_ptr<fiftyoneDegreesResourceManager> FiftyoneDegrees::Common::EngineBase::manager protectedA shared pointer to the manager is passed around and referenced by all instances that hold open a resource handle.
This acts as a counter to ensure that the pointer to the manager remains valid until the last handle is freed. The shared pointer also handles freeing the pointer once no references remain. See resource.h for more information.
◆ metaData
MetaData* FiftyoneDegrees::Common::EngineBase::metaData protectedPointer to the meta data relating to the contents of the engine's data set.
◆ requiredProperties
RequiredPropertiesConfig* FiftyoneDegrees::Common::EngineBase::requiredProperties protectedPointer to the properties which are going to be used.
◆ updateUrl
string FiftyoneDegrees::Common::EngineBase::updateUrl protectedURL used to update the data set.
The documentation for this class was generated from the following file:- /home/vsts/work/1/s/apis/device-detection-cxx/src/common-cxx/EngineBase.hpp