FEDEM Solver  R8.0
Source code of the dynamics solver
FFaViewItem.H
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2023 SAP SE
2 //
3 // SPDX-License-Identifier: Apache-2.0
4 //
5 // This file is part of FEDEM - https://openfedem.org
7 
8 #ifndef FFA_VIEW_ITEM_H
9 #define FFA_VIEW_ITEM_H
10 
11 #include <string>
12 #include <vector>
13 
14 
22 {
23 public:
25  FFaViewItem() = default;
27  FFaViewItem(const FFaViewItem&) = delete;
29  virtual ~FFaViewItem() {}
31  FFaViewItem& operator=(const FFaViewItem&) = delete;
33  virtual char const* getItemName() const = 0;
35  virtual std::string getItemDescr() const = 0;
37  virtual int getItemID() const = 0;
39  virtual int getItemBaseID() const = 0;
41  virtual void getItemAssemblyPath(std::vector<int>&) const {}
42 
44  static bool compareDescr(FFaViewItem* i1, FFaViewItem* i2);
46  static bool compareID(FFaViewItem* i1, FFaViewItem* i2);
47 
49  static int compareDescr3w(FFaViewItem* i1, FFaViewItem* i2);
51  static int compareID3w(FFaViewItem* i1, FFaViewItem* i2);
52 
53 private:
55  static bool stringCompare(const std::string& s1, const std::string& s2);
57  static int stringCompare3w(const std::string& s1, const std::string& s2);
58 };
59 
60 #endif
Abstract interface class for list view items.
Definition: FFaViewItem.H:22
static bool stringCompare(const std::string &s1, const std::string &s2)
Binary comparison of two strings.
Definition: FFaViewItemUtils.C:163
virtual void getItemAssemblyPath(std::vector< int > &) const
Returns the sub-assembly ID path of this item.
Definition: FFaViewItem.H:41
static bool compareID(FFaViewItem *i1, FFaViewItem *i2)
Binary comparison of user IDs (implementation of less).
Definition: FFaViewItemUtils.C:49
static bool compareDescr(FFaViewItem *i1, FFaViewItem *i2)
Binary comparison of description strings (implementation of less).
Definition: FFaViewItemUtils.C:20
FFaViewItem()=default
Default constructor.
FFaViewItem & operator=(const FFaViewItem &)=delete
Disable default assignment operator.
virtual int getItemBaseID() const =0
Returns the base ID of this item.
virtual std::string getItemDescr() const =0
Returns the description of this item.
FFaViewItem(const FFaViewItem &)=delete
Disable default copy constructor.
virtual char const * getItemName() const =0
Returns the name of this item.
virtual int getItemID() const =0
Returns the user ID of this item.
static int compareID3w(FFaViewItem *i1, FFaViewItem *i2)
Three-way lexicographical comparison of user IDs.
Definition: FFaViewItemUtils.C:96
static int stringCompare3w(const std::string &s1, const std::string &s2)
Three-way lexicographical comparison of two strings.
Definition: FFaViewItemUtils.C:171
virtual ~FFaViewItem()
Empty destructor.
Definition: FFaViewItem.H:29
static int compareDescr3w(FFaViewItem *i1, FFaViewItem *i2)
Three-way lexicographical comparison of description strings.
Definition: FFaViewItemUtils.C:74