MGIS 3.1.0
Loading...
Searching...
No Matches
mgis::function::SharedSpace< SpaceType > Struct Template Reference

this class provides a way to encapsulate a space into a sharable object More...

#include </home/runner/work/MFrontGenericInterfaceSupport/MFrontGenericInterfaceSupport/include/MGIS/Function/SharedSpace.hxx>

Inheritance diagram for mgis::function::SharedSpace< SpaceType >:
mgis::PreconditionsChecker< SharedSpace< SpaceType > >

Public Member Functions

 SharedSpace (const std::shared_ptr< const SpaceType > &s)
 constructor, which checks the preconditions before building the object
template<bool doPreconditionChecks>
 SharedSpace (const PreconditionsCheck< doPreconditionChecks > &pcheck, const std::shared_ptr< const SpaceType > &s)
 constructor
 SharedSpace (SharedSpace &&)=default
 move constructor
 SharedSpace (const SharedSpace &)=default
 copy constructor
const SpaceType & operator* () const MGIS_NOEXCEPT
const SpaceType * get () const MGIS_NOEXCEPT

Static Public Member Functions

static bool checkPreconditions (AbstractErrorHandler &eh, const std::shared_ptr< const SpaceType > &s)
 checks the preconditions of the constructor, i.e. that the given pointer is not null

Detailed Description

template<SpaceConcept SpaceType>
struct mgis::function::SharedSpace< SpaceType >

this class provides a way to encapsulate a space into a sharable object

Such an object behaves exactly as the underlying space (it satisfies the same concepts) except for the areEquivalent function, which only states that two shared spaces are equivalent when they point to the same object.

Template Parameters
SpaceTypetype of the space encapsulated in the sharable object

Constructor & Destructor Documentation

◆ SharedSpace() [1/2]

template<SpaceConcept SpaceType>
mgis::function::SharedSpace< SpaceType >::SharedSpace ( const std::shared_ptr< const SpaceType > & s)
inline

constructor, which checks the preconditions before building the object

Parameters
[in]spointer to the space to encapsulate
Note
a contract violation is reported if the given pointer is null

◆ SharedSpace() [2/2]

template<SpaceConcept SpaceType>
template<bool doPreconditionChecks>
mgis::function::SharedSpace< SpaceType >::SharedSpace ( const PreconditionsCheck< doPreconditionChecks > & pcheck,
const std::shared_ptr< const SpaceType > & s )
inline

constructor

Template Parameters
doPreconditionChecksif true, the preconditions are checked, otherwise they are skipped
Parameters
[in]pchecktag stating if the preconditions are checked (preconditions_check) or skipped (no_precondition_check)
[in]spointer to the space to encapsulate

Member Function Documentation

◆ checkPreconditions()

template<SpaceConcept SpaceType>
bool mgis::function::SharedSpace< SpaceType >::checkPreconditions ( AbstractErrorHandler & eh,
const std::shared_ptr< const SpaceType > & s )
inlinestaticnodiscard

checks the preconditions of the constructor, i.e. that the given pointer is not null

Parameters
[in,out]eherror handler used to report the errors
[in]spointer to the space to encapsulate
Returns
false if the given pointer is null, true otherwise
Note
the "invalid space" error message is registered in the error handler when the given pointer is null

◆ get()

template<SpaceConcept SpaceType>
const SpaceType * mgis::function::SharedSpace< SpaceType >::get ( ) const
inline
Returns
a constant pointer to the encapsulated space

◆ operator*()

template<SpaceConcept SpaceType>
const SpaceType & mgis::function::SharedSpace< SpaceType >::operator* ( ) const
inline
Returns
a constant reference to the encapsulated space

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