Ignition Physics

API Reference

5.1.0
FeatureList< FeaturesT > Struct Template Reference

Use a FeatureList to aggregate a list of Features. More...

#include <FeatureList.hh>

Public Types

using Features = typename detail::CombineLists< FeaturesT... >::Result
 
using FeatureTuple = std::tuple< FeaturesT... >
 
using RequiredFeatures = void
 All the features required by this FeatureList will be included in CombineLists. More...
 

Static Public Member Functions

template<typename SomeFeatureList , bool AssertNoConflict = false>
static constexpr bool ConflictsWith ()
 A static constexpr function which indicates whether any features in SomeFeatureList conflict with any features in SomeFeatureList. More...
 
template<typename F >
static constexpr bool HasFeature ()
 A static constexpr function which indicates whether a given Feature, F, is contained in this list. More...
 

Detailed Description

template<typename... FeaturesT>
struct ignition::physics::FeatureList< FeaturesT >

Use a FeatureList to aggregate a list of Features.

FeatureLists can be constructed in hierarchies, e.g. a FeatureList can be passed into another FeatureList, and the set of all features in the new list will be the sum.

// FeatureA, FeatureB, AdvancedA, and AdvancedB are all feature classes.
using BasicList = FeatureList<FeatureA, FeatureB>;
using AdvancedList = FeatureList<BasicList, AdvancedA, AdvancedB>;

Member Typedef Documentation

◆ Features

using Features = typename detail::CombineLists<FeaturesT...>::Result

Features is a std::tuple containing all the feature classes that are bundled in this list. This list is fully seralialized; any hierarchy that was used to construct this FeatureList will be collapsed in this member.

◆ FeatureTuple

using FeatureTuple = std::tuple<FeaturesT...>

◆ RequiredFeatures

using RequiredFeatures = void

All the features required by this FeatureList will be included in CombineLists.

Member Function Documentation

◆ ConflictsWith()

static constexpr bool ConflictsWith ( )
static

A static constexpr function which indicates whether any features in SomeFeatureList conflict with any features in SomeFeatureList.

Template Parameters
SomeFeatureListThe list to compare against for conflicts.
AssertNoConflictSetting this to true will result in a static_assert if a conflict is found. That way, if a conflict exists, you will get a compilation error, and the compilation error will tell you which feature is conflicting.
Returns
true if any features in SomeFeatureList conflict with this list or vice versa.

◆ HasFeature()

static constexpr bool HasFeature ( )
static

A static constexpr function which indicates whether a given Feature, F, is contained in this list.

Template Parameters
FThe feature class to check for in this FeatureList
Returns
true if F is in this FeatureList; false otherwise.

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