Class Scheduler
Defined in File scheduler.hpp
Base Type
public holoscan::Component
(Class Component)
Derived Type
public holoscan::gxf::GXFScheduler
(Class GXFScheduler)
-
class Scheduler : public holoscan::Component
Base class for all schedulers.
This class is the base class for all schedulers including
holoscan::MultiThreadScheduler
,holoscan::GreedyScheduler
andholoscan::EventBasedScheduler
. It is used to define the common interface for all schedulers.Subclassed by holoscan::gxf::GXFScheduler
Public Functions
- Scheduler() = default
- Scheduler(Scheduler&&) = default
-
template<typename ArgT, typename ...ArgsT, typename = std::enable_if_t<!std::is_base_of_v<Scheduler, std::decay_t<ArgT>> && (std::is_same_v<Arg, std::decay_t<ArgT>> || std::is_same_v<ArgList, std::decay_t<ArgT>>)>>
inline explicit Scheduler(ArgT &&arg, ArgsT&&... args)
Construct a new Scheduler object.
- ~Scheduler() override = default
-
inline Scheduler &id(int64_t id)
Set the Scheduler ID.
- Parameters
- Returns
id – The ID of the scheduler.
The reference to this scheduler.
-
inline Scheduler &name(const std::string &name) &
Set the name of the scheduler.
- Parameters
- Returns
name – The name of the scheduler.
The reference to the scheduler.
-
inline Scheduler &&name(const std::string &name) &&
Set the name of the scheduler.
- Parameters
- Returns
name – The name of the scheduler.
The reference to the scheduler.
-
inline Scheduler &fragment(Fragment *fragment)
Set the fragment of the scheduler.
- Parameters
- Returns
fragment – The pointer to the fragment of the scheduler.
The reference to the scheduler.
Set the component specification to the scheduler.
- Parameters
- Returns
spec – The component specification.
The reference to the scheduler.
-
inline ComponentSpec *spec()
Get the component specification of the scheduler.
- Returns
The pointer to the component specification.
Get the shared pointer to the component spec.
- Returns
The shared pointer to the component spec.
Add a resource to the scheduler.
- Parameters
arg – The resource to add.
Add a resource to the scheduler.
- Parameters
arg – The resource to add.
-
inline std::unordered_map<std::string, std::shared_ptr<Resource>> &resources()
Get the resources of the scheduler.
- Returns
The resources of the scheduler.
-
inline virtual void setup(ComponentSpec &spec)
Define the scheduler specification.
- Parameters
spec – The reference to the component specification.
- virtual void initialize() override
Initialize the scheduler.
This function is called after the scheduler is created by holoscan::Fragment::make_scheduler().
-
virtual YAML::Node to_yaml_node() const override
Get a YAML representation of the scheduler.
- Returns
YAML node including the base component properties, component spec and resources.
Protected Functions
- virtual void reset_graph_entities() override
Reset the GXF GraphEntity of any components associated with the scheduler.
Protected Attributes
- std::unordered_map<std::string, std::shared_ptr<Resource>> resources_
The resources used by the scheduler.