UIPread.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Description
25  Read from UIPstream
26 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "UIPstream.H"
30 
31 // * * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * //
32 
34 (
35  const commsTypes commsType,
36  const int fromProcNo,
37  DynamicList<char>& externalBuf,
38  label& externalBufPosition,
39  const int tag,
40  const label comm,
41  const bool clearAtEnd,
42  streamFormat format,
43  versionNumber version
44 )
45 :
46  UPstream(commsType),
47  Istream(format, version),
48  fromProcNo_(fromProcNo),
49  externalBuf_(externalBuf),
50  externalBufPosition_(externalBufPosition),
51  tag_(tag),
52  comm_(comm),
53  clearAtEnd_(clearAtEnd),
54  messageSize_(0)
55 {
57  (
58  "UIPstream::UIPstream\n"
59  "(\n"
60  "const commsTypes,\n"
61  "const int,\n"
62  "DynamicList<char>&,\n"
63  "label&,\n"
64  "const int,\n"
65  "const label,\n"
66  "const bool,\n"
67  "streamFormat,\n"
68  "versionNumber\n"
69  ")"
70  );
71 }
72 
73 
74 Foam::UIPstream::UIPstream(const int fromProcNo, PstreamBuffers& buffers)
75 :
76  UPstream(buffers.commsType_),
77  Istream(buffers.format_, buffers.version_),
78  fromProcNo_(fromProcNo),
79  externalBuf_(buffers.recvBuf_[fromProcNo]),
80  externalBufPosition_(buffers.recvBufPos_[fromProcNo]),
81  tag_(buffers.tag_),
82  comm_(buffers.comm_),
83  clearAtEnd_(true),
84  messageSize_(0)
85 {
87  (
88  "UIPstream::UIPstream\n"
89  "(\n"
90  "const int,\n"
91  "PstreamBuffers&\n"
92  ")"
93  );
94 }
95 
96 
97 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
98 
100 (
101  const commsTypes commsType,
102  const int fromProcNo,
103  char* buf,
104  const std::streamsize bufSize,
105  const int tag,
106  const label communicator
107 )
108 {
110  (
111  "UIPstream::read"
112  "("
113  "const commsTypes,"
114  "const int fromProcNo,"
115  "char* buf,"
116  "const label bufSize,"
117  "const int tag,"
118  "const label communicator"
119  ")"
120  );
121 
122  return 0;
123 }
124 
125 
126 // ************************************************************************* //
Inter-processor communications stream.
Definition: UPstream.H:58
Buffers for inter-processor communications streams (UOPstream, UIPstream).
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
static label read(const commsTypes commsType, const int fromProcNo, char *buf, const std::streamsize bufSize, const int tag=UPstream::msgType(), const label communicator=0)
Read into given buffer from given processor and return the.
Definition: UIPread.C:100
streamFormat
Enumeration for the format of data in the stream.
Definition: IOstream.H:86
commsTypes
Types of communications.
Definition: UPstream.H:64
UIPstream(const commsTypes commsType, const int fromProcNo, DynamicList< char > &externalBuf, label &externalBufPosition, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm, const bool clearAtEnd=false, streamFormat format=BINARY, versionNumber version=currentVersion)
Construct given process index to read from and optional buffer size,.
Definition: UIPread.C:34
Version number type.
Definition: IOstream.H:96
#define notImplemented(functionName)
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:356