MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
socketstream_out_elem.h
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/base/socketstream_out_elem.h,v 1.34 2017/07/25 14:20:21 zanoni Exp $ */
2 /*
3  * MBDyn (C) is a multibody analysis code.
4  * http://www.mbdyn.org
5  *
6  * Copyright (C) 1996-2017
7  *
8  * Pierangelo Masarati <masarati@aero.polimi.it>
9  * Paolo Mantegazza <mantegazza@aero.polimi.it>
10  *
11  * Dipartimento di Ingegneria Aerospaziale - Politecnico di Milano
12  * via La Masa, 34 - 20156 Milano, Italy
13  * http://www.aero.polimi.it
14  *
15  * Changing this copyright notice is forbidden.
16  *
17  * This program is free software; you can redistribute it and/or modify
18  * it under the terms of the GNU General Public License as published by
19  * the Free Software Foundation (version 2 of the License).
20  *
21  *
22  * This program is distributed in the hope that it will be useful,
23  * but WITHOUT ANY WARRANTY; without even the implied warranty of
24  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25  * GNU General Public License for more details.
26  *
27  * You should have received a copy of the GNU General Public License
28  * along with this program; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30  */
31 
32 /*
33  * Author: Michele Attolico <attolico@aero.polimi.it>
34  */
35 
36 #ifndef SOCKETSTREAM_OUT_ELEM_H
37 #define SOCKETSTREAM_OUT_ELEM_H
38 
39 #include "streamoutelem.h"
40 
41 #ifdef USE_SOCKET
42 
43 /* SocketStreamElem - begin */
44 
45 class SocketStreamElem : public StreamOutElem, virtual public Elem {
46 protected:
47  UseSocket *pUS;
48  StreamContent *pSC;
49 
50  int send_flags;
51  bool bSendFirst;
52  bool bAbortIfBroken;
53 
54  StreamOutEcho *pSOE;
55 
56 public:
57  SocketStreamElem(unsigned int uL, const std::string& name,
58  unsigned int oe,
59  UseSocket *pUS, StreamContent *pSC,
60  int flags, bool bSendFirst, bool bAbortIfBroken,
61  StreamOutEcho *pSOE);
62 
63  virtual ~SocketStreamElem(void);
64 
65  virtual std::ostream& Restart(std::ostream& out) const;
66 
67  virtual void SetValue(DataManager *pDM,
69  SimulationEntity::Hints *ph = 0);
70  virtual void AfterConvergence(const VectorHandler& X,
71  const VectorHandler& XP);
72 
73  /* Inverse Dynamics */
74  virtual void AfterConvergence(const VectorHandler& X,
75  const VectorHandler& XP, const VectorHandler& XPP);
76 };
77 
78 #endif // USE_SOCKET
79 
80 class DataManager;
81 class MBDynParser;
82 
83 extern Elem *
85  unsigned int uLabel, StreamContent::Type type);
86 
87 extern void
89  std::ostream& out);
90 
91 /* SocketStreamElem - end */
92 
93 #endif /* SOCKETSTREAM_OUT_ELEM_H */
94 
std::vector< Hint * > Hints
Definition: simentity.h:89
virtual std::ostream & Restart(std::ostream &out) const =0
DataManager * pDM
Definition: mbpar.h:252
Elem * ReadSocketStreamElem(DataManager *pDM, MBDynParser &HP, unsigned int uLabel, StreamContent::Type type)
Definition: elem.h:75
virtual void AfterConvergence(const VectorHandler &X, const VectorHandler &XP)
Definition: simentity.cc:120
void WriteStreamContentLogOutput(const StreamContent *pSC, std::ostream &out)
virtual void SetValue(DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *h=0)
Definition: simentity.cc:63