SST  6.0.0
StructuralSimulationToolkit
configGraphOutput.h
1 // Copyright 2009-2016 Sandia Corporation. Under the terms
2 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S.
3 // Government retains certain rights in this software.
4 //
5 // Copyright (c) 2009-2016, Sandia Corporation
6 // All rights reserved.
7 //
8 // This file is part of the SST software package. For license
9 // information, see the LICENSE file in the top level directory of the
10 // distribution.
11 
12 #ifndef _H_SST_CORE_CONFIG_OUTPUT
13 #define _H_SST_CORE_CONFIG_OUTPUT
14 
15 #include <sst/core/config.h>
16 #include <configGraph.h>
17 
18 #include <exception>
19 #include <cstring>
20 #include <cstdio>
21 
22 namespace SST {
23 namespace Core {
24 
25 class ConfigGraphOutputException : public std::exception {
26 public:
27  ConfigGraphOutputException(const char* msg) {
28  exMsg = (char*) malloc( sizeof(char) * (strlen(msg) + 1) );
29  std::strcpy(exMsg, msg);
30  }
31 
32  virtual const char* what() const throw() {
33  return exMsg;
34  }
35 
36 protected:
37  char* exMsg;
38 };
39 
41 public:
42  ConfigGraphOutput(const char* path) {
43  outputFile = fopen(path, "wt");
44  }
45 
46  virtual ~ConfigGraphOutput() {
47  fclose(outputFile);
48  }
49 
50  virtual void generate(const Config* cfg,
51  ConfigGraph* graph) throw(ConfigGraphOutputException) = 0;
52 protected:
53  FILE* outputFile;
54 
55 };
56 
57 }
58 }
59 
60 #endif
Definition: configGraphOutput.h:40
Class to contain SST Simulation Configuration variables.
Definition: config.h:39
A Configuration Graph A graph representing Components and Links.
Definition: configGraph.h:202
Definition: configGraphOutput.h:25
Definition: action.cc:17