MFEM  v3.1
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
isockstream.hpp
Go to the documentation of this file.
1 // Copyright (c) 2010, Lawrence Livermore National Security, LLC. Produced at
2 // the Lawrence Livermore National Laboratory. LLNL-CODE-443211. All Rights
3 // reserved. See file COPYRIGHT for details.
4 //
5 // This file is part of the MFEM library. For more information and source code
6 // availability see http://mfem.org.
7 //
8 // MFEM is free software; you can redistribute it and/or modify it under the
9 // terms of the GNU Lesser General Public License (as published by the Free
10 // Software Foundation) version 2.1 dated February 1999.
11 
12 #ifndef MFEM_ISOCKSTREAM
13 #define MFEM_ISOCKSTREAM
14 
15 #include "../config/config.hpp"
16 #include <sstream>
17 
18 namespace mfem
19 {
20 
27 {
28 private:
29  int portnum, portID, socketID, error;
30  char *Buf;
31 
32  int establish();
33  int read_data(int socketid, char *buf, int size);
34 
35 public:
36 
39  explicit isockstream(int port);
40 
41  bool good() { return (!error); }
42 
44  void receive(std::istringstream **in);
45 
47  ~isockstream();
48 };
49 
50 }
51 
52 #endif
isockstream(int port)
Definition: isockstream.cpp:37
void receive(std::istringstream **in)
Start waiting for data and return it in an input stream.