KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
Public Member Functions | List of all members
Kratos::SetIdentityFunction< TDataType > Class Template Reference

A functor that serves as the identity function. More...

#include <set_identity_function.h>

Collaboration diagram for Kratos::SetIdentityFunction< TDataType >:

Public Member Functions

TDataType & operator() (TDataType &data)
 Operator that returns a non-const reference to the input object. More...
 
const TDataType & operator() (const TDataType &data) const
 Operator that returns a const reference to the input object. More...
 

Detailed Description

template<class TDataType>
class Kratos::SetIdentityFunction< TDataType >

A functor that serves as the identity function.

This class provides two overloaded operator() functions, one for non-const objects and another for const objects. The operator() returns the input object as it is, effectively acting as an identity function. The purpose of this functor is to allow objects to be used as keys in sets or other containers that require comparison. By using this functor, you can avoid defining custom comparison functions or operators when the object itself can be considered for comparison.

Template Parameters
TDataTypeThe data type of the object that the functor operates on.
Author
Pooyan Dadvand

Member Function Documentation

◆ operator()() [1/2]

template<class TDataType >
const TDataType& Kratos::SetIdentityFunction< TDataType >::operator() ( const TDataType &  data) const
inline

Operator that returns a const reference to the input object.

Parameters
dataThe input object of type TDataType.
Returns
A const reference to the same object as provided in the parameter.

◆ operator()() [2/2]

template<class TDataType >
TDataType& Kratos::SetIdentityFunction< TDataType >::operator() ( TDataType &  data)
inline

Operator that returns a non-const reference to the input object.

Parameters
dataThe input object of type TDataType.
Returns
A non-const reference to the same object as provided in the parameter.

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