ddc
LessDomItem.h
Go to the documentation of this file.
1 // DDC originally by Alexey Sokirko
2 // Changes and modifications 2011-2014 by Bryan Jurish
3 //
4 // This file is part of DDC.
5 //
6 // DDC is free software: you can redistribute it and/or modify
7 // it under the terms of the GNU Lesser General Public License as published by
8 // the Free Software Foundation, either version 3 of the License, or
9 // (at your option) any later version.
10 //
11 // DDC is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public License
17 // along with DDC. If not, see <http://www.gnu.org/licenses/>.
18 //
19 #ifndef LessDomItem_h
20 #define LessDomItem_h
21 
22 class IsLessByItemStrNew : public std::binary_function<const TDomItem, const TDomItem, bool>
23 {
24 public:
26 
28  {m_pRoss = pRoss;}
29 
30  bool operator()(const TDomItem& Item1, const TDomItem& Item2)
31  {
32  if (Item1.GetDomNo() != Item2.GetDomNo())
33  return (Item1.GetDomNo() < Item2.GetDomNo());
34  else
35  return (strcmp (m_pRoss->GetDomItemStr(Item1), m_pRoss->GetDomItemStr(Item2)) < 0);
36  }
37 };
38 
39 
40 
41 class IsLessByNotStableItemStrNew : public std::binary_function<const TDomItem&, const TDomNoItemStr&, bool>
42 {
43 public:
45 
47  {m_pRoss = pRoss;}
48 
49  bool operator()(const TDomItem& Item1, const TDomNoItemStr& Item2) const
50  {
51  if (Item1.GetDomNo() != Item2.DomNo)
52  return (Item1.GetDomNo() < Item2.DomNo);
53  else
54  return (strcmp (m_pRoss->GetDomItemStr(Item1), Item2.ItemStr) < 0);
55  }
56  bool operator()(const TDomNoItemStr& Item1, const TDomItem& Item2) const
57  {
58  if (Item1.DomNo != Item2.GetDomNo())
59  return (Item1.DomNo < Item2.GetDomNo());
60  else
61  return (strcmp (Item1.ItemStr, m_pRoss->GetDomItemStr(Item2)) < 0);
62  }
63  bool operator()(const TDomItem& Item1, const TDomItem& Item2) const
64  {
65  if (Item1.GetDomNo() != Item2.GetDomNo())
66  return (Item1.GetDomNo() < Item2.GetDomNo());
67  else
68  return (strcmp (m_pRoss->GetDomItemStr(Item1), m_pRoss->GetDomItemStr(Item2)) < 0);
69  }
70 
71 };
72 
73 #endif
74 
75 /*--- emacs style variables ---
76  * Local Variables:
77  * mode: C++
78  * c-file-style: "ellemtel"
79  * c-basic-offset: 4
80  * tab-width: 8
81  * indent-tabs-mode: nil
82  * End:
83  */
Definition: ItemsContainer.h:76
bool operator()(const TDomItem &Item1, const TDomItem &Item2)
Definition: LessDomItem.h:30
Definition: LessDomItem.h:41
Definition: ItemsContainer.h:39
bool operator()(const TDomItem &Item1, const TDomNoItemStr &Item2) const
Definition: LessDomItem.h:49
const TItemContainer * m_pRoss
Definition: LessDomItem.h:44
IsLessByItemStrNew(const TItemContainer *pRoss)
Definition: LessDomItem.h:27
const TItemContainer * m_pRoss
Definition: LessDomItem.h:25
BYTE DomNo
Definition: ItemsContainer.h:35
bool operator()(const TDomNoItemStr &Item1, const TDomItem &Item2) const
Definition: LessDomItem.h:56
BYTE GetDomNo() const
Definition: ItemsContainer.h:63
char ItemStr[100]
Definition: ItemsContainer.h:34
const char * GetDomItemStr(const TDomItem &Item) const
Definition: ItemsContainer.h:110
Definition: LessDomItem.h:22
bool operator()(const TDomItem &Item1, const TDomItem &Item2) const
Definition: LessDomItem.h:63
IsLessByNotStableItemStrNew(const TItemContainer *pRoss)
Definition: LessDomItem.h:46
Definition: ItemsContainer.h:33