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
andholoscan::GreedyScheduler
. 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.
-
inline int64_t id() const
Get the identifier of the component.
By default, the identifier is set to -1. It is set to a valid value when the component is initialized.
With the default executor (GXFExecutor), the identifier is set to the GXF component ID.
- Returns
The identifier of the component.
-
inline void add_arg(const Arg &arg)
Add an argument to the component.
- Parameters
arg – The argument to add.
-
inline void add_arg(Arg &&arg)
Add an argument to the component.
- Parameters
arg – The argument to add.
-
inline void add_arg(const ArgList &arg)
Add a list of arguments to the component.
- Parameters
arg – The list of arguments to add.
-
inline void add_arg(ArgList &&arg)
Add a list of arguments to the component.
- Parameters
arg – The list of arguments to add.
Protected Attributes
- std::shared_ptr<ComponentSpec> spec_
The component specification.
- std::unordered_map<std::string, std::shared_ptr<Resource>> resources_
The resources used by the scheduler.