- virtual void suspend() = 0;
- virtual void resume() = 0;
- virtual void post() = 0; // What to do when a simcall terminates
+protected:
+ void inline set_name(const std::string& name)
+ {
+ // This is to keep name_ private while allowing ActivityImpl_T<??> to set it and then return a Ptr to qualified
+ // child type
+ name_ = name;
+ }
+
+public:
+ const std::string& get_name() const { return name_; }
+ const char* get_cname() const { return name_.c_str(); }
+
+ bool test();
+ void wait_for(actor::ActorImpl* issuer, double timeout);
+ virtual ActivityImpl& set_timeout(double) { THROW_UNIMPLEMENTED; }
+
+ virtual void suspend();
+ virtual void resume();
+ virtual void cancel();
+
+ virtual void post() = 0; // Called by the main loop when the activity is marked as terminated or failed by its model.
+ // Setups the status, clean things up, and call finish()
+ virtual void finish() = 0; // Unlock all simcalls blocked on that activity, either because it was marked as done by
+ // the model or because it terminated without waiting for the model