MCPcopy Create free account
hub / github.com/computationalpathologygroup/ASAP / setGroup

Method setGroup

annotation/AnnotationBase.cpp:34–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32};
33
34void AnnotationBase::setGroup(const std::shared_ptr<AnnotationGroup>& group) {
35 std::shared_ptr<AnnotationGroup> currentGroup = _group.lock();
36 if (!currentGroup || currentGroup != group) {
37 _group.reset();
38 if (currentGroup) {
39 currentGroup->removeMember(this->shared_from_this());
40 }
41 _group = group;
42 if (group) {
43 group->addMember(this->shared_from_this());
44 }
45 }
46}
47
48std::shared_ptr<AnnotationGroup> AnnotationBase::getGroup() const {
49 std::shared_ptr<AnnotationGroup> grp = _group.lock();

Callers 5

addMemberMethod · 0.80
removeMemberMethod · 0.80
loadFromRepoMethod · 0.80
loadFromRepoMethod · 0.80
eventFilterMethod · 0.80

Calls 2

removeMemberMethod · 0.80
addMemberMethod · 0.80

Tested by

no test coverage detected