Itasca C++ Interface
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
igrouplist.h
Go to the documentation of this file.
1 #pragma once
2 
9 #include "utility/interface/igroup.h"
10 
11 #include <unordered_map>
12 
13 namespace itasca {
15  class IGroupList {
16  public:
18  inline static const TType type_ = 0x4ecd61c1;
23  enum class Resolve { Write, ReadQuiet, ReadException };
24 
26  virtual const IContainer *getIContainer() const=0;
28  virtual IContainer * getIContainer()=0;
29 
31  virtual IGroupID resolve(const IGroupID &input,Resolve resolve)=0;
32 
34  virtual QStringList getAllGroupNames() const=0;
35 
37  virtual QStringList getAllSlotNames() const=0;
38 
42  virtual QStringList slotsFromType(TType type) const=0;
43 
44  // Returns the groups that have been assigned to objects with the general tyep type.
45  // If type==0 returns all groups assigned to slot for all types.
46  // If slot==ISlotID::anyName() "Any" then returns all groups assigned to that type in any slot.
47  // if both than returns the same as getAllGroupNames()
48  // See getGroupCountSignal to be notified of changes.
49  virtual QStringList groupsFromTypeSlot(TType type, const QString& slot) const=0;
50 
51  virtual const ISlot * getSlot(const ISlotID &id,Resolve r) = 0;
52  virtual const ISlot * getSlot(const ISlotID &id) const = 0;
53  virtual const ISlot * getDefaultSlot() const=0;
54  virtual const ISlot * getAnySlot() const = 0;
55  virtual QString getSlotName(quint32 slot,quint32 thread) const = 0;
56  virtual const IGroup *getGroup(const IGroupID &id,Resolve r) = 0;
57  virtual const IGroup *getGroup(const IGroupID &id) const = 0;
58  virtual const IGroup *getNullGroup() const=0;
59 
61  virtual name_signal *getGroupRenameSignal() const=0;
62  virtual name_signal *getSlotRenameSignal() const=0;
63  // Emitted when slots are added or removed.
64  // Note on restore Added signal has QString(), limits<uint>::max() as arguments.
65  virtual slot_signal *getSlotAddedSignal() const=0;
66  virtual slot_signal *getSlotRemovedSignal() const=0;
67  // This is emitted when a new slot is added to the list of those available to a type.
68  // It is also emitted when a new group is added to a group slot combination.
69  // In the former case the second argument is ISlotID::any_.
70  // It is NOT sent when the group count changes, or when a group or slot is *removed*.
71  virtual groupcount_signal *getGroupCountSignal() const=0;
72  };
73 } // namespace itasca
74 // EoF
Interface to a group object.
Definition: igroup.h:9
namespace Itasca
Definition: basememory.cpp:9
Definition of a Signal2 object, holding a list of ISlot2 objects.
Definition: isignalbase.h:76
virtual QStringList getAllGroupNames() const =0
Returns a list of all group names found in the container.
virtual name_signal * getGroupRenameSignal() const =0
Emitted when a group is renamed from arg1 to arg2.
Interface to a slot object.
Definition: igroup.h:27
Definition: igroup.h:91
Group container class.
Definition: igrouplist.h:15
unsigned int TType
class type indicator
Definition: basedef.h:41
virtual const IContainer * getIContainer() const =0
Returns a const pointer to the container class representing a list of groups.
virtual QStringList getAllSlotNames() const =0
Returns a list of all category names found in the container.
Interface for containers of IThings.
Definition: icontainer.h:23
Interface for container of IThings.
Definition: igroup.h:51
Signal2< QString, QString > name_signal
Signal type used to notify system of changes.
Definition: igrouplist.h:20
virtual QStringList slotsFromType(TType type) const =0
virtual IGroupID resolve(const IGroupID &input, Resolve resolve)=0
Resolve (if necessary) a groupid into actual pointers.
static const TType type_
A unique type number that identifies this class, for use in convert_cast() and convert_getcast().
Definition: igrouplist.h:18
Definition of a Signal2 object, holding a list of ISlot2 objects.