Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
clop.H
Go to the documentation of this file.
1 /* *******************************************************************
2  * Rocstar Simulation Suite *
3  * Copyright@2015, Illinois Rocstar LLC. All rights reserved. *
4  * *
5  * Illinois Rocstar LLC *
6  * Champaign, IL *
7  * www.illinoisrocstar.com *
8  * sales@illinoisrocstar.com *
9  * *
10  * License: See LICENSE file in top level of distribution package or *
11  * http://opensource.org/licenses/NCSA *
12  *********************************************************************/
13 /* *******************************************************************
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
15  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
16  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
17  * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR *
18  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
19  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
20  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
21  * USE OR OTHER DEALINGS WITH THE SOFTWARE. *
22  *********************************************************************/
23 
24 #include <cstdlib>
25 
26 // Utility Functions
27 vector<string> Vectize(const char **);
28 vector<string> Vectize(const char **,int);
29 const string stripdir(const string &);
30 
31 class
32 clop
33 {
34 protected:
35  string _longop;
36  char _shortop;
37 public:
38  clop()
39  : _shortop((char)0)
40  {};
41  clop(const clop &op)
42  : _longop(op._longop),_shortop(op._shortop)
43  {};
44  clop(const string &lo,const char &so)
45  : _longop(lo),_shortop(so)
46  {};
47  bool operator==(const clop &op) const
48  {
49  return(_longop == op._longop &&
50  _shortop == op._shortop);
51  };
52  bool operator==(const string &s) const
53  {
54  return(s == _longop);
55  };
56  clop &operator=(const clop &op)
57  {
58  _longop = op._longop;
59  _shortop = op._shortop;
60  return(*this);
61  };
62  string &longop()
63  {
64  return(_longop);
65  };
66  const string &longop() const
67  {
68  return(_longop);
69  };
70  char &shortop()
71  {
72  return(_shortop);
73  };
74  const char &shortop() const
75  {
76  return(_shortop);
77  };
78 };
79 
80 bool
81 GetOp(const string &ops,const vector<string> &args);
82 
83 bool
84 GetOp(const string &ops,string &rv,const vector<string> &args);
85 
86 bool
87 CheckOps(const vector<string> &args,string &badop);
88 
89 void
90 AddOp(const string &lo,const char &so);
91 
92 // ADD UNDERSCORE IF NEEDED
93 #ifdef FORTRAN_UNDERSCORE
94 # define F_FUNC(x) x ## _
95 #else
96 # define F_FUNC(x) x
97 #endif
98 
99 #ifdef FORTRAN_LOWERCASE
100 
101 // FUNCTIONS FOR LOWERCASE FORTRAN SYMBOLS
102 #define RFLUCONV F_FUNC(rfluconv)
103 #define RFLUINIT F_FUNC(rfluinit)
104 #define RFLUMAP F_FUNC(rflumap)
105 #define RFLUMP F_FUNC(rflump)
106 #define RFLUPART F_FUNC(rflupart)
107 #define RFLUPICK F_FUNC(rflupick)
108 #define RFLUPOST F_FUNC(rflupost)
109 
110 #else
111 
112 // FUNCTIONS FOR UPPERCASE FORTRAN SYMBOLS
113 #define RFLUCONV F_FUNC(RFLUCONV)
114 #define RFLUINIT F_FUNC(RFLUINIT)
115 #define RFLUMAP F_FUNC(RFLUMAP)
116 #define RFLUMP F_FUNC(RFLUMP)
117 #define RFLUPART F_FUNC(RFLUPART)
118 #define RFLUPICK F_FUNC(RFLUPICK)
119 #define RFLUPOST F_FUNC(RFLUPOST)
120 
121 #endif
122 
123 
124 
125 
126 
127 
128 
const string stripdir(const string &)
clop()
Definition: clop.H:38
double s
Definition: blastest.C:80
bool GetOp(const string &ops, const vector< string > &args)
void AddOp(const string &lo, const char &so)
bool operator==(const string &s) const
Definition: clop.H:52
clop & operator=(const clop &op)
Definition: clop.H:56
string _longop
Definition: clop.H:35
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do so
Definition: roccomf90.h:20
bool CheckOps(const vector< string > &args, string &badop)
string & longop()
Definition: clop.H:62
bool operator==(const clop &op) const
Definition: clop.H:47
Definition: clop.H:31
const string & longop() const
Definition: clop.H:66
char & shortop()
Definition: clop.H:70
clop(const string &lo, const char &so)
Definition: clop.H:44
vector< string > Vectize(const char **)
Definition: clop.C:182
const char & shortop() const
Definition: clop.H:74
char _shortop
Definition: clop.H:36
clop(const clop &op)
Definition: clop.H:41