51Degrees Device Detection C/C++  4.1

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

FiftyoneDegrees::Common::RequiredPropertiesConfig Class Reference

Detailed Description

C++ class wrapper for the fiftyoneDegreesPropertiesRequired structure.

It defines a set of properties which are required by a caller, usually to a data set constructor.

An instance is immutable once instantiated.

Usage Example

using namespace FiftyoneDegrees::Common;
ConfigBase *config;
// Construct a required properties configuration with a list of
// required properties
new RequiredPropertiesConfig("a property, another property");
// Use the required properties configuration when constructing an
// engine
EngineBase *engine = new EngineBase(config, properties);
Examples
Hash/GettingStarted.cpp, Hash/MatchMetrics.cpp, Hash/MetaData.cpp, and Hash/StronglyTyped.cpp.

Public Member Functions

bool  containsProperty (const char *property)
Get whether or not the property name supplied is contained in the required properties configuration. More...
bool  containsProperty (const string property)
Get whether or not the property name supplied is contained in the required properties configuration. More...

Constructors and Destructors

 RequiredPropertiesConfig ()
Constructs a new instance of the RequiredPropertiesConfig so that all possible properties contained in the data are available for inspection.
 RequiredPropertiesConfig (const vector< string > *properties)
Construct a new instance of required RequiredPropertiesConfig using the list of property names supplied. More...
 RequiredPropertiesConfig (vector< string > *properties)
Construct a new instance of required RequiredPropertiesConfig using the list of property names supplied. More...
 RequiredPropertiesConfig (const char *properties)
Construct a new instance of required RequiredPropertiesConfig using the list of property names supplied. More...
 RequiredPropertiesConfig (const string &properties)
Construct a new instance of required RequiredPropertiesConfig using the list of property names supplied. More...
 RequiredPropertiesConfig (const string *properties)
Construct a new instance of required RequiredPropertiesConfig using the list of property names supplied. More...
virtual  ~RequiredPropertiesConfig ()
Destroy the configuration, freeing all the memory allocated within it.

Getters

vector< string >  getProperties ()
Get the list of properties which are required. More...
fiftyoneDegreesPropertiesRequired *  getConfig ()
Get a pointer to the underlying C required properties structure. More...
int  getCount ()
Get the number of properties contained within the required properties configuration. More...

Constructor & Destructor Documentation

◆ RequiredPropertiesConfig() [1/5]

FiftyoneDegrees::Common::RequiredPropertiesConfig::RequiredPropertiesConfig ( const vector< string > *   properties )

Construct a new instance of required RequiredPropertiesConfig using the list of property names supplied.

Once created, properties cannot be added.

Parameters
properties - to enable

◆ RequiredPropertiesConfig() [2/5]

FiftyoneDegrees::Common::RequiredPropertiesConfig::RequiredPropertiesConfig ( vector< string > *   properties )

Construct a new instance of required RequiredPropertiesConfig using the list of property names supplied.

Once created, properties cannot be added.

Parameters
properties - to enable

◆ RequiredPropertiesConfig() [3/5]

FiftyoneDegrees::Common::RequiredPropertiesConfig::RequiredPropertiesConfig ( const char *   properties )

Construct a new instance of required RequiredPropertiesConfig using the list of property names supplied.

Once created, properties cannot be added.

Parameters
properties - to enable

◆ RequiredPropertiesConfig() [4/5]

FiftyoneDegrees::Common::RequiredPropertiesConfig::RequiredPropertiesConfig ( const string &   properties )

Construct a new instance of required RequiredPropertiesConfig using the list of property names supplied.

Once created, properties cannot be added.

Parameters
properties - to enable

◆ RequiredPropertiesConfig() [5/5]

FiftyoneDegrees::Common::RequiredPropertiesConfig::RequiredPropertiesConfig ( const string *   properties )

Construct a new instance of required RequiredPropertiesConfig using the list of property names supplied.

Once created, properties cannot be added.

Parameters
properties - to enable

Member Function Documentation

◆ containsProperty() [1/2]

bool FiftyoneDegrees::Common::RequiredPropertiesConfig::containsProperty ( const char *   property )

Get whether or not the property name supplied is contained in the required properties configuration.

Parameters
property - name of the property to find
Returns
true if the property name is present

◆ containsProperty() [2/2]

bool FiftyoneDegrees::Common::RequiredPropertiesConfig::containsProperty ( const string   property )

Get whether or not the property name supplied is contained in the required properties configuration.

Parameters
property - name of the property to find
Returns
true if the property name is present

◆ getConfig()

fiftyoneDegreesPropertiesRequired* FiftyoneDegrees::Common::RequiredPropertiesConfig::getConfig ( )

Get a pointer to the underlying C required properties structure.

This is a pointer memory internal to this class, so should not be freed.

Returns
required properties config

◆ getCount()

int FiftyoneDegrees::Common::RequiredPropertiesConfig::getCount ( )

Get the number of properties contained within the required properties configuration.

Returns
number of properties

◆ getProperties()

vector<string> FiftyoneDegrees::Common::RequiredPropertiesConfig::getProperties ( )

Get the list of properties which are required.

Returns
vector containing the property names

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