C++ main module for emicrom 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 {
13 
14 
15 public:
16 
17  // ATRIBUTE
18 
19 public:
20  static const tFlag NO_ORDER;
21  static const tFlag EQ;//==
22  static const tFlag NEQ;
23  static const tFlag LT;//<
24  static const tFlag LE;//<=
25  static const tFlag GT;//>
26  static const tFlag GE;//>=
27 
28  // CONSTRUCTORS
31  CORE_List();
32 
33 
34 
35  // DESTRUCTORS
38  virtual ~CORE_List();
39 
40 
41 public:
42 
43 
46  virtual void clear()=0;
47 
54  template<class Q>
55  static inline tBoolean compare(const Q& a,
56  const Q& b,
57  const tFlag& order) {
58 
59  if (order==EQ) {
60  return (a==b);
61  } else if (order==NEQ) {
62  return (a!=b);
63  } else if (order==LT) {
64  return (a<b);
65  } else if (order==LE) {
66  return (a<=b);
67  } else if (order==GT) {
68  return (a>b);
69  } else if (order==GE) {
70  return (a>=b);
71  }
72 
73  return false;
74  };
75 
76 
83  static inline tBoolean compareString(const tString& a,
84  const tString& b,
85  const tFlag& order) {
86 
87  return compare(a.compare(b),0,order);
88  };
89 
95  static tFlag reverse(const tFlag& oder);
96 
97 };
98 
99 #endif
this class describes a list interface
Definition: CORE_List.h:12
#define tBoolean
Definition: types.h:139
CORE_List()
build a list
Definition: CORE_List.cpp:11
static tFlag reverse(const tFlag &oder)
return the reverse order
Definition: CORE_List.cpp:17
static const tFlag EQ
Definition: CORE_List.h:21
virtual void clear()=0
clear the list
static tBoolean compareString(const tString &a, const tString &b, const tFlag &order)
compare 2 string a & b
Definition: CORE_List.h:83
#define tString
Definition: types.h:135
static const tFlag GE
Definition: CORE_List.h:26
virtual ~CORE_List()
destroy a list
Definition: CORE_List.cpp:14
static const tFlag LT
=
Definition: CORE_List.h:23
static const tFlag GT
Definition: CORE_List.h:25
static const tFlag NO_ORDER
Definition: CORE_List.h:20
static const tFlag LE
Definition: CORE_List.h:24
static tBoolean compare(const Q &a, const Q &b, const tFlag &order)
compare 2 object a & b
Definition: CORE_List.h:55
#define tFlag
Definition: types.h:74
static const tFlag NEQ
Definition: CORE_List.h:22