\r\n

51Degrees Device Detection C/C++  4.4

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

FiftyoneDegrees::Examples::Hash::ExampleBase Class Reference abstract

Detailed Description

Base class extended by all Hash examples.

Examples
Hash/GettingStarted.cpp, Hash/MatchMetrics.cpp, Hash/MetaData.cpp, Hash/ReloadFromFile.cpp, Hash/ReloadFromMemory.cpp, and Hash/StronglyTyped.cpp.

Inheritance diagram for FiftyoneDegrees::Examples::Hash::ExampleBase:

[legend]

Collaboration diagram for FiftyoneDegrees::Examples::Hash::ExampleBase:

[legend]

Data Structures

class  SharedState
State containing the states for all threads running in a multi-threaded example . More...
class  ThreadState
State for a single thread carrying out processing in order to store a hash of the results. More...

Public Member Functions

 ExampleBase (byte *data, long length, ConfigHash *config)
Construct a new instance of the example to be run using the data pointer provided. More...
 ExampleBase (string dataFilePath)
Construct a new instance of the example to be run using the data file provided. More...
 ExampleBase (string dataFilePath, ConfigHash *config)
Construct a new instance of the example to be run using the data file and configuration provided. More...
virtual  ~ExampleBase ()
Dispose of anything created with the example.
virtual void  run ()=0
Run the example.

Static Public Member Functions

static void  reportStatus (fiftyoneDegreesStatusCode status, const char *fileName)
Reports the status of the data file initialization. More...

Static Public Attributes

static const char *  mobileUserAgent
Example mobile User-Agent string.
static const char *  desktopUserAgent
Example desktop User-Agent string.
static const char *  uachPlatform
Example UACH Platform value.
static const char *  uachPlatformVersion
Example UACH Platform Version value.
static const char *  mediaHubUserAgent
Example media hub User-Agent string.

Static Protected Member Functions

static unsigned long  getHashCode (ResultsHash *results)
Get the hash code for all the values stored in the results instance. More...
static void  processUserAgent (const char *userAgent, void *state)
Processes a User-Agent string and hashes the results, adding to the hash in the thread state provided. More...

Protected Attributes

ConfigHash *  config
Configuration for the Engine.
RequiredPropertiesConfig *  properties
Properties to initialise the Engine with.
EngineHash *  engine
Hash Engine used for the example.

Constructor & Destructor Documentation

◆ ExampleBase() [1/3]

FiftyoneDegrees::Examples::Hash::ExampleBase::ExampleBase ( byte *   data,
long   length,
ConfigHash *   config  
)

Construct a new instance of the example to be run using the data pointer provided.

Parameters
data - pointer to the data set in memory
length - of the data in bytes
config - to configure the engine with

◆ ExampleBase() [2/3]

FiftyoneDegrees::Examples::Hash::ExampleBase::ExampleBase ( string   dataFilePath )

Construct a new instance of the example to be run using the data file provided.

Parameters
dataFilePath - path to the data file to use

◆ ExampleBase() [3/3]

FiftyoneDegrees::Examples::Hash::ExampleBase::ExampleBase ( string   dataFilePath,
ConfigHash *   config  
)

Construct a new instance of the example to be run using the data file and configuration provided.

Parameters
dataFilePath - path to the data file to use
config - to configure the engine with

Member Function Documentation

◆ getHashCode()

static unsigned long FiftyoneDegrees::Examples::Hash::ExampleBase::getHashCode ( ResultsHash *   results )
static protected

Get the hash code for all the values stored in the results instance.

Parameters
results - instance to hash
Returns
hash code for the results values

◆ processUserAgent()

static void FiftyoneDegrees::Examples::Hash::ExampleBase::processUserAgent ( const char *   userAgent,
void *   state  
)
static protected

Processes a User-Agent string and hashes the results, adding to the hash in the thread state provided.

Parameters
userAgent - the User-Agent to hash
state - pointer to a ExampleBase::ThreadState

◆ reportStatus()

static void FiftyoneDegrees::Examples::Hash::ExampleBase::reportStatus ( fiftyoneDegreesStatusCode   status,
const char *   fileName  
)
static

Reports the status of the data file initialization.

Parameters
status - associated with the initialisation
fileName - used for initialisation

The documentation for this class was generated from the following file:
  • /home/runner/work/device-detection-cxx/device-detection-cxx/common/device-detection-cxx/examples/CPP/Hash/ExampleBase.hpp