Gazebo Physics

API Reference

2.6.2
Entity< PolicyT, FeaturesT > Class Template Reference

This is the base class of all "proxy objects". The "proxy objects" are essentially interfaces into the actual objects which exist inside of the various physics engine implementations. The proxy objects contain the minimal amount of data (e.g. a unique identifier, a reference-counter for the implementation object, and a reference to the implementation interface that it needs) necessary to interface with the object inside of the implementation that it refers to. More...

#include <Entity.hh>

Public Types

using Features = FeaturesT
 
using Pimpl = typename detail::DeterminePlugin< Policy, Features >::type
 
using Policy = PolicyT
 

Public Member Functions

virtual ~Entity ()=default
 Virtual destructor. More...
 
std::size_t EntityID () const
 Get the unique ID value of this Entity. More...
 
const std::shared_ptr< void > & EntityReference () const
 Get a reference-counting std::shared_ptr to the object inside the implementation that this object provides an abstraction for. More...
 
const Identity & FullIdentity () const
 Get the Identity object of this Entity. More...
 

Protected Member Functions

 Entity (const std::shared_ptr< Pimpl > &_pimpl=nullptr, const Identity &_identity=Identity())
 Constructor for the Entity. More...
 
 Entity (std::shared_ptr< Pimpl > &&_pimpl, const Identity &_identity)
 Constructor that allows the pimpl to be moved instead of copied. More...
 
template<typename FeatureT >
FeatureT::template Implementation< PolicyT > * Interface ()
 Get a pointer to the implementation of FeatureT. More...
 
template<typename FeatureT >
const FeatureT::template Implementation< PolicyT > * Interface () const
 Same as Interface(), but const-qualified so that const entities can request const-qualified interfaces from the implementation. More...
 

Protected Attributes

Identity identity
 This field contains information to identify the entity. More...
 
std::shared_ptr< Pimplpimpl
 This is a pointer to the physics engine implementation, and it can be used by the object features to find the interfaces that they need in order to function. More...
 

Detailed Description

template<typename PolicyT, typename FeaturesT>
class ignition::physics::Entity< PolicyT, FeaturesT >

This is the base class of all "proxy objects". The "proxy objects" are essentially interfaces into the actual objects which exist inside of the various physics engine implementations. The proxy objects contain the minimal amount of data (e.g. a unique identifier, a reference-counter for the implementation object, and a reference to the implementation interface that it needs) necessary to interface with the object inside of the implementation that it refers to.

Examples of entities are the Link class, Joint class, and Model class.

Member Typedef Documentation

◆ Features

using Features = FeaturesT

◆ Pimpl

using Pimpl = typename detail::DeterminePlugin<Policy, Features>::type

◆ Policy

using Policy = PolicyT

Constructor & Destructor Documentation

◆ Entity() [1/2]

Entity ( const std::shared_ptr< Pimpl > &  _pimpl = nullptr,
const Identity &  _identity = Identity() 
)
protected

Constructor for the Entity.

Parameters
[in]_pimplPointer to the implementation plugin for this entity
[in]_identityThe identity of this entity

◆ Entity() [2/2]

Entity ( std::shared_ptr< Pimpl > &&  _pimpl,
const Identity &  _identity 
)
protected

Constructor that allows the pimpl to be moved instead of copied.

Parameters
[in]_pimplPointer to the implementation plugin for this entity
[in]_identityThe identity of this entity
See also
Entity(const std::shared_ptr<Pimpl>&, const Identity&)

◆ ~Entity()

virtual ~Entity ( )
virtualdefault

Virtual destructor.

Member Function Documentation

◆ EntityID()

std::size_t EntityID ( ) const

Get the unique ID value of this Entity.

◆ EntityReference()

const std::shared_ptr<void>& EntityReference ( ) const

Get a reference-counting std::shared_ptr to the object inside the implementation that this object provides an abstraction for.

◆ FullIdentity()

const Identity& FullIdentity ( ) const

Get the Identity object of this Entity.

◆ Interface() [1/2]

FeatureT::template Implementation<PolicyT>* Interface ( )
protected

Get a pointer to the implementation of FeatureT.

This is a convenience function so that entities don't have to query for interfaces on their pimpl object.

Returns
A pointer to the implementation of FeatureT, or a nullptr if FeatureT is not available.

◆ Interface() [2/2]

const FeatureT::template Implementation<PolicyT>* Interface ( ) const
protected

Same as Interface(), but const-qualified so that const entities can request const-qualified interfaces from the implementation.

Returns
A pointer to a const-qualified implementation of F, or a nullptr if F is not available.

Member Data Documentation

◆ identity

Identity identity
protected

This field contains information to identify the entity.

Referenced by ForwardStep::World< PolicyT, FeaturesT >::Step().

◆ pimpl

std::shared_ptr<Pimpl> pimpl
protected

This is a pointer to the physics engine implementation, and it can be used by the object features to find the interfaces that they need in order to function.


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