Itasca C++ Interface
igrouplist.h
Go to the documentation of this file.
1 #pragma once
8 #include "utility/interface/igroup.h"
9 
10 #include <unordered_map>
11 
12 #define USEGROUPCOUNT // If not defined then group counting is disabled
13 
14 namespace itasca {
16  class IGroupList {
17  public:
19  inline static const TType type_ = 0x4ecd61c1;
21  using name_signal = shared::Signal<IString,IString>;
22  using slot_signal = shared::Signal<IString,uint32>;
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 IStringList getAllGroupNames() const=0;
35 
37  virtual IStringList getAllSlotNames() const=0;
38 
39 #ifdef USEGROUPCOUNT
40  using groupcount_signal = shared::Signal<TType, uint32>;
44  virtual IStringList slotsFromType(TType type) const=0;
45 
46  // Returns the groups that have been assigned to objects with the general type type.
47  // If type==0 returns all groups assigned to slot for all types.
48  // If slot==ISlotID::anyName() "Any" then returns all groups assigned to that type in any slot.
49  // if both than returns the same as getAllGroupNames()
50  // See getGroupCountSignal to be notified of changes.
51  virtual IStringList groupsFromTypeSlot(TType type, const IString &slot) const=0;
52  // This is emitted when a new slot is added to the list of those available to a type.
53  // It is also emitted when a new group is added to a group slot combination.
54  // In the former case the second argument is ISlotID::any_.
55  // It is NOT sent when the group count changes, or when a group or slot is *removed*.
56  virtual groupcount_signal *getGroupCountSignal() const=0;
57 #endif
58 
59  virtual const ISlot * getSlot(const ISlotID &id,Resolve r) = 0;
60  virtual const ISlot * getSlot(const ISlotID &id) const = 0;
61  virtual const ISlot * getDefaultSlot() const=0;
62  virtual const ISlot * getAnySlot() const = 0;
63  virtual IString getSlotName(uint32 slot,uint32 thread) const = 0;
64  virtual const IGroup *getGroup(const IGroupID &id,Resolve r) = 0;
65  virtual const IGroup *getGroup(const IGroupID &id) const = 0;
66  virtual const IGroup *getNullGroup() const=0;
67 
69  virtual name_signal *getGroupRenameSignal() const=0;
70  virtual name_signal *getSlotRenameSignal() const=0;
71  // Emitted when slots are added or removed.
72  // Note on restore Added signal has IString(), limits<uint32>::max() as arguments.
73  virtual slot_signal *getSlotAddedSignal() const=0;
74  virtual slot_signal *getSlotRemovedSignal() const=0;
75  };
76 } // namespace itasca
77 // EoF
Definition: istring.h:14
Definition: istringlist.h:7
Interface for containers of IThings.
Definition: icontainer.h:21
Interface to a group object.
Definition: igroup.h:9
Definition: igroup.h:82
Group container class.
Definition: igrouplist.h:16
virtual IStringList getAllSlotNames() const =0
Returns a list of all category names found in the container.
virtual name_signal * getGroupRenameSignal() const =0
Emitted when a group is renamed from arg1 to arg2.
virtual const IContainer * getIContainer() const =0
Returns a const pointer to the container class representing a list of groups.
static const TType type_
A unique type number that identifies this class, for use in convert_cast() and convert_getcast().
Definition: igrouplist.h:19
virtual IStringList slotsFromType(TType type) const =0
virtual IGroupID resolve(const IGroupID &input, Resolve resolve)=0
Resolve (if necessary) a groupid into actual pointers.
virtual IContainer * getIContainer()=0
Returns a pointer to the container class representing a list of groups.
virtual IStringList getAllGroupNames() const =0
Returns a list of all group names found in the container.
shared::Signal< IString, IString > name_signal
Signal type used to notify system of changes.
Definition: igrouplist.h:21
Interface to a slot object.
Definition: igroup.h:23
Definition: igroup.h:41
uint32 TType
class type indicator
Definition: basedef.h:46
Interface for container of IThings.
namespace Itasca
Definition: basememory.cpp:10