WRApplication
External kratos "application" for multiscale time integration.
EntityProxy< TLocation, TMutable > Class Template Reference

Wrapper class providing a uniform interface for historical/non-historical Node, Element, and Condition. More...

Collaboration diagram for EntityProxy< TLocation, TMutable >:

Public Member Functions

 EntityProxy () noexcept=default
 Default constructor that leaves the instance in an invalid state. More...
 
 EntityProxy (QualifiedEntity &rEntity) noexcept
 Constructor creating a valid proxy, wrapping the input entity. More...
 
template<class TValue >
bool HasValue (const Variable< TValue > &rVariable) const noexcept
 Check whether the entity has a value for the provided variable. More...
 
template<class TValue >
std::conditional_t< std::is_integral_v< TValue >||std::is_floating_point_v< TValue >, TValue, const TValue & > GetValue (const Variable< TValue > &rVariable) const
 Fetch the value corresponding to the input variable in the wrapped entity. More...
 
template<class TValue , std::enable_if_t<!std::is_same_v< TValue, void > &&TMutable, bool > = true>
TValue & GetValue (const Variable< TValue > &rVariable)
 Fetch the value corresponding to the input variable in the wrapped entity. More...
 
template<class TValue , std::enable_if_t<!std::is_same_v< TValue, void > &&TMutable, bool > = true>
void SetValue (const Variable< TValue > &rVariable, std::conditional_t< std::is_integral_v< TValue >||std::is_floating_point_v< TValue >, TValue, const TValue & > Value)
 Overwrite the value corresponding to the input variable in the wrapped entity. More...
 
const UnqualifiedEntity & GetEntity () const
 Immutable access to the wrapped entity. More...
 
QualifiedEntity & GetEntity ()
 Mutable or immutable access to the wrapped entity, depending on TMutable. More...
 

Friends

class ContainerProxy< EntityProxy >
 ContainerProxy needs to access private typedefs. More...
 

Detailed Description

template<Globals::DataLocation TLocation, bool TMutable>
class Kratos::WRApp::EntityProxy< TLocation, TMutable >

Wrapper class providing a uniform interface for historical/non-historical Node, Element, and Condition.

EntityProxy exposes common functionality related accessing stored Variable s within an entity, without additional runtime overhead. In this context, an entity can refer to:

  • a Node with historical variables (Globals::DataLocation::NodeHistorical)
  • a Node with non-historical variables (Globals::DataLocation::NodeNonHistorical)
  • an Element (Globals::DataLocation::Element)
  • a Condition (Globals::DataLocation::Condition) The exposed common functionalities include checking, reading and overwriting the values related to the provided variables associated with the entity.
    Warning
    Default constructed EntityProxy instances are in an invalid state, and their member functions must not be called.
    Exceptions
    ifmember functions of a default constructed instance are called.

Constructor & Destructor Documentation

◆ EntityProxy() [1/2]

EntityProxy ( )
defaultnoexcept

Default constructor that leaves the instance in an invalid state.

Exceptions
ifany member function is called without reassigning this instance with a valid one.

◆ EntityProxy() [2/2]

EntityProxy ( QualifiedEntity &  rEntity)
inlinenoexcept

Constructor creating a valid proxy, wrapping the input entity.

Parameters
rEntityEntity that will be accessed when member functions are called.
Warning
This proxy is invalidated when the container holding rEntity invalidates its iterators or when rEntity is destroyed.

Member Function Documentation

◆ GetEntity() [1/2]

QualifiedEntity& GetEntity ( )
inline

Mutable or immutable access to the wrapped entity, depending on TMutable.

◆ GetEntity() [2/2]

const UnqualifiedEntity& GetEntity ( ) const
inline

Immutable access to the wrapped entity.

◆ GetValue() [1/2]

TValue& GetValue ( const Variable< TValue > &  rVariable)
inline

Fetch the value corresponding to the input variable in the wrapped entity.

◆ GetValue() [2/2]

std::conditional_t<std::is_integral_v<TValue> || std::is_floating_point_v<TValue>, TValue, const TValue&> GetValue ( const Variable< TValue > &  rVariable) const
inline

Fetch the value corresponding to the input variable in the wrapped entity.

◆ HasValue()

bool HasValue ( const Variable< TValue > &  rVariable) const
inlinenoexcept

Check whether the entity has a value for the provided variable.

◆ SetValue()

void SetValue ( const Variable< TValue > &  rVariable,
std::conditional_t< std::is_integral_v< TValue >||std::is_floating_point_v< TValue >, TValue, const TValue & >  Value 
)
inline

Overwrite the value corresponding to the input variable in the wrapped entity.

Friends And Related Function Documentation

◆ ContainerProxy< EntityProxy >

friend class ContainerProxy< EntityProxy >
friend

ContainerProxy needs to access private typedefs.


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