MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
rtai_in_drive.h
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/base/rtai_in_drive.h,v 1.29 2017/01/12 14:46:10 masarati 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 /* socket driver */
33 
34 #ifndef RTAI_IN_DRIVE_H
35 #define RTAI_IN_DRIVE_H
36 
37 /* include del programma */
38 
39 #include "streamdrive.h"
40 
41 /* RTMBDynInDrive - begin */
42 
43 class RTMBDynInDrive : public StreamDrive {
44 protected:
45 
46  /* FIXME: store restart info as well */
47  std::string host;
48  unsigned long node;
49  int port;
51 
52  void *mbx;
53 
54  int (*f_receive)(unsigned long node, int port, void *mbx,
55  void *msg, int msg_size);
56 
57 public:
58  RTMBDynInDrive(unsigned int uL,
59  const DriveHandler* pDH,
60  const std::string& sFileName,
61  const std::string& host,
62  integer nd, const std::vector<doublereal>& v0,
64  bool c, unsigned long /*int*/ n,
65  bool bNonBlocking);
66 
67  virtual ~RTMBDynInDrive(void);
68 
69  /* Scrive il contributo del DriveCaller al file di restart */
70  virtual std::ostream& Restart(std::ostream& out) const;
71 
72  virtual void ServePending(const doublereal& t);
73 };
74 
75 /* RTMBDynInDrive - end */
76 
77 class DataManager;
78 class MBDynParser;
79 
80 extern Drive *
81 ReadRTMBDynInDrive(const DataManager *pDM, MBDynParser& HP, unsigned int uLabel);
82 
83 
84 #endif /* RTAI_IN_DRIVE_H */
85 
Definition: drive.h:89
RTMBDynInDrive(unsigned int uL, const DriveHandler *pDH, const std::string &sFileName, const std::string &host, integer nd, const std::vector< doublereal > &v0, StreamDrive::Modifier *pMod, bool c, unsigned longn, bool bNonBlocking)
std::string sFileName
Definition: filedrv.h:46
int(* f_receive)(unsigned long node, int port, void *mbx, void *msg, int msg_size)
Definition: rtai_in_drive.h:54
virtual std::ostream & Restart(std::ostream &out) const
unsigned long node
Definition: rtai_in_drive.h:48
DataManager * pDM
Definition: mbpar.h:252
std::string host
Definition: rtai_in_drive.h:47
virtual ~RTMBDynInDrive(void)
static std::stack< cleanup * > c
Definition: cleanup.cc:59
struct mbrtai_msg_t msg
virtual void ServePending(const doublereal &t)
Drive * ReadRTMBDynInDrive(const DataManager *pDM, MBDynParser &HP, unsigned int uLabel)
static const std::vector< doublereal > v0
Definition: fixedstep.cc:45
const Modifier * pMod
Definition: streamdrive.h:69
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51