mirror of
https://github.com/nasa/trick.git
synced 2024-12-18 20:57:55 +00:00
add IExecutive interface class for default scheduler
This commit is contained in:
parent
3e54516abb
commit
1e2c889fa7
@ -17,6 +17,7 @@
|
||||
#include <signal.h>
|
||||
|
||||
#include "Scheduler.hh"
|
||||
#include "IExecutive.hh"
|
||||
#include "ScheduledJobQueue.hh"
|
||||
#include "SimObject.hh"
|
||||
#include "Threads.hh"
|
||||
@ -42,7 +43,7 @@ namespace Trick {
|
||||
*
|
||||
*/
|
||||
|
||||
class Executive : public Trick::Scheduler {
|
||||
class Executive : public Trick::IExecutive {
|
||||
public:
|
||||
/** gets #except_return */
|
||||
virtual int get_except_return() const;
|
||||
@ -1304,7 +1305,7 @@ namespace Trick {
|
||||
}
|
||||
|
||||
#ifndef SWIG
|
||||
extern Trick::Executive* the_exec;
|
||||
extern Trick::IExecutive* the_exec;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
1310
include/trick/IExecutive.hh
Normal file
1310
include/trick/IExecutive.hh
Normal file
File diff suppressed because it is too large
Load Diff
@ -2,10 +2,10 @@
|
||||
#ifndef EXEC_PROTO_HH
|
||||
#define EXEC_PROTO_HH
|
||||
|
||||
#include "trick/Executive.hh"
|
||||
#include "trick/IExecutive.hh"
|
||||
#include "trick/SimObject.hh"
|
||||
|
||||
Trick::Executive * exec_get_exec_cpp() ;
|
||||
Trick::IExecutive * exec_get_exec_cpp() ;
|
||||
|
||||
int exec_add_sim_object( Trick::SimObject * , const char * = NULL ) ;
|
||||
int exec_remove_sim_object( Trick::SimObject * ) ;
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include "trick/ExecutiveException.hh"
|
||||
#include "trick/TrickConstant.hh"
|
||||
|
||||
Trick::Executive * the_exec ;
|
||||
Trick::IExecutive * the_exec ;
|
||||
|
||||
Trick::Executive::Executive() {
|
||||
|
||||
|
@ -3,20 +3,20 @@
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#include "trick/Executive.hh"
|
||||
#include "trick/IExecutive.hh"
|
||||
#include "trick/ExecutiveException.hh"
|
||||
#include "trick/exec_proto.h"
|
||||
#include "trick/exec_proto.hh"
|
||||
|
||||
/* Global singleton pointer to the executive */
|
||||
extern Trick::Executive * the_exec ;
|
||||
extern Trick::IExecutive * the_exec ;
|
||||
|
||||
/**
|
||||
* @relates Trick::Executive
|
||||
* returns a pointer to the simulation executive
|
||||
* @return Executive
|
||||
*/
|
||||
Trick::Executive * exec_get_exec_cpp() {
|
||||
Trick::IExecutive * exec_get_exec_cpp() {
|
||||
return ( the_exec ) ;
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include <fenv.h>
|
||||
#endif
|
||||
|
||||
#include "trick/Executive.hh"
|
||||
#include "trick/IExecutive.hh"
|
||||
#include "trick/exec_proto.hh"
|
||||
|
||||
/**
|
||||
@ -31,7 +31,7 @@ void fpe_sig_handler(int sig __attribute__ ((unused)), siginfo_t * sip __attribu
|
||||
#endif
|
||||
{
|
||||
|
||||
Trick::Executive * E = exec_get_exec_cpp();
|
||||
Trick::IExecutive * E = exec_get_exec_cpp();
|
||||
|
||||
#if __APPLE__
|
||||
siginfo_t * sip = NULL ;
|
||||
|
@ -30,25 +30,25 @@
|
||||
* @return void
|
||||
*/
|
||||
void sig_hand(int sig) {
|
||||
Trick::Executive * E = exec_get_exec_cpp();
|
||||
Trick::IExecutive * E = exec_get_exec_cpp();
|
||||
E->signal_handler(sig) ;
|
||||
return;
|
||||
}
|
||||
|
||||
void ctrl_c_hand(int sig __attribute__ ((unused))) {
|
||||
Trick::Executive * E = exec_get_exec_cpp();
|
||||
Trick::IExecutive * E = exec_get_exec_cpp();
|
||||
E->ctrl_c_handler() ;
|
||||
return;
|
||||
}
|
||||
|
||||
void term_hand(int sig __attribute__ ((unused))) {
|
||||
Trick::Executive * E = exec_get_exec_cpp();
|
||||
Trick::IExecutive * E = exec_get_exec_cpp();
|
||||
E->term_handler() ;
|
||||
return;
|
||||
}
|
||||
|
||||
void usr1_hand(int sig __attribute__ ((unused))) {
|
||||
Trick::Executive * E = exec_get_exec_cpp();
|
||||
Trick::IExecutive * E = exec_get_exec_cpp();
|
||||
E->usr1_handler() ;
|
||||
return;
|
||||
}
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#define protected public
|
||||
#include "trick/ExecutiveException.hh"
|
||||
#include "trick/IExecutive.hh"
|
||||
#include "trick/Executive.hh"
|
||||
#include "trick/exec_proto.h"
|
||||
#include "trick/exec_proto.hh"
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "trick/message_type.h"
|
||||
#include "trick/exec_proto.h"
|
||||
|
||||
extern Trick::Executive * the_exec ;
|
||||
extern Trick::IExecutive * the_exec ;
|
||||
|
||||
void Trick::MonteCarlo::set_enabled(bool in_enabled) {
|
||||
this->enabled = in_enabled;
|
||||
|
@ -11,7 +11,7 @@ PROGRAMMERS: ( (Robert W. Bailey) (LinCom) (April 1992) )
|
||||
#include <iostream>
|
||||
#include <locale.h>
|
||||
|
||||
#include "trick/Executive.hh"
|
||||
#include "trick/IExecutive.hh"
|
||||
#include "trick/command_line_protos.h"
|
||||
#include "trick/exec_proto.hh"
|
||||
|
||||
@ -37,7 +37,7 @@ int master( int nargs, char **args) {
|
||||
command_line_args_process_sim_args(nargs, args) ;
|
||||
|
||||
/* get the exec pointer */
|
||||
Trick::Executive * exec = exec_get_exec_cpp() ;
|
||||
Trick::IExecutive * exec = exec_get_exec_cpp() ;
|
||||
|
||||
ret = exec->init() ;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user