43 static constexpr uint32 any_ = ISlot::any_;
44 static constexpr uint32 unresolved_ = ISlot::unresolved_;
45 static constexpr uint32 invalid_ = ISlot::invalid_;
46 inline static IString anyName() {
return ISlot::anyName(); }
47 inline static IString defaultName() {
return ISlot::defaultName(); }
48 inline static IString invalidName() {
return ISlot::invalidName(); }
50 inline ISlotID(
const ISlot *slot) : slot_(slot), slotIndex_(slot ? ISlot::unresolved_ : ISlot::invalid_) { }
51 inline ISlotID(uint32 slot=any_) : slotIndex_(slot) { }
52 inline ISlotID(
const IString &name) : slotIndex_(name.length() ? ISlot::unresolved_ : ISlot::any_), slotName_(name) { }
53 inline ISlotID(
const ISlotID &
id) : slot_(
id.slot_), slotIndex_(
id.slotIndex_), slotName_(
id.slotName_), thread_(
id.thread_) {}
54 inline ISlotID(
ISlotID &&
id) noexcept : slot_(
id.slot_), slotIndex_(
id.slotIndex_), slotName_(std::move(
id.slotName_)), thread_(
id.thread_) {}
56 inline const ISlotID &operator=(
const ISlotID &
id) { slot_ =
id.slot_; slotIndex_ =
id.slotIndex_; slotName_ =
id.slotName_; thread_ =
id.thread_;
return *
this; }
57 inline const ISlotID &operator=(
ISlotID &&
id)
noexcept { slot_ =
id.slot_; slotIndex_ =
id.slotIndex_; slotName_ = std::move(
id.slotName_); thread_ =
id.thread_;
return *
this; }
58 inline bool anySlot()
const {
return slot_ ? slot_->getIndex()==any_ : (slotIndex_!=unresolved_ ? slotIndex_==ISlot::any_ : slotName_.compare(anyName(), IString::Case::Insensitive)==0 ); }
59 inline bool unresolvedSlot()
const {
return slot_==
nullptr && (slotIndex_!=unresolved_ || slotName_.length()); }
60 inline bool invalidSlot()
const {
return slotIndex_ == invalid_; }
61 inline bool hasSlot()
const {
return slot_ || slotIndex_!=unresolved_ || slotName_.length(); }
62 inline void setSlot(uint32 slot) { slot_ =
nullptr; slotIndex_ = slot; slotName_ =
IString(); }
63 inline void setSlot(
const IString &name) { slot_ =
nullptr; slotName_ = name; slotIndex_ = name.length() ? unresolved_ : any_; }
64 inline void setSlot(
const ISlot *slot) { slot_ = slot; slotName_ =
IString(); slotIndex_ = slot ? unresolved_ : invalid_; }
65 inline void setSlot(
const ISlotID &
id) { operator=(
id); }
66 inline void setAny() { slot_ =
nullptr; slotIndex_ = any_; slotName_ =
IString(); }
67 inline const ISlot * slot()
const {
return slot_; }
68 inline uint32 slotIndex()
const {
return slot_ ? slot_->getIndex() : slotIndex_; }
69 inline IString slotName()
const {
return slot_ ? slot_->getName() : slotName_; }
70 inline const IString &givenSlotName()
const {
return slotName_; }
71 inline bool operator <(
const ISlotID &slot)
const {
return slotIndex()<slot.slotIndex(); }
72 inline uint32 thread()
const {
return thread_; }
73 inline void thread(uint32 t) { thread_ = t; }
76 const ISlot *slot_ =
nullptr;
77 uint32 slotIndex_ = ISlot::unresolved_;
84 inline static IString nullName() {
return IGroup::nullName(); }
94 inline IGroupID(
IGroupID &&
id) noexcept :
ISlotID(std::move(
id)), group_(
id.group_), groupName_(std::move(
id.groupName_)) {}
97 inline const IGroupID &operator=(
const IGroupID &
id) { ISlotID::operator=(
id); group_ =
id.group_; groupName_ =
id.groupName_;
return *
this; }
98 inline const IGroupID &operator=(
IGroupID &&
id)
noexcept { ISlotID::operator=(std::move(
id)); group_ =
id.group_; groupName_ = std::move(
id.groupName_);
return *
this; }
99 inline bool hasGroup()
const {
if (group_ || groupName_.length())
return true;
return false; }
100 inline bool unresolvedGroup()
const {
return !group_ && groupName_.length(); }
101 inline bool unresolved()
const {
return unresolvedGroup() || unresolvedSlot(); }
102 inline void setGroup(
const IGroup *group) { group_ = group; groupName_ =
IString(); }
103 inline void setGroup(
const IString &name) { groupName_ = name; group_ =
nullptr; }
104 inline const IGroup * group()
const {
return group_; }
105 inline IString groupName()
const {
return group_ ? group_->getName() : groupName_; }
106 inline const IString &givenGroupName()
const {
return groupName_; }
107 inline bool operator <(
const IGroupID &group)
const {
if (slotIndex()!=group.slotIndex())
return slotIndex()<group.slotIndex();
return groupName().compare(group.groupName(),IString::Case::Insensitive)<0; }
109 const IGroup *group_ =
nullptr;