Arcane  v3.16.0.0
Documentation développeur
Tout Classes Espaces de nommage Fichiers Fonctions Variables Définitions de type Énumérations Valeurs énumérées Amis Macros Groupes Pages Concepts
AMRTransportFunctor.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2022 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* FunctorAMRTansport.h (C) 2000-2022 */
9/* */
10/* Fonctor avec deux arguments. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_UTILS_FUNCTORAMRTRANSPORT_H
13#define ARCANE_UTILS_FUNCTORAMRTRANSPORT_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/IAMRTransportFunctor.h"
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
31template<typename ClassType>
34{
35 public:
36
37 typedef void (ClassType::*FuncPtr)(Array<ItemInternal*>& , AMROperationType);
38 typedef void (ClassType::*FuncPtr2)(Array<Cell>& , AMROperationType);
39 public:
40
42 AMRTransportFunctorT(ClassType* object,FuncPtr funcptr)
43 : m_object(object), m_function(funcptr) {}
44
45 AMRTransportFunctorT(ClassType* object,FuncPtr2 funcptr2)
46 : m_object(object), m_function2(funcptr2) {}
47
48 protected:
49
51 void executeFunctor(Array<ItemInternal*>& old_cells,AMROperationType op)
52 {
53 (m_object->*m_function)(old_cells,op);
54 }
55
56 void executeFunctor(Array<Cell>& old_cells,AMROperationType op)
57 {
58 (m_object->*m_function2)(old_cells,op);
59 }
60
61 private:
62
63 ClassType* m_object = nullptr;
64 FuncPtr m_function = nullptr;
66};
67
68/*---------------------------------------------------------------------------*/
69/*---------------------------------------------------------------------------*/
70
71} // End namespace Arcane
72
73/*---------------------------------------------------------------------------*/
74/*---------------------------------------------------------------------------*/
75
76#endif
AMRTransportFunctorT(ClassType *object, FuncPtr funcptr)
Constructeur.
void executeFunctor(Array< ItemInternal * > &old_cells, AMROperationType op)
Exécute la méthode associé
ClassType * m_object
Objet associé.
void executeFunctor(Array< Cell > &old_cells, AMROperationType op)
Exécute la méthode associé
FuncPtr2 m_function2
Pointeur vers la méthode associée.
void(ClassType::* FuncPtr)(Array< ItemInternal * > &, AMROperationType)
Type du pointeur sur la méthode.
void(ClassType::* FuncPtr2)(Array< Cell > &, AMROperationType)
Type du pointeur sur la méthode.
FuncPtr m_function
Pointeur vers la méthode associée.
Tableau d'items de types quelconques.
Interface d'un fonctor avec argument.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-