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

sst/core/linkMap.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_LINKMAP_H
00014 #define SST_LINKMAP_H
00015 
00016 #include <string>
00017 #include <map>
00018 
00019 #include <sst/core/sst_types.h>
00020 #include <sst/core/link.h>
00021 
00022 namespace SST { 
00023 
00024 #define _LM_DBG( fmt, args...) __DBG( DBG_LINKMAP, LinkMap, fmt, ## args )
00025 
00026 class Link;
00027 
00028 class LinkMap {
00029 
00030 private:
00031     std::map<std::string,Link*> linkMap;
00032 
00033 public:
00034     LinkMap() {}
00035     ~LinkMap() {}
00036     
00037     void insertLink(std::string name, Link* link) {
00038         linkMap.insert(std::pair<std::string,Link*>(name,link));
00039     }
00040 
00041     Link* getLink(std::string name) {
00042         std::map<std::string,Link*>::iterator it = linkMap.find(name);
00043         if ( it == linkMap.end() ) return NULL;
00044         else return it->second;
00045     }
00046 
00047     // FIXME: Cludge for now
00048     std::map<std::string,Link*>& getLinkMap() {
00049         return linkMap;
00050     }
00051 
00052     friend class boost::serialization::access;
00053     template<class Archive>
00054     void serialize(Archive & ar, const unsigned int version )
00055     {
00056         ar & BOOST_SERIALIZATION_NVP(linkMap);
00057     }
00058 };
00059 
00060 } // namespace SST
00061 
00062 BOOST_CLASS_EXPORT_KEY(SST::LinkMap)
00063 
00064 #endif // SST_LINKMAP_H

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