◆ ResultsBase()
FiftyoneDegrees::Common::ResultsBase::ResultsBase | ( | fiftyoneDegreesResultsBase * | results, |
shared_ptr< fiftyoneDegreesResourceManager > | manager | ||
) |
Create a new instance of Results from the results structure provided.
This method should only be called from inside an engine's process method.
- Parameters
-
- results - pointer to the underlying results structure
- manager - shared pointer to the manager which manages the data set used to create the results. This is needed for thread-safe operation, see local variable description for more info.
Member Function Documentation
◆ containsProperty()
bool FiftyoneDegrees::Common::ResultsBase::containsProperty ( const string & propertyName ) const Get whether or not this results instance contains a value for the requested property.
- Parameters
-
- propertyName - name of the property to check for
- Returns
- true if there is a value for the requested property
◆ getAvailableProperties()
int FiftyoneDegrees::Common::ResultsBase::getAvailableProperties ( ) const Get the number of available properties contained in the Results instance.
- Returns
- the number of available properties
◆ getNoValueMessageInternal()
virtual const char* FiftyoneDegrees::Common::ResultsBase::getNoValueMessageInternal ( fiftyoneDegreesResultsNoValueReason reason ) protected pure virtualGet the message explaining the reason for missing values.
This can differ slightly between APIs, so the implementation of this is left up to the extending class. This is used when populating a Value instance to return.
- Parameters
-
- reason - the enum indicating the reason no values are available
- Returns
- string explaining the reason in more detail
Implemented in FiftyoneDegrees::DeviceDetection::Hash::ResultsHash.
◆ getNoValueReasonInternal()
virtual fiftyoneDegreesResultsNoValueReason FiftyoneDegrees::Common::ResultsBase::getNoValueReasonInternal ( int requiredPropertyIndex ) protected pure virtualGet the reason for values not being available.
This is implemented by the extending class and is called when the hasValuesInternal method returns false.
- Parameters
-
- requiredPropertyIndex - index in the available properties
- Returns
- enum indicating the reason for values not being available
Implemented in FiftyoneDegrees::DeviceDetection::Hash::ResultsHash.
◆ getProperties()
vector<string> FiftyoneDegrees::Common::ResultsBase::getProperties ( ) const Get the names of the properties which are available in the Results instance.
The index of the property in the vector indicates its index in the Results instance, so a name's index can be used to fetch its corresponding value via a get method.
- Returns
- vector containing the names of all available properties
◆ getPropertyName()
string FiftyoneDegrees::Common::ResultsBase::getPropertyName ( int requiredPropertyIndex ) const Get the name of the property at the require property index, or an empty string if the required property index is invalid.
- Parameters
-
- requiredPropertyIndex - of the property name required
- Returns
- the name of the property, or an empty string if not valid
◆ getRequiredPropertyIndex()
int FiftyoneDegrees::Common::ResultsBase::getRequiredPropertyIndex ( const char * propertyName ) protectedGet the index in the available properties for the property name provided.
- Returns
- 0 based index or -1 if not found
◆ getValueAsBool() [1/4]
Value<bool> FiftyoneDegrees::Common::ResultsBase::getValueAsBool ( const char * propertyName ) Get a boolean representation of the value associated with the required property name.
If the property name is not valid then false is returned.
- Parameters
-
- propertyName - string containing the property name
- Returns
- a boolean representation of the value for the property
- Examples
- Hash/StronglyTyped.cpp.
◆ getValueAsBool() [2/4]
Value<bool> FiftyoneDegrees::Common::ResultsBase::getValueAsBool ( const string & propertyName ) Get a boolean representation of the value associated with the required property name.
If the property name is not valid then false is returned.
- Parameters
-
- propertyName - string containing the property name
- Returns
- a boolean representation of the value for the property
◆ getValueAsBool() [3/4]
Value<bool> FiftyoneDegrees::Common::ResultsBase::getValueAsBool ( const string * propertyName ) Get a boolean representation of the value associated with the required property name.
If the property name is not valid then false is returned.
- Parameters
-
- propertyName - string containing the property name
- Returns
- a boolean representation of the value for the property
◆ getValueAsBool() [4/4]
virtual Value<bool> FiftyoneDegrees::Common::ResultsBase::getValueAsBool ( int requiredPropertyIndex ) virtualGet a boolean representation of the value associated with the required property index.
If the property index is not valid then false is returned.
- Parameters
-
- requiredPropertyIndex - in the required properties
- Returns
- a boolean representation of the value for the property
◆ getValueAsDouble() [1/4]
Value<double> FiftyoneDegrees::Common::ResultsBase::getValueAsDouble ( const char * propertyName ) Get a double representation of the value associated with the required property name.
If the property name is not valid then 0 is returned. Using a property which returns non-numeric characters will result in unexpected behavior.
- Parameters
-
- propertyName - string containing the property name
- Returns
- a double representation of the value for the property
◆ getValueAsDouble() [2/4]
Value<double> FiftyoneDegrees::Common::ResultsBase::getValueAsDouble ( const string & propertyName ) Get a double representation of the value associated with the required property name.
If the property name is not valid then 0 is returned. Using a property which returns non-numeric characters will result in unexpected behavior.
- Parameters
-
- propertyName - string containing the property name
- Returns
- a double representation of the value for the property
◆ getValueAsDouble() [3/4]
Value<double> FiftyoneDegrees::Common::ResultsBase::getValueAsDouble ( const string * propertyName ) Get a double representation of the value associated with the required property name.
If the property name is not valid then 0 is returned. Using a property which returns non-numeric characters will result in unexpected behavior.
- Parameters
-
- propertyName - string containing the property name
- Returns
- a double representation of the value for the property
◆ getValueAsDouble() [4/4]
virtual Value<double> FiftyoneDegrees::Common::ResultsBase::getValueAsDouble ( int requiredPropertyIndex ) virtualGet a double representation of the value associated with the required property index.
If the property index is not valid then 0 is returned. Using a property which returns non-numeric characters will result in unexpected behavior.
- Parameters
-
- requiredPropertyIndex - in the required properties
- Returns
- a double representation of the value for the property
◆ getValueAsInteger() [1/4]
Value<int> FiftyoneDegrees::Common::ResultsBase::getValueAsInteger ( const char * propertyName ) Get an integer representation of the value associated with the required property name.
If the property name is not valid then 0 is returned. Using a property which returns non-numeric characters will result in unexpected behavior.
- Parameters
-
- propertyName - string containing the property name
- Returns
- an integer representation of the value for the property
◆ getValueAsInteger() [2/4]
Value<int> FiftyoneDegrees::Common::ResultsBase::getValueAsInteger ( const string & propertyName ) Get an integer representation of the value associated with the required property name.
If the property name is not valid then 0 is returned. Using a property which returns non-numeric characters will result in unexpected behavior.
- Parameters
-
- propertyName - string containing the property name
- Returns
- an integer representation of the value for the property
◆ getValueAsInteger() [3/4]
Value<int> FiftyoneDegrees::Common::ResultsBase::getValueAsInteger ( const string * propertyName ) Get an integer representation of the value associated with the required property name.
If the property name is not valid then 0 is returned. Using a property which returns non-numeric characters will result in unexpected behavior.
- Parameters
-
- propertyName - string containing the property name
- Returns
- an integer representation of the value for the property
◆ getValueAsInteger() [4/4]
virtual Value<int> FiftyoneDegrees::Common::ResultsBase::getValueAsInteger ( int requiredPropertyIndex ) virtualGet an integer representation of the value associated with the required property index.
If the property index is not valid then 0 is returned. Using a property which returns non-numeric characters will result in unexpected behavior.
- Parameters
-
- requiredPropertyIndex - in the required properties
- Returns
- an integer representation of the value for the property
◆ getValueAsString() [1/4]
Value<string> FiftyoneDegrees::Common::ResultsBase::getValueAsString ( const char * propertyName ) Get a string representation of the value associated with the required property name.
If the property name is not valid an empty string is returned. If the property relates to a list with more than one value then values are separated by '|' characters.
- Parameters
-
- propertyName - string containing the property name
- Returns
- a string representation of the value for the property
- Examples
- Hash/GettingStarted.cpp, and Hash/MatchMetrics.cpp.
◆ getValueAsString() [2/4]
Value<string> FiftyoneDegrees::Common::ResultsBase::getValueAsString ( const string & propertyName ) Get a string representation of the value associated with the required property name.
If the property name is not valid an empty string is returned. If the property relates to a list with more than one value then values are separated by '|' characters.
- Parameters
-
- propertyName - string containing the property name
- Returns
- a string representation of the value for the property
◆ getValueAsString() [3/4]
Value<string> FiftyoneDegrees::Common::ResultsBase::getValueAsString ( const string * propertyName ) Get a string representation of the value associated with the required property name.
If the property name is not valid an empty string is returned. If the property relates to a list with more than one value then values are separated by '|' characters.
- Parameters
-
- propertyName - string containing the property name
- Returns
- a string representation of the value for the property
◆ getValueAsString() [4/4]
virtual Value<string> FiftyoneDegrees::Common::ResultsBase::getValueAsString ( int requiredPropertyIndex ) virtualGet a string representation of the value associated with the required property index.
If the index is not valid an empty string is returned. If the property relates to a list with more than one value then values are separated by '|' characters.
- Parameters
-
- requiredPropertyIndex - of the property required
- Returns
- a string representation of the value for the property or an empty string
◆ getValues() [1/4]
Value<vector<string> > FiftyoneDegrees::Common::ResultsBase::getValues ( const char * propertyName ) Get a vector with all values associated with the required property name.
If the name is not valid an empty vector is returned.
- Parameters
-
- propertyName - pointer to a string containing the property name
- Returns
- a vector of values for the property
◆ getValues() [2/4]
Value<vector<string> > FiftyoneDegrees::Common::ResultsBase::getValues ( const string & propertyName ) Get a vector with all values associated with the required property name.
If the name is not valid an empty vector is returned.
- Parameters
-
- propertyName - pointer to a string containing the property name
- Returns
- a vector of values for the property
◆ getValues() [3/4]
Value<vector<string> > FiftyoneDegrees::Common::ResultsBase::getValues ( const string * propertyName ) Get a vector with all values associated with the required property name.
If the name is not valid an empty vector is returned.
- Parameters
-
- propertyName - pointer to a string containing the property name
- Returns
- a vector of values for the property
◆ getValues() [4/4]
Value<vector<string> > FiftyoneDegrees::Common::ResultsBase::getValues ( int requiredPropertyIndex ) Get a vector with all values associated with the required property index.
If the index is not valid an empty vector is returned.
- Parameters
-
- requiredPropertyIndex - of the property required
- Returns
- a vector of values for the property
◆ getValuesInternal()
virtual void FiftyoneDegrees::Common::ResultsBase::getValuesInternal ( int requiredPropertyIndex, vector< string > & values ) protected pure virtualGet the values for the index in required properties and add them to the values vector supplied.
This is implemented by extending classes.
- Parameters
-
- requiredPropertyIndex - index in the available properties
- values - vector to populate with the values for the property
Implemented in FiftyoneDegrees::DeviceDetection::Hash::ResultsHash.
◆ hasValuesInternal()
virtual bool FiftyoneDegrees::Common::ResultsBase::hasValuesInternal ( int requiredPropertyIndex ) protected pure virtualGet whether or not there are valid values available for the property identified by its index in the required properties.
This is implemented by extending classes, and used when populating a Value instance to return.
- Parameters
-
- requiredPropertyIndex - index in the available properties
- Returns
- true if there are values available for the property
Implemented in FiftyoneDegrees::DeviceDetection::Hash::ResultsHash.
Field Documentation
◆ available
fiftyoneDegreesPropertiesAvailable* FiftyoneDegrees::Common::ResultsBase::available protectedPointer to the underlying available properties structure.
The documentation for this class was generated from the following file:- /home/vsts/work/1/s/apis/device-detection-cxx/src/common-cxx/ResultsBase.hpp