From cc7cf670bbbae240b616a900a3b8ca74f24a0b99 Mon Sep 17 00:00:00 2001 From: "James P. Howard, II" Date: Thu, 4 Aug 2022 10:07:44 -0400 Subject: [PATCH] Add dummy c'stor and d'stor to the starter example --- examples/starter/starter.cc | 8 ++++++++ examples/starter/starter.h | 14 +++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/examples/starter/starter.cc b/examples/starter/starter.cc index bf15989..17b613f 100644 --- a/examples/starter/starter.cc +++ b/examples/starter/starter.cc @@ -53,6 +53,14 @@ struct fmt::formatter : fmt::formatter { } }; +StarterAgent::StarterAgent() { + console->debug("StarterAgent with ID {} constructed", this->get_agent_id()); +} + +StarterAgent::~StarterAgent() { + console->debug("StarterAgent with ID {} deconstructed", this->get_agent_id()); +} + kami::AgentID StarterAgent::step(std::shared_ptr model) { this->_step_counter++; return this->get_agent_id(); diff --git a/examples/starter/starter.h b/examples/starter/starter.h index 4a63c55..88841be 100644 --- a/examples/starter/starter.h +++ b/examples/starter/starter.h @@ -32,20 +32,32 @@ #include #include -#include #include /** * A starter agent for a starter model */ class StarterAgent : public kami::Agent { +private: int _step_counter = 0; public: + + /** + * Constructor + */ + StarterAgent(); + + /** + * Deconstructor + */ + ~StarterAgent(); + /** * Execute a single time-step for the agent */ kami::AgentID step(std::shared_ptr model) override; + }; /**