C++ main module for gpm Package  1.0
CORE_List.h
Go to the documentation of this file.
1 #ifndef CORE_List_H
2 #define CORE_List_H
3 
4 #include "CORE_Object.h"
5 #include "types.h"
6 
7 
12 class CORE_List : public CORE_Object {
13 
14 
15  public:
16 
17  // CONSTRUCTORS
20  CORE_List();
21 
22 
23 
24  // DESTRUCTORS
27  virtual ~CORE_List();
28 
29 
30  public:
31 
32 
35  virtual void clear()=0;
36 
39  static inline tBoolean compare(const tString& a,
40  const tString& b,
41  const tString& order) {
42  double diff=a.compare(b);
43  if ((diff>0) && (order.compare(">")==0)) return true;
44  else if ((diff>=0) && (order.compare(">=")==0)) return true;
45  else if ((diff==0) && (order.compare("=")==0)) return true;
46  else if ((diff<0) && (order.compare("<")==0)) return true;
47  else if ((diff<=0) && (order.compare("<=")==0)) return true;
48  else if ((diff!=0) && (order.compare("!=")==0)) return true;
49  return false;
50  };
53  static inline tBoolean compare(const int& a,
54  const int& b,
55  const tString& order) {
56  int diff=b-a;
57  if ((diff>0) && (order.compare(">")==0)) return true;
58  else if ((diff>=0) && (order.compare(">=")==0)) return true;
59  else if ((diff==0) && (order.compare("=")==0)) return true;
60  else if ((diff<0) && (order.compare("<")==0)) return true;
61  else if ((diff<=0) && (order.compare("<=")==0)) return true;
62  else if ((diff!=0) && (order.compare("!=")==0)) return true;
63  return false;
64  };
65 
68  static inline tBoolean compare(const tReal& a,
69  const tReal& b,
70  const tString& order) {
71  double diff=b-a;
72  if ((diff>0) && (order.compare(">")==0)) return true;
73  else if ((diff>=0) && (order.compare(">=")==0)) return true;
74  else if ((diff==0) && (order.compare("=")==0)) return true;
75  else if ((diff<0) && (order.compare("<")==0)) return true;
76  else if ((diff<=0) && (order.compare("<=")==0)) return true;
77  else if ((diff!=0) && (order.compare("!=")==0)) return true;
78  return false;
79  };
82  static inline tBoolean areEqual(const int& a,const int& b) {
83  return (a==b);
84  };
87  static inline tBoolean areEqual(const long int& a,const long int& b) {
88  return (a==b);
89  };
92  static inline tBoolean areEqual(const float& a,const float& b) {
93  return (a==b);
94  };
97  static inline tBoolean areEqual(const double& a,const double& b) {
98  return (a==b);
99  };
102  static inline tBoolean areEqual(const long double& a,const long double& b) {
103  return (a==b);
104  };
107  static inline tBoolean areEqual(const short& a,const short& b) {
108  return (a==b);
109  };
112  static inline tBoolean areEqual(const unsigned char& a,const unsigned char& b) {
113  return (a==b);
114  };
117  static inline tBoolean areEqual(const unsigned long int& a,const unsigned long int& b) {
118  return (a==b);
119  };
122  static inline tBoolean areEqual(const bool& a,const bool& b) {
123  return (a==b);
124  };
127  static inline tBoolean areEqual(const char& a,const char& b) {
128  return (a==b);
129  };
132  static inline tBoolean areEqual(const complex<double>& a,
133  const complex<double>& b) {
134  return (a==b);
135  };
138  static inline tBoolean areEqual(const string& a,const string& b) {
139  return (a.compare(b)==0);
140  };
141 
142 };
143 
144 #endif
static tBoolean areEqual(const unsigned char &a, const unsigned char &b)
compare 2 primitive object
Definition: CORE_List.h:112
static tBoolean areEqual(const double &a, const double &b)
compare 2 primitive object
Definition: CORE_List.h:97
this class describes a list
Definition: CORE_List.h:12
static tBoolean areEqual(const short &a, const short &b)
compare 2 primitive object
Definition: CORE_List.h:107
static tBoolean areEqual(const bool &a, const bool &b)
compare 2 primitive object
Definition: CORE_List.h:122
#define tBoolean
Definition: types.h:35
CORE_List()
build a list
Definition: CORE_List.cpp:6
static tBoolean areEqual(const long int &a, const long int &b)
compare 2 primitive object
Definition: CORE_List.h:87
static tBoolean areEqual(const long double &a, const long double &b)
compare 2 primitive object
Definition: CORE_List.h:102
static tBoolean areEqual(const complex< double > &a, const complex< double > &b)
compare 2 primitive object
Definition: CORE_List.h:132
virtual void clear()=0
clear the list
static tBoolean areEqual(const string &a, const string &b)
compare 2 primitive object
Definition: CORE_List.h:138
static tBoolean areEqual(const float &a, const float &b)
compare 2 primitive object
Definition: CORE_List.h:92
static tBoolean compare(const tString &a, const tString &b, const tString &order)
compare 2 strings
Definition: CORE_List.h:39
abstract base class for most classes.
Definition: CORE_Object.h:30
#define tString
Definition: types.h:36
static tBoolean areEqual(const int &a, const int &b)
compare 2 primitive object
Definition: CORE_List.h:82
static tBoolean compare(const tReal &a, const tReal &b, const tString &order)
compare 2 reals
Definition: CORE_List.h:68
static tBoolean areEqual(const unsigned long int &a, const unsigned long int &b)
compare 2 primitive object
Definition: CORE_List.h:117
virtual ~CORE_List()
destroy a list
Definition: CORE_List.cpp:9
static tBoolean compare(const int &a, const int &b, const tString &order)
compare 2 ints
Definition: CORE_List.h:53
static tBoolean areEqual(const char &a, const char &b)
compare 2 primitive object
Definition: CORE_List.h:127
#define tReal
Definition: types.h:18