mirror of
https://github.com/nasa/trick.git
synced 2024-12-19 21:27:54 +00:00
Remove sim_services/STL #275
Removed the sim object, directory and the entry in the Makefile to compile it.
This commit is contained in:
parent
bff1967d4d
commit
ce1347de74
1
Makefile
1
Makefile
@ -45,7 +45,6 @@ SIM_SERV_DIRS = \
|
|||||||
${TRICK_HOME}/trick_source/sim_services/MonteCarlo \
|
${TRICK_HOME}/trick_source/sim_services/MonteCarlo \
|
||||||
${TRICK_HOME}/trick_source/sim_services/RealtimeInjector \
|
${TRICK_HOME}/trick_source/sim_services/RealtimeInjector \
|
||||||
${TRICK_HOME}/trick_source/sim_services/RealtimeSync \
|
${TRICK_HOME}/trick_source/sim_services/RealtimeSync \
|
||||||
${TRICK_HOME}/trick_source/sim_services/STL \
|
|
||||||
${TRICK_HOME}/trick_source/sim_services/ScheduledJobQueue \
|
${TRICK_HOME}/trick_source/sim_services/ScheduledJobQueue \
|
||||||
${TRICK_HOME}/trick_source/sim_services/Scheduler \
|
${TRICK_HOME}/trick_source/sim_services/Scheduler \
|
||||||
${TRICK_HOME}/trick_source/sim_services/Sie \
|
${TRICK_HOME}/trick_source/sim_services/Sie \
|
||||||
|
@ -1,29 +0,0 @@
|
|||||||
|
|
||||||
/*
|
|
||||||
This is the Trick STL manager. The manager itself is a singleton. A pointer
|
|
||||||
is stored as sm in the STLManagerSimObject.
|
|
||||||
|
|
||||||
(05/28/13)
|
|
||||||
Trick STLs do not work on all platforms.
|
|
||||||
Trick STLs work with gcc 4.4 on Linux.
|
|
||||||
Trick STLs do not work with Apple clang/llvm 4.2.
|
|
||||||
*/
|
|
||||||
#ifndef STL_SM
|
|
||||||
#define STL_SM
|
|
||||||
|
|
||||||
##include "trick/STLManager.hh"
|
|
||||||
|
|
||||||
class STLManagerSimObject : public Trick::SimObject {
|
|
||||||
public:
|
|
||||||
Trick::STLManager * sm ; /* ** don't checkpoint the manager */
|
|
||||||
STLManagerSimObject() {
|
|
||||||
sm = Trick::STLManager::getSTLManager() ;
|
|
||||||
("checkpoint") sm->checkpoint() ;
|
|
||||||
("post_checkpoint") sm->post_checkpoint() ;
|
|
||||||
("restart") sm->restart() ;
|
|
||||||
}
|
|
||||||
} ;
|
|
||||||
|
|
||||||
STLManagerSimObject trick_stl_mgr ;
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,9 +0,0 @@
|
|||||||
|
|
||||||
include ${TRICK_HOME}/share/trick/makefiles/Makefile.common
|
|
||||||
include ${TRICK_HOME}/share/trick/makefiles/Makefile.tricklib
|
|
||||||
-include Makefile_deps
|
|
||||||
|
|
||||||
ifneq ($(DMTCP),)
|
|
||||||
TRICK_CXXFLAGS += -D_DMTCP -I$(DMTCP)/dmtcpaware
|
|
||||||
endif
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
|||||||
object_${TRICK_HOST_CPU}/STLUtilities.o: STLUtilities.cpp \
|
|
||||||
${TRICK_HOME}/include/trick/STLUtilities.hh \
|
|
||||||
${TRICK_HOME}/include/trick/memorymanager_c_intf.h \
|
|
||||||
${TRICK_HOME}/include/trick/parameter_types.h \
|
|
||||||
${TRICK_HOME}/include/trick/attributes.h \
|
|
||||||
${TRICK_HOME}/include/trick/reference.h \
|
|
||||||
${TRICK_HOME}/include/trick/value.h \
|
|
||||||
${TRICK_HOME}/include/trick/dllist.h \
|
|
||||||
${TRICK_HOME}/include/trick/var.h \
|
|
||||||
${TRICK_HOME}/include/trick/io_alloc.h
|
|
||||||
object_${TRICK_HOST_CPU}/STLManager.o: STLManager.cpp \
|
|
||||||
${TRICK_HOME}/include/trick/STLManager.hh \
|
|
||||||
${TRICK_HOME}/include/trick/STLInterface.hh
|
|
||||||
object_${TRICK_HOST_CPU}/STLInterface.o: STLInterface.cpp \
|
|
||||||
${TRICK_HOME}/include/trick/STLInterface.hh \
|
|
||||||
${TRICK_HOME}/include/trick/STLManager.hh \
|
|
||||||
${TRICK_HOME}/include/trick/STLUtilities.hh
|
|
@ -1,18 +0,0 @@
|
|||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include "trick/STLInterface.hh"
|
|
||||||
#include "trick/STLManager.hh"
|
|
||||||
#include "trick/STLUtilities.hh"
|
|
||||||
|
|
||||||
Trick::STLInterface::STLInterface() : restore(false) {
|
|
||||||
stl_id = Trick::STLManager::getSTLManager()->addSTL(*this) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
Trick::STLInterface::~STLInterface() {
|
|
||||||
Trick::STLManager::getSTLManager()->removeSTL(*this) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Trick::STLInterface::post_checkpoint( std::string obj_name ) {
|
|
||||||
Trick::delete_trick_stl(obj_name, stl_id) ;
|
|
||||||
}
|
|
@ -1,68 +0,0 @@
|
|||||||
|
|
||||||
#include <algorithm>
|
|
||||||
#include <iostream>
|
|
||||||
#include "trick/STLManager.hh"
|
|
||||||
|
|
||||||
Trick::STLManager * trick_stl_manager = NULL ;
|
|
||||||
|
|
||||||
Trick::STLManager::STLManager() : count(1) {
|
|
||||||
trick_stl_manager = this ;
|
|
||||||
}
|
|
||||||
|
|
||||||
Trick::STLManager::~STLManager() {
|
|
||||||
}
|
|
||||||
|
|
||||||
Trick::STLManager * Trick::STLManager::getSTLManager() {
|
|
||||||
if ( trick_stl_manager == NULL ) {
|
|
||||||
trick_stl_manager = new STLManager ;
|
|
||||||
}
|
|
||||||
return trick_stl_manager ;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Trick::STLManager::checkpoint() {
|
|
||||||
std::vector<STLInterface *>::iterator it ;
|
|
||||||
for ( it = stlObjects.begin() ; it != stlObjects.end() ; it++ ) {
|
|
||||||
(*it)->checkpoint(std::string("trick_stl_manager")) ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Trick::STLManager::post_checkpoint() {
|
|
||||||
std::vector<STLInterface *>::iterator it ;
|
|
||||||
for ( it = stlObjects.begin() ; it != stlObjects.end() ; it++ ) {
|
|
||||||
(*it)->post_checkpoint(std::string("trick_stl_manager")) ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Trick::STLManager::restart() {
|
|
||||||
std::vector<STLInterface *>::iterator it ;
|
|
||||||
|
|
||||||
// Mark all of the stls that currently are registered. These are the ones to restore.
|
|
||||||
for ( it = stlObjects.begin() ; it != stlObjects.end() ; it++ ) {
|
|
||||||
(*it)->restore = true ;
|
|
||||||
}
|
|
||||||
// restore the STLs that existed before we called restart.
|
|
||||||
// The restore flag will be false for newly created STLs
|
|
||||||
for ( it = stlObjects.begin() ; it != stlObjects.end() ; it++ ) {
|
|
||||||
if ( (*it)->restore ) {
|
|
||||||
(*it)->restart(std::string("trick_stl_manager")) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Run the post_checkpoint routine to remove MemoryManager allocations.
|
|
||||||
for ( it = stlObjects.begin() ; it != stlObjects.end() ; it++ ) {
|
|
||||||
(*it)->post_checkpoint(std::string("trick_stl_manager")) ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned int Trick::STLManager::addSTL( STLInterface & stlIn ) {
|
|
||||||
//TODO: This needs mutex protection
|
|
||||||
stlObjects.push_back(&stlIn) ;
|
|
||||||
return count++ ;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Trick::STLManager::removeSTL( STLInterface & stlIn ) {
|
|
||||||
//TODO: This needs mutex protection
|
|
||||||
std::vector<STLInterface *>::iterator it = find( stlObjects.begin(), stlObjects.end(), &stlIn );
|
|
||||||
stlObjects.erase( it );
|
|
||||||
}
|
|
@ -1,40 +0,0 @@
|
|||||||
|
|
||||||
#include <string>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include "trick/STLUtilities.hh"
|
|
||||||
#include "trick/memorymanager_c_intf.h"
|
|
||||||
|
|
||||||
void Trick::delete_trick_stl(std::string object_name , unsigned int stl_id) {
|
|
||||||
char var_declare[128] ;
|
|
||||||
REF2 * items_ref ;
|
|
||||||
|
|
||||||
sprintf(var_declare, "%s_%06d" , object_name.c_str(), stl_id) ;
|
|
||||||
items_ref = ref_attributes(var_declare) ;
|
|
||||||
if ( items_ref != NULL ) {
|
|
||||||
TMM_delete_var_n(var_declare) ;
|
|
||||||
ref_free(items_ref) ;
|
|
||||||
free(items_ref) ;
|
|
||||||
}
|
|
||||||
} ;
|
|
||||||
|
|
||||||
void Trick::delete_trick_map_stl( std::string obj_name , unsigned int stl_id ) {
|
|
||||||
char var_declare[128] ;
|
|
||||||
REF2 * items_ref ;
|
|
||||||
|
|
||||||
sprintf(var_declare, "%s_%06d_keys" , obj_name.c_str(), stl_id) ;
|
|
||||||
items_ref = ref_attributes(var_declare) ;
|
|
||||||
if ( items_ref != NULL ) {
|
|
||||||
TMM_delete_var_n(var_declare) ;
|
|
||||||
ref_free(items_ref) ;
|
|
||||||
free(items_ref) ;
|
|
||||||
}
|
|
||||||
sprintf(var_declare, "%s_%06d_data" , obj_name.c_str(), stl_id) ;
|
|
||||||
items_ref = ref_attributes(var_declare) ;
|
|
||||||
if ( items_ref != NULL ) {
|
|
||||||
TMM_delete_var_n(var_declare) ;
|
|
||||||
ref_free(items_ref) ;
|
|
||||||
free(items_ref) ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user