MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
cleanup.cc File Reference
#include "mbconfig.h"
#include "myassert.h"
#include "cleanup.h"
#include <stack>
Include dependency graph for cleanup.cc:

Go to the source code of this file.

Classes

struct  cleanup
 

Functions

int mbdyn_cleanup_register (mbdyn_cleanup_f handler, void ***datapp)
 
int mbdyn_cleanup (void)
 
void mbdyn_cleanup_destroy (void)
 

Variables

static std::stack< cleanup * > c
 

Function Documentation

int mbdyn_cleanup ( void  )

Definition at line 77 of file cleanup.cc.

References c, cleanup::data, and cleanup::handler.

Referenced by main().

78 {
79  while (!c.empty()) {
80  cleanup *p = c.top();
81 
82  pedantic_cout("mbdyn_cleanup: " << (void *)p->handler << ":" << (void *)p->data << std::endl);
83 
84  p->handler(p->data);
85  c.pop();
86  delete p;
87  }
88 
89  return 0;
90 }
mbdyn_cleanup_f handler
Definition: cleanup.cc:40
static std::stack< cleanup * > c
Definition: cleanup.cc:59
void * data
Definition: cleanup.cc:41
void mbdyn_cleanup_destroy ( void  )

Definition at line 93 of file cleanup.cc.

References c.

Referenced by main().

94 {
95  while (!c.empty()) {
96  cleanup *p = c.top();
97  c.pop();
98  delete p;
99  }
100 }
static std::stack< cleanup * > c
Definition: cleanup.cc:59
int mbdyn_cleanup_register ( mbdyn_cleanup_f  handler,
void ***  datapp 
)

Definition at line 62 of file cleanup.cc.

References c, and cleanup::data.

Referenced by DataManager::DataManager().

63 {
64 
65  pedantic_cout("mbdyn_cleanup_register: " << (void *)handler << ":" << (void *)datapp << std::endl);
66 
67  cleanup *p = new cleanup(handler);
68  if (datapp != 0) {
69  *datapp = &p->data;
70  }
71  c.push(p);
72 
73  return 0;
74 }
static std::stack< cleanup * > c
Definition: cleanup.cc:59
void * data
Definition: cleanup.cc:41

Variable Documentation

std::stack<cleanup *> c
static

Definition at line 59 of file cleanup.cc.

Referenced by ExpandableMatrix::ExpandableColBlock::Add(), FullMatrixHandler::Add(), ResForces::AddMoment(), FullMatrixHandler::AddT(), FullSubMatrixHandler::AddTo(), FullSubMatrixHandler::AddToT(), StructNode::AfterPredict(), Pipe::AssJac(), Dynamic_pipe::AssJac(), DynamicPipe::AssJac(), AerodynamicBody::AssJac(), DataManager::AssJac(), AerodynamicBeam::AssJac(), AerodynamicBeam2::AssJac(), Pipe::AssRes(), Dynamic_pipe::AssRes(), AeroDynModule::AssRes(), DynamicPipe::AssRes(), GenericAerodynamicForce::AssVec(), AerodynamicBody::AssVec(), AerodynamicBeam::AssVec(), AerodynamicBeam2::AssVec(), c81_data_get_coef(), c81_data_read_free_format(), c81_data_write_free_format(), callFunc(), check_flag(), check_mat(), check_mat_transpose(), check_vec_transpose(), MatNxN::Copy(), FullMatrixHandler::CreateColRow(), detect_super_cols(), StdAirProperties::dGetAirDensity(), StdAirProperties::dGetAirPressure(), StdAirProperties::dGetAirTemperature(), Modal::dGetPrivData(), StdAirProperties::dGetSoundSpeed(), NRTrim::DoTrim(), ERR(), expand_environment(), FixedStepFileDrive::FixedStepFileDrive(), func2(), func2ad(), garbage_collection(), get_c81_mat(), get_c81_vec(), get_line(), getopt(), HighParser::GetStringWithDelims(), MathParser::GetToken(), gpc_addmul(), gpc_mul(), IncludeParser::Include_int(), init_scoring(), main(), MatrixHandler::MatMatMul_base(), FullMatrixHandler::MatMatMul_base(), MatrixHandler::MatTMatMul_base(), FullMatrixHandler::MatTMatMul_base(), MatrixHandler::MatTVecMul_base(), MatrixHandler::MatVecMul_base(), mbdyn_cleanup(), mbdyn_cleanup_destroy(), mbdyn_cleanup_register(), mbdyn_clock_time(), ModuleNonsmoothNode::ModuleNonsmoothNode(), naivslv(), operator<<(), order_children(), DataManager::OutputEigenvectors(), DataManager::OutputEigFullMatrices(), FullMatrixHandler::Put(), ResForces::PutForces(), ResForces::PutMoment(), FullMatrixHandler::PutT(), ConstSFR::Read(), LoadableElemRead::Read(), LogSFR::Read(), ExpSFR::Read(), read_fc511_block(), read_fc511_mat(), read_fc511_row(), ReadGenericAerodynamicData(), ReadModal(), MathParser::readplugin(), ReadSparseMappingMatrix(), ReadStructMappingExtForce(), ReadThermal(), ReportMatScale(), FullMatrixHandler::Reset(), AeroData::SetAirData(), ExpandableMatrix::ExpandableColBlock::Sub(), FullMatrixHandler::Sub(), FullSubMatrixHandler::SubFrom(), FullSubMatrixHandler::SubFromT(), FullMatrixHandler::SubT(), testMatVecDouble(), testMatVecDouble2(), testMatVecGradient(), testMatVecGradient2(), testMatVecProduct(), testMatVecProductGradient(), AnnElasticConstitutiveLaw< T, Tder >::Update(), AnnViscoElasticConstitutiveLaw< T, Tder >::Update(), and VariableStepFileDrive::VariableStepFileDrive().