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 
13 #ifndef FFA_VIEW_ITEM_H
14 #define FFA_VIEW_ITEM_H
15 
16 #include <string>
17 #include <vector>
18 
19 
27 {
28 public:
30  FFaViewItem() = default;
32  FFaViewItem(const FFaViewItem&) = delete;
34  virtual ~FFaViewItem() {}
36  FFaViewItem& operator=(const FFaViewItem&) = delete;
38  virtual char const* getItemName() const = 0;
40  virtual std::string getItemDescr() const = 0;
42  virtual int getItemID() const = 0;
44  virtual int getItemBaseID() const = 0;
46  virtual void getItemAssemblyPath(std::vector<int>&) const {}
47 
49  static bool compareDescr(FFaViewItem* i1, FFaViewItem* i2);
51  static bool compareID(FFaViewItem* i1, FFaViewItem* i2);
52 
54  static int compareDescr3w(FFaViewItem* i1, FFaViewItem* i2);
56  static int compareID3w(FFaViewItem* i1, FFaViewItem* i2);
57 };
58 
59 #endif
Abstract interface class for list view items.
Definition: FFaViewItem.H:27
virtual void getItemAssemblyPath(std::vector< int > &) const
Returns the sub-assembly ID path of this item.
Definition: FFaViewItem.H:46
static bool compareID(FFaViewItem *i1, FFaViewItem *i2)
Binary comparison of user IDs (implementation of less).
Definition: FFaViewItemUtils.C:100
static bool compareDescr(FFaViewItem *i1, FFaViewItem *i2)
Binary comparison of description strings (implementation of less).
Definition: FFaViewItemUtils.C:72
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:143
virtual ~FFaViewItem()
Empty destructor.
Definition: FFaViewItem.H:34
static int compareDescr3w(FFaViewItem *i1, FFaViewItem *i2)
Three-way lexicographical comparison of description strings.
Definition: FFaViewItemUtils.C:123