ReactOS 0.4.16-dev-297-gc569aee
SortClass.h
Go to the documentation of this file.
1/***********************************************************************************
2 SortClass.h
3
4 * Copyright (c) 1997
5 * Mark of the Unicorn, Inc.
6 *
7 * Permission to use, copy, modify, distribute and sell this software
8 * and its documentation for any purpose is hereby granted without fee,
9 * provided that the above copyright notice appear in all copies and
10 * that both that copyright notice and this permission notice appear
11 * in supporting documentation. Mark of the Unicorn makes no
12 * representations about the suitability of this software for any
13 * purpose. It is provided "as is" without express or implied warranty.
14
15 SUMMARY: A class designed to test operations that compares objects. All
16 comparisons on SortClass may fail. Also records its own address for
17 the sake of testing the stability of sorting algorithms.
18
19***********************************************************************************/
20#if ! defined (INCLUDED_MOTU_SortClass)
21#define INCLUDED_MOTU_SortClass 1
22
23# include "Prefix.h"
24# include "TestClass.h"
25
26class SortClass : public TestClass
27{
28public:
29 enum { kRange = 100 };
30
31 SortClass( int v ) : TestClass( v ), addr(0) {
33 }
34
37 }
38
39 bool operator<( const TestClass& rhs ) const
40 {
42 return (const TestClass&)*this < ( rhs );
43 }
44
45 bool operator==( const TestClass& rhs ) const
46 {
48 return (const TestClass&)*this == ( rhs );
49 }
50
51 SortClass* GetAddress() const { return addr; }
52 void ResetAddress() { addr = this; }
53
54private:
56};
57
58inline bool operator>( const SortClass& lhs, const SortClass& rhs ) {
59 return rhs < lhs;
60}
61
62inline bool operator<=( const SortClass& lhs, const SortClass& rhs ) {
63 return !(rhs < lhs);
64}
65
66inline bool operator>=( const SortClass& lhs, const SortClass& rhs ) {
67 return !(lhs < rhs);
68}
69
70inline bool operator != ( const SortClass& lhs, const SortClass& rhs ) {
71 return !(lhs == rhs);
72}
73
74#if defined( __MWERKS__ ) && __MWERKS__ <= 0x3000 && !__SGI_STL
75# if defined( __MSL__ ) && __MSL__ < 0x2406
78# endif
79#endif
80
81#endif // INCLUDED_MOTU_SortClass
bool operator>=(const SortClass &lhs, const SortClass &rhs)
Definition: SortClass.h:66
bool operator!=(const SortClass &lhs, const SortClass &rhs)
Definition: SortClass.h:70
bool operator<=(const SortClass &lhs, const SortClass &rhs)
Definition: SortClass.h:62
bool operator>(const SortClass &lhs, const SortClass &rhs)
Definition: SortClass.h:58
#define __MSL_FIX_ITERATORS__(myType)
Definition: _mwerks.h:39
#define get_random(x)
Definition: maze.c:105
void ResetAddress()
Definition: SortClass.h:52
bool operator==(const TestClass &rhs) const
Definition: SortClass.h:45
bool operator<(const TestClass &rhs) const
Definition: SortClass.h:39
SortClass(int v)
Definition: SortClass.h:31
SortClass * addr
Definition: SortClass.h:55
SortClass * GetAddress() const
Definition: SortClass.h:51
SortClass()
Definition: SortClass.h:35
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
const GLdouble * v
Definition: gl.h:2040
GLenum const GLvoid * addr
Definition: glext.h:9621
void simulate_possible_failure()
Definition: nc_alloc.h:117