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

sst/elements/sstdisksim/sstdisksim_tracereader.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 #ifndef _SSTDISKSIM_H
00013 #define _SSTDISKSIM_H
00014 
00015 #include "sstdisksim_event.h"
00016 
00017 #include <sst/core/log.h>
00018 #include <sst/core/component.h>
00019 #include <sst/core/simulation.h>
00020 #include <stdlib.h>
00021 #include <stddef.h>
00022 
00023 #include "syssim_driver.h"
00024 #include <disksim_interface.h>
00025 #include <disksim_rand48.h>
00026 
00027 #include <sstdisksim.h>
00028 #include <sstdisksim_event.h>
00029 
00030 extern "C"
00031 {
00032 #include <lua.h>
00033 #include <lauxlib.h>
00034 #include <lualib.h>
00035 }
00036 
00037 enum lua_value_types
00038 {
00039   L_INT=1,
00040   L_DOUBLE,
00041   L_LONG,
00042   L_STRING,
00043   L_BOOLEAN
00044 };
00045 
00046 using namespace std;
00047 using namespace SST;
00048 
00049 #ifndef DISKSIM_DBG
00050 #define DISKSIM_DBG 0
00051 #endif
00052 
00053 class sstdisksim_tracereader : public Component {
00054 
00055  public:
00056 
00057   sstdisksim_tracereader( ComponentId_t id, Params_t& params );
00058   ~sstdisksim_tracereader();
00059   int Setup();
00060   int Finish();
00061 
00062   int luaRead(int count, int pos, int devno);
00063   int luaWrite(int count, int pos, int devno);
00064   lua_State* __L;
00065   lua_State* __otherthread;
00066 
00067  private:
00068 
00069   std::string traceFile;
00070 
00071   bool __done;
00072   Params_t __params;
00073   ComponentId_t __id;
00074 
00075   /* To be removed later-this is just to test the component
00076      before we start having trace-reading functionality. */
00077 
00078   Log< DISKSIM_DBG >&  m_dbg;
00079   
00080   sstdisksim_tracereader( const sstdisksim_tracereader& c );
00081   
00082   SST::Link* link;
00083   
00084   friend class boost::serialization::access;
00085   template<class Archive>
00086     void save(Archive & ar, const unsigned int version) const
00087     {
00088       ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Component);
00089       ar & BOOST_SERIALIZATION_NVP(link);
00090     }
00091   
00092   template<class Archive>
00093     void load(Archive & ar, const unsigned int version)
00094     {
00095       ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Component);
00096       ar & BOOST_SERIALIZATION_NVP(link);
00097     }
00098         
00099   BOOST_SERIALIZATION_SPLIT_MEMBER()    
00100 };
00101 
00102 #endif /* _SSTDISKSIM_H */

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