BioDynaMo
v1.05.120-25dc9790
|
Go to the documentation of this file.
15 #ifndef CORE_BEHAVIOR_BEHAVIOR_H_
16 #define CORE_BEHAVIOR_BEHAVIOR_H_
48 copy_mask_ =
event.existing_behavior->copy_mask_;
64 copy_mask_ = std::numeric_limits<NewAgentEventUid>::max();
70 void CopyToNewIf(
const std::initializer_list<NewAgentEventUid>& uids) {
71 for (
auto& uid : uids) {
79 remove_mask_ = std::numeric_limits<NewAgentEventUid>::max();
87 const std::initializer_list<NewAgentEventUid>& uids) {
88 for (
auto& uid : uids) {
105 void*
operator new(
size_t size) {
108 return mem_mgr->
New(size);
114 void operator delete(
void* p) {
130 #define BDM_BEHAVIOR_HEADER(class_name, base_class, class_version_id) \
132 using Base = base_class; \
134 Behavior* New() const override { return new class_name(); } \
136 Behavior* NewCopy() const override { return new class_name(*this); } \
139 BDM_CLASS_DEF_OVERRIDE(class_name, class_version_id); \
145 #endif // CORE_BEHAVIOR_BEHAVIOR_H_
void AlwaysRemoveFromExisting()
virtual void Update(const NewAgentEvent &event)
void CopyToNewIf(const std::initializer_list< NewAgentEventUid > &uids)
NewAgentEventUid copy_mask_
virtual void Initialize(const NewAgentEvent &event)
virtual ~Behavior()=default
void AlwaysCopyToNew()
Always copy this behavior to new agents.
bool WillBeRemoved(NewAgentEventUid event) const
Contains code required by all agents.
virtual Behavior * NewCopy() const =0
Create a new copy of this behavior.
MemoryManager * GetMemoryManager()
void NeverCopyToNew()
Never copy this behavior to new agents.
uint64_t NewAgentEventUid
void NeverRemoveFromExisting()
void RemoveFromExistingIf(const std::initializer_list< NewAgentEventUid > &uids)
void * New(std::size_t size)
bool WillBeCopied(NewAgentEventUid event) const
virtual Behavior * New() const =0
Create a new instance of this object using the default constructor.
static Simulation * GetActive()
This function returns the currently active Simulation simulation.
virtual void Run(Agent *agent)=0
BDM_CLASS_DEF(Behavior, 2)
NewAgentEventUid remove_mask_