All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
UIPread.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2018 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 
59 
60 Foam::UIPstream::UIPstream(const int fromProcNo, PstreamBuffers& buffers)
61 :
62  UPstream(buffers.commsType_),
63  Istream(buffers.format_, buffers.version_),
64  fromProcNo_(fromProcNo),
65  externalBuf_(buffers.recvBuf_[fromProcNo]),
66  externalBufPosition_(buffers.recvBufPos_[fromProcNo]),
67  tag_(buffers.tag_),
68  comm_(buffers.comm_),
69  clearAtEnd_(true),
70  messageSize_(0)
71 {
73 }
74 
75 
76 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
77 
79 (
80  const commsTypes commsType,
81  const int fromProcNo,
82  char* buf,
83  const std::streamsize bufSize,
84  const int tag,
85  const label communicator
86 )
87 {
89 
90  return 0;
91 }
92 
93 
94 // ************************************************************************* //
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
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
commsTypes
Types of communications.
Definition: UPstream.H:64
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
streamFormat
Enumeration for the format of data in the stream.
Definition: IOstream.H:86
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:79
Buffers for inter-processor communications streams (UOPstream, UIPstream).
Version number type.
Definition: IOstream.H:96
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:370
Inter-processor communications stream.
Definition: UPstream.H:58