Gazebo Physics

API Reference

6.7.0

RequireData is an extension of ExpectData which indicates that the composite requires the existence of any data types that are listed in its template arguments. More...

#include <SpecifyData.hh>

Public Types

using RequiredData = Required
 
using Specification = RequireData< Required >
 

Public Member Functions

 RequireData ()
 Default constructor. Will initialize the Required data type using its default constructor. More...
 
virtual ~RequireData ()=default
 Virtual destructor. More...
 
template<typename Data >
const Data & Get () const
 Provides extremely high-speed const-qualified reference access to data types that are required. More...
 

Static Public Member Functions

template<typename Data >
static constexpr bool AlwaysRequires ()
 Returns true if the Data type is always required by this more highly specified CompositeData type. More...
 

Protected Attributes

detail::PrivateRequireData< Required > privateRequireData
 Provides the implementation for delegating the functions provided by the RequireData class. More...
 

Detailed Description

template<typename Required>
class gz::physics::RequireData< Required >

RequireData is an extension of ExpectData which indicates that the composite requires the existence of any data types that are listed in its template arguments.

Each data type that is listed in the template arguments will be instantiated upon construction of the RequireData<DataTypes> object, and none of them can be removed from that object or from any reference to that object.

Objects that are listed in the template arguments will also benefit from extremely high-speed accessibility when they are accessed using an object of the type RequireData<T>. This is similar to ExpectData<T>.

RequireData<R> also offers a const-qualified Get<R>() function.

This template specialization implements RequireData for a single type, but the RequireData template can accept any number of types, e.g. RequireData<T, U, V, W>.

Member Typedef Documentation

◆ RequiredData

using RequiredData = Required

◆ Specification

using Specification = RequireData<Required>

Constructor & Destructor Documentation

◆ RequireData()

RequireData ( )

Default constructor. Will initialize the Required data type using its default constructor.

◆ ~RequireData()

virtual ~RequireData ( )
virtualdefault

Virtual destructor.

Member Function Documentation

◆ AlwaysRequires()

static constexpr bool AlwaysRequires ( )
staticconstexpr

Returns true if the Data type is always required by this more highly specified CompositeData type.

◆ Get()

const Data& Get ( ) const

Provides extremely high-speed const-qualified reference access to data types that are required.

NOTE: For data types that are not required, this will throw a compilation error, and you should use Query<Data>() const instead.

See also
CompositeData::Get()

Member Data Documentation

◆ privateRequireData

detail::PrivateRequireData<Required> privateRequireData
protected

Provides the implementation for delegating the functions provided by the RequireData class.


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