16#ifndef __OMNETPP_CSOFTOWNER_H
17#define __OMNETPP_CSOFTOWNER_H
19#include "cownedobject.h"
33class SIM_API cSoftOwner :
public cNoncopyableOwnedObject
36 friend class cOwnedObject;
37 friend class cChannelType;
40 cOwnedObject **objs =
nullptr;
44#ifdef SIMFRONTEND_SUPPORT
46 int64_t lastChangeSerial;
50 void doInsert(cOwnedObject *obj);
51 virtual void ownedObjectDeleted(cOwnedObject *obj)
override;
52 virtual void yieldOwnership(cOwnedObject *obj, cObject *newOwner)
override;
54 void reportUndisposed();
55 virtual void objectStealingOnDeletion(cOwnedObject *obj);
59 explicit cSoftOwner(
const char *name,
bool namepooling, internal::Void *dummy) : cNoncopyableOwnedObject(name, namepooling, dummy) {}
61#ifdef SIMFRONTEND_SUPPORT
63 void updateLastChangeSerial() {lastChangeSerial = changeCounter++;}
64 virtual bool hasChangedSince(int64_t lastRefreshSerial);
74 virtual void take(cOwnedObject *obj)
override;
79 virtual void drop(cOwnedObject *obj)
override;
87 explicit cSoftOwner(
const char *name=
nullptr,
bool namepooling=
true);
106 virtual std::string
str()
const override;
cOwnedObject * getOwnedObject(int k)
virtual void take(cOwnedObject *obj) override
cSoftOwner(const char *name=nullptr, bool namepooling=true)
virtual bool isSoftOwner() const override
Definition csoftowner.h:100
virtual void drop(cOwnedObject *obj) override
virtual void forEachChild(cVisitor *v) override
virtual std::string str() const override
int getNumOwnedObjects() const
Definition csoftowner.h:122
Enables traversing the tree of (cObject-rooted) simulation objects.
Definition cvisitor.h:57