IOSS  2.0
CatalystParserInterface.h
Go to the documentation of this file.
1 /*
2  * Copyright(C) 1999-2017 National Technology & Engineering Solutions
3  * of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
4  * NTESS, the U.S. Government retains certain rights in this software.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are
8  * met:
9  *
10  * * Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  *
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  *
18  * * Neither the name of NTESS nor the names of its
19  * contributors may be used to endorse or promote products derived
20  * from this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33  */
34 
35 #ifndef __CatalystParserInterface_h
36 #define __CatalystParserInterface_h
37 
38 #include <map>
39 #include <string>
40 #include <utility>
41 #include <vector>
42 
44 {
45 public:
46  enum var_type {
55  };
56 
57  typedef std::map<std::string, var_type> var_map;
58  typedef std::pair<unsigned int, unsigned int> id_range;
59 
60  class parse_info
61  {
62  public:
64  {
65  this->node_vars = 0;
66  this->element_vars = 0;
67  this->global_vars = 0;
68  this->nodeIDs = 0;
69  this->elementIDs = 0;
70  this->separator = "_";
71  };
72 
73  std::string json_result;
74  var_map * node_vars;
75  var_map * element_vars;
76  var_map * global_vars;
77  id_range * nodeIDs;
78  id_range * elementIDs;
79  std::string separator;
80  };
81 
82  static int parseFile(const std::string &filepath, parse_info &pinfo);
83 
84  static int parseString(const std::string &s, parse_info &pinfo);
85 };
86 
87 #endif
Definition: CatalystParserInterface.h:47
Definition: CatalystParserInterface.h:53
Definition: CatalystParserInterface.h:54
std::string json_result
Definition: CatalystParserInterface.h:71
id_range * nodeIDs
Definition: CatalystParserInterface.h:77
var_map * global_vars
Definition: CatalystParserInterface.h:76
Definition: CatalystParserInterface.h:43
Definition: CatalystParserInterface.h:52
std::pair< unsigned int, unsigned int > id_range
Definition: CatalystParserInterface.h:58
var_type
Definition: CatalystParserInterface.h:46
Definition: CatalystParserInterface.h:50
static int parseString(const std::string &s, parse_info &pinfo)
var_map * element_vars
Definition: CatalystParserInterface.h:75
var_map * node_vars
Definition: CatalystParserInterface.h:74
Definition: CatalystParserInterface.h:48
Definition: CatalystParserInterface.h:51
std::string separator
Definition: CatalystParserInterface.h:79
parse_info()
Definition: CatalystParserInterface.h:63
Definition: CatalystParserInterface.h:60
id_range * elementIDs
Definition: CatalystParserInterface.h:78
static int parseFile(const std::string &filepath, parse_info &pinfo)
std::map< std::string, var_type > var_map
Definition: CatalystParserInterface.h:57
Definition: CatalystParserInterface.h:49