-/* Copyright (c) 2006-2020. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2006-2021. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
#include <simgrid/chrono.hpp>
#include <xbt/Extendable.hpp>
-#include <xbt/functional.hpp>
#include <xbt/signal.hpp>
#include <xbt/string.hpp>
#include <functional>
-#include <map> // deprecated wrappers
#include <unordered_map>
namespace simgrid {
friend XBT_PUBLIC void intrusive_ptr_release(const Actor* actor);
#endif
/** Retrieve the amount of references on that object. Useful to debug the automatic refcounting */
- int get_refcount();
+ int get_refcount() const;
// ***** Actor creation *****
/** Retrieve a reference to myself */
static ActorPtr create(const std::string& name, s4u::Host* host, const std::function<void()>& code);
/** Create an actor, but don't start it yet.
*
- * This is usefull to set some properties or extension before actually starting it */
+ * This is useful to set some properties or extension before actually starting it */
static ActorPtr init(const std::string& name, s4u::Host* host);
ActorPtr set_stacksize(unsigned stacksize);
/** Start a previously initialized actor */
void resume();
/** Returns true if the actor is suspended. */
- bool is_suspended();
+ bool is_suspended() const;
/** If set to true, the actor will automatically restart when its host reboots */
void set_auto_restart(bool autorestart);
/** Sets the time at which that actor should be killed */
void set_kill_time(double time);
/** Retrieves the time at which that actor will be killed (or -1 if not set) */
- double get_kill_time();
+ double get_kill_time() const;
/** @brief Moves the actor to another host
*
* Blocks the calling actor until the joined actor is terminated. If actor alice executes bob.join(), then alice is
* blocked until bob terminates.
*/
- void join();
+ void join() const;
/** Wait for the actor to finish, or for the timeout to elapse.
*
* Blocks the calling actor until the joined actor is terminated. If actor alice executes bob.join(), then alice is
* blocked until bob terminates.
*/
- void join(double timeout);
+ void join(double timeout) const;
/** Kill that actor and restart it from start. */
Actor* restart();