Home
About Us
Publications
Developers
Installation
Examples
Documentation
SomeWebsiteLogo
Home
About Us
Publications
Developers
Installation
Examples
Documentation
src
parallel
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
34
MessageTag::~MessageTag
()
35
{
36
if
(
_comm
)
37
_comm
->
dereference_unique_tag
(
_tagvalue
);
38
}
39
40
41
MessageTag::MessageTag
(
const
MessageTag
& other)
42
: _tagvalue(other._tagvalue), _comm(other._comm)
43
{
44
if
(
_comm
)
45
_comm
->
reference_unique_tag
(
_tagvalue
);
46
}
47
48
49
MessageTag::MessageTag
(
MessageTag
&& other)
50
: _tagvalue(other._tagvalue), _comm(other._comm)
51
{
52
// I stole your tag reference!
53
other._comm =
nullptr
;
54
}
55
56
57
MessageTag
&
MessageTag::operator=
(
const
MessageTag
& other)
58
{
59
if
(
_comm
)
60
_comm
->
dereference_unique_tag
(
_tagvalue
);
61
62
_tagvalue
= other.
_tagvalue
;
63
_comm
= other.
_comm
;
64
65
if
(
_comm
)
66
_comm
->
reference_unique_tag
(
_tagvalue
);
67
68
return
*
this
;
69
}
70
71
72
MessageTag
&
MessageTag::operator=
(
MessageTag
&& other)
73
{
74
if
(
_comm
)
75
_comm
->
dereference_unique_tag
(
_tagvalue
);
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
libMesh::Parallel::MessageTag::MessageTag
MessageTag(int tagvalue=invalid_tag)
Definition:
message_tag.h:60
message_tag.h
libMesh
Definition:
default_coupling.C:31
libMesh::Parallel::MessageTag
Definition:
message_tag.h:47
libMesh::Parallel::MessageTag::~MessageTag
~MessageTag()
Definition:
message_tag.C:34
libMesh::Parallel::Communicator::dereference_unique_tag
void dereference_unique_tag(int tagvalue) const
Definition:
communicator.C:44
libMesh::Parallel::MessageTag::_tagvalue
int _tagvalue
Definition:
message_tag.h:98
libMesh::Parallel::Communicator::reference_unique_tag
void reference_unique_tag(int tagvalue) const
Definition:
communicator.C:35
libMesh::Parallel::MessageTag::operator=
MessageTag & operator=(const MessageTag &other)
Definition:
message_tag.C:57
libMesh::Parallel::MessageTag::_comm
const Communicator * _comm
Definition:
message_tag.h:99
communicator.h
generated by