| 52 | \*---------------------------------------------------------------------------*/ |
| 53 | |
| 54 | class UIPstream |
| 55 | : |
| 56 | public UPstream, |
| 57 | public Istream |
| 58 | { |
| 59 | // Private data |
| 60 | |
| 61 | int fromProcNo_; |
| 62 | |
| 63 | DynamicList<char>& externalBuf_; |
| 64 | |
| 65 | label& externalBufPosition_; |
| 66 | |
| 67 | const int tag_; |
| 68 | |
| 69 | const label comm_; |
| 70 | |
| 71 | const bool clearAtEnd_; |
| 72 | |
| 73 | int messageSize_; |
| 74 | |
| 75 | |
| 76 | // Private Member Functions |
| 77 | |
| 78 | //- Check the bufferPosition against messageSize_ for EOF |
| 79 | inline void checkEof(); |
| 80 | |
| 81 | //- Read a T from the transfer buffer |
| 82 | template<class T> |
| 83 | inline void readFromBuffer(T&); |
| 84 | |
| 85 | //- Read data from the transfer buffer |
| 86 | inline void readFromBuffer(void* data, size_t count, size_t align); |
| 87 | |
| 88 | |
| 89 | public: |
| 90 | |
| 91 | // Constructors |
| 92 | |
| 93 | //- Construct given process index to read from and optional buffer size, |
| 94 | // read format and IO version |
| 95 | UIPstream |
| 96 | ( |
| 97 | const commsTypes commsType, |
| 98 | const int fromProcNo, |
| 99 | DynamicList<char>& externalBuf, |
| 100 | label& externalBufPosition, |
| 101 | const int tag = UPstream::msgType(), |
| 102 | const label comm = UPstream::worldComm, |
| 103 | const bool clearAtEnd = false, // destroy externalBuf if at end |
| 104 | streamFormat format=BINARY, |
| 105 | versionNumber version=currentVersion |
| 106 | ); |
| 107 | |
| 108 | //- Construct given buffers |
| 109 | UIPstream(const int fromProcNo, PstreamBuffers&); |
| 110 | |
| 111 | |