diff --git a/Makefile b/Makefile index 0c2a4b91..97202d47 100644 --- a/Makefile +++ b/Makefile @@ -45,7 +45,6 @@ SIM_SERV_DIRS = \ ${TRICK_HOME}/trick_source/sim_services/MonteCarlo \ ${TRICK_HOME}/trick_source/sim_services/RealtimeInjector \ ${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/Scheduler \ ${TRICK_HOME}/trick_source/sim_services/Sie \ diff --git a/share/trick/sim_objects/STL.sm b/share/trick/sim_objects/STL.sm deleted file mode 100644 index b01c1119..00000000 --- a/share/trick/sim_objects/STL.sm +++ /dev/null @@ -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 diff --git a/trick_source/sim_services/STL/Makefile b/trick_source/sim_services/STL/Makefile deleted file mode 100644 index 7261c8c1..00000000 --- a/trick_source/sim_services/STL/Makefile +++ /dev/null @@ -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 - diff --git a/trick_source/sim_services/STL/Makefile_deps b/trick_source/sim_services/STL/Makefile_deps deleted file mode 100644 index 8c8aaa65..00000000 --- a/trick_source/sim_services/STL/Makefile_deps +++ /dev/null @@ -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 diff --git a/trick_source/sim_services/STL/STLInterface.cpp b/trick_source/sim_services/STL/STLInterface.cpp deleted file mode 100644 index d8278780..00000000 --- a/trick_source/sim_services/STL/STLInterface.cpp +++ /dev/null @@ -1,18 +0,0 @@ - -#include - -#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) ; -} diff --git a/trick_source/sim_services/STL/STLManager.cpp b/trick_source/sim_services/STL/STLManager.cpp deleted file mode 100644 index 3eccb767..00000000 --- a/trick_source/sim_services/STL/STLManager.cpp +++ /dev/null @@ -1,68 +0,0 @@ - -#include -#include -#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::iterator it ; - for ( it = stlObjects.begin() ; it != stlObjects.end() ; it++ ) { - (*it)->checkpoint(std::string("trick_stl_manager")) ; - } -} - -void Trick::STLManager::post_checkpoint() { - std::vector::iterator it ; - for ( it = stlObjects.begin() ; it != stlObjects.end() ; it++ ) { - (*it)->post_checkpoint(std::string("trick_stl_manager")) ; - } -} - -void Trick::STLManager::restart() { - std::vector::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::iterator it = find( stlObjects.begin(), stlObjects.end(), &stlIn ); - stlObjects.erase( it ); -} diff --git a/trick_source/sim_services/STL/STLUtilities.cpp b/trick_source/sim_services/STL/STLUtilities.cpp deleted file mode 100644 index 5f213af1..00000000 --- a/trick_source/sim_services/STL/STLUtilities.cpp +++ /dev/null @@ -1,40 +0,0 @@ - -#include -#include -#include -#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) ; - } -} -