MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
rtposixsolver.h
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/base/rtposixsolver.h,v 1.10 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 #ifndef RTPOSIXSOLVER_H
33 #define RTPOSIXSOLVER_H
34 
35 #ifdef USE_RT
36 
37 #include "rtsolver.h"
38 
39 /* RTPOSIXSolver - begin */
40 
41 class RTPOSIXSolver : public RTSolverBase {
42 private:
43  int clock_flags;
44  struct timespec t0, t;
45 
46 public:
47  RTPOSIXSolver(Solver *pS,
48  RTMode eRTMode,
49  unsigned long lRTPeriod,
50  unsigned long RTStackSize,
51  bool bRTAllowNonRoot,
52  int RTCpuMap,
53  bool bNoOutput);
54  ~RTPOSIXSolver(void);
55 
56  // write contribution to restart file
57  std::ostream& Restart(std::ostream& out) const;
58  // very first setup, to be always performed
59  void Setup(void);
60  // to be performed when stop is commanded by someone else
61  void StopCommanded(void);
62  // write real-time related message when stop commanded by someone else
63  void Log(void);
64  // wait for period to expire
65  void Wait(void);
66 };
67 
68 /* RTPOSIXSolver - end */
69 
70 #endif // USE_RT
71 
72 extern RTSolverBase *
74 
75 #endif // RTPOSIXSOLVER_H
76 
virtual void Wait(void)=0
virtual void StopCommanded(void)=0
virtual void Log(void)=0
Definition: solver.h:78
virtual std::ostream & Restart(std::ostream &out) const =0
RTSolverBase * ReadRTPOSIXSolver(Solver *pS, MBDynParser &HP)
virtual void Setup(void)=0