• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

sst/core/exit.h

00001 // Copyright 2009-2010 Sandia Corporation. Under the terms
00002 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S.
00003 // Government retains certain rights in this software.
00004 // 
00005 // Copyright (c) 2009-2010, Sandia Corporation
00006 // All rights reserved.
00007 // 
00008 // This file is part of the SST software package. For license
00009 // information, see the LICENSE file in the top level directory of the
00010 // distribution.
00011 
00012 
00013 #ifndef SST_CORE_EXIT_H
00014 #define SST_CORE_EXIT_H
00015 
00016 #include <set>
00017 
00018 #include "sst/core/sst_types.h"
00019 #include "sst/core/action.h"
00020 
00021 namespace SST{
00022 
00023 #define _EXIT_DBG( fmt, args...) __DBG( DBG_EXIT, Exit, fmt, ## args )
00024 
00025 class Simulation;
00026 class TimeConverter;
00027 
00028 class Exit : public Action {
00029 public:
00030     // Exit needs to register a handler during constructor time, which
00031     // requires a simulation object.  But the simulation class creates
00032     // an Exit object during it's construction, meaning that
00033     // Simulation::getSimulation() won't work yet.  So Exit is the one
00034     // exception to the "constructors shouldn't take simulation
00035     // pointers" rule.  However, it still needs to follow the "classes
00036     // shouldn't contain pointers back to Simulation" rule.
00037     Exit( Simulation* sim, TimeConverter* period, bool single_rank );
00038 
00039     bool refInc( ComponentId_t );
00040     bool refDec( ComponentId_t );
00041 
00042 private:
00043     Exit() { } // for serialization only
00044     Exit(const Exit&);           // Don't implement
00045     void operator=(Exit const&); // Don't implement
00046 
00047 //     bool handler( Event* );
00048     void execute(void);
00049     
00050 //     EventHandler< Exit, bool, Event* >* m_functor;
00051     unsigned int    m_refCount;
00052     TimeConverter*  m_period;
00053     std::set<ComponentId_t> m_idSet;
00054 
00055     bool single_rank;
00056     
00057     friend class boost::serialization::access;
00058     template<class Archive>
00059     void serialize(Archive & ar, const unsigned int version);
00060 };
00061 
00062 } // namespace SST
00063 
00064 BOOST_CLASS_EXPORT_KEY(SST::Exit)
00065 
00066 #endif // SST_EXIT_H

Generated on Fri Oct 22 2010 11:02:13 for SST by  doxygen 1.7.1