From 27450430a0a329c52a7bc90b9187cb678eb15802 Mon Sep 17 00:00:00 2001 From: Sandeep Menon Date: Mon, 29 Nov 2010 11:05:16 -0500 Subject: [PATCH] objectMap: Adding capability to read from Istream. --- .../meshes/polyMesh/mapPolyMesh/objectMap/objectMap.H | 3 +++ .../meshes/polyMesh/mapPolyMesh/objectMap/objectMapI.H | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/objectMap/objectMap.H b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/objectMap/objectMap.H index 047da636..c20bb746 100644 --- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/objectMap/objectMap.H +++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/objectMap/objectMap.H @@ -50,6 +50,7 @@ class objectMap; inline bool operator==(const objectMap& a, const objectMap& b); inline bool operator!=(const objectMap& a, const objectMap& b); inline Ostream& operator<<(Ostream&, const objectMap&); +inline Istream& operator>>(Istream&, objectMap&); /*---------------------------------------------------------------------------*\ @@ -101,6 +102,8 @@ public: // IOstream Operators friend Ostream& operator<<(Ostream&, const objectMap&); + + friend Istream& operator>>(Istream&, objectMap&); }; diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/objectMap/objectMapI.H b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/objectMap/objectMapI.H index cde5b3a5..1574c47a 100644 --- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/objectMap/objectMapI.H +++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/objectMap/objectMapI.H @@ -123,6 +123,18 @@ inline Ostream& operator<<(Ostream& os, const objectMap& a) } +inline Istream& operator>>(Istream& is, objectMap& a) +{ + is.readBegin("objectMap"); + is >> a.index_ >> a.masterObjects_; + is.readEnd("objectMap"); + + // Check state of Istream + is.check("Istream& operator>>(Istream&, objectMap&)"); + + return is; +} + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // Master namespace Foam -- 2.11.4.GIT