message_tag.C
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2018 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 // Local includes
19 #include "libmesh/message_tag.h"
20 
21 #include "libmesh/communicator.h"
22 
23 
24 
25 namespace libMesh
26 {
27 
28 namespace Parallel
29 {
30 
31 // ------------------------------------------------------------
32 // MessageTag member functions
33 
35 {
36  if (_comm)
38 }
39 
40 
42  : _tagvalue(other._tagvalue), _comm(other._comm)
43 {
44  if (_comm)
46 }
47 
48 
50  : _tagvalue(other._tagvalue), _comm(other._comm)
51 {
52  // I stole your tag reference!
53  other._comm = nullptr;
54 }
55 
56 
58 {
59  if (_comm)
61 
62  _tagvalue = other._tagvalue;
63  _comm = other._comm;
64 
65  if (_comm)
67 
68  return *this;
69 }
70 
71 
73 {
74  if (_comm)
76 
77  _tagvalue = other._tagvalue;
78  _comm = other._comm;
79 
80  // I stole your tag reference!
81  other._comm = nullptr;
82 
83  return *this;
84 }
85 
86 
87 } // namespace Parallel
88 
89 } // namespace libMesh
MessageTag(int tagvalue=invalid_tag)
Definition: message_tag.h:60
void dereference_unique_tag(int tagvalue) const
Definition: communicator.C:44
void reference_unique_tag(int tagvalue) const
Definition: communicator.C:35
MessageTag & operator=(const MessageTag &other)
Definition: message_tag.C:57
const Communicator * _comm
Definition: message_tag.h:99