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);
C++ class wrapper for the fiftyoneDegreesConfigBase configuration structure.
Definition ConfigBase.hpp:61
Encapsulates the engine class to be extended by engine implementations.
Definition EngineBase.hpp:78
RequiredPropertiesConfig()
Constructs a new instance of the RequiredPropertiesConfig so that all possible properties contained i...
Shared classes.
Definition Collection.hpp:31
Examples
Hash/GettingStarted.cpp, Hash/MatchMetrics.cpp, Hash/MetaData.cpp, and Hash/StronglyTyped.cpp.

Public Member Functions

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

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.
 RequiredPropertiesConfig (vector< string > *properties)
 Construct a new instance of required RequiredPropertiesConfig using the list of property names supplied.
 RequiredPropertiesConfig (const char *properties)
 Construct a new instance of required RequiredPropertiesConfig using the list of property names supplied.
 RequiredPropertiesConfig (const string &properties)
 Construct a new instance of required RequiredPropertiesConfig using the list of property names supplied.
 RequiredPropertiesConfig (const string *properties)
 Construct a new instance of required RequiredPropertiesConfig using the list of property names supplied.
virtual ~RequiredPropertiesConfig ()
 Destroy the configuration, freeing all the memory allocated within it.

Getters

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

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
propertiesto 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
propertiesto 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
propertiesto 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
propertiesto 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
propertiesto enable

Member Function Documentation

◆ containsProperty() [1/2]

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

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

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

◆ containsProperty() [2/2]

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

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

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

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

Returns
number of properties

◆ getProperties()

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

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: