add IExecutive interface class for default scheduler

This commit is contained in:
Scott Fennell 2022-08-04 10:50:29 -05:00
parent 3e54516abb
commit 1e2c889fa7
10 changed files with 1329 additions and 17 deletions

View File

@ -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

File diff suppressed because it is too large Load Diff

View File

@ -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 * ) ;

View File

@ -10,7 +10,7 @@
#include "trick/ExecutiveException.hh"
#include "trick/TrickConstant.hh"
Trick::Executive * the_exec ;
Trick::IExecutive * the_exec ;
Trick::Executive::Executive() {

View File

@ -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 ) ;
}

View File

@ -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 ;

View File

@ -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;
}

View File

@ -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"

View File

@ -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;

View File

@ -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() ;