The is the base class for all types of resources used by the SPARTA framework.
More...
#include <Resource.hpp>
The is the base class for all types of resources used by the SPARTA framework.
Definition at line 43 of file Resource.hpp.
◆ Resource() [1/3]
sparta::Resource::Resource |
( |
TreeNode * |
rc | ) |
|
Construct resource with a resource container.
- Parameters
-
rc | ResourceContainter that will hold this Resource until the Resource is destructed. Name and clock are extracted from this container. Must not be nullptr |
◆ Resource() [2/3]
sparta::Resource::Resource |
( |
TreeNode * |
rc, |
|
|
const std::string & |
name |
|
) |
| |
Construct resource with a specific name and resource container.
- Note
- It is recommended to use another consturctor with the name extracted from the ResourceContainer instead of specifying a name.
- Parameters
-
rc | ResourceContainter that will hold this Resource until the Resource is destructed. Clock is extracted from this container. Must not be nullptr |
name | Name to give the resource |
◆ Resource() [3/3]
sparta::Resource::Resource |
( |
const std::string & |
name, |
|
|
const Clock * |
clk |
|
) |
| |
Construct a Resource with the given name and clock having NO association with a resource container. This constructor is reserved for free-standing resources owned by other resources (not containers [TreeNodes])
- Parameters
-
- Note
- This constructor is deprecated
◆ activateLink()
virtual void sparta::Resource::activateLink |
( |
const std::string & |
label | ) |
|
|
inlinevirtual |
Lets the resource know that one of its link are now active
- Parameters
-
label | The label of the TreeNode the container got linked with |
Definition at line 139 of file Resource.hpp.
◆ addLink()
virtual void sparta::Resource::addLink |
( |
TreeNode * |
node, |
|
|
const std::string & |
label |
|
) |
| |
|
inlinevirtual |
Lets the resource know when its container is linked with another TreeNode
- Parameters
-
node | The TreeNode the container got linked with |
label | The label of the TreeNode the container got linked with |
Definition at line 128 of file Resource.hpp.
◆ getClock()
const Clock * sparta::Resource::getClock |
( |
| ) |
const |
- Returns
- Pointer to this resource's clock
◆ getContainer() [1/2]
TreeNode * sparta::Resource::getContainer |
( |
| ) |
|
Gets the TreeNode (container) for this resource (if any)
- Note
- TreeNode is a subclass of ResourcecContainer
◆ getContainer() [2/2]
const TreeNode * sparta::Resource::getContainer |
( |
| ) |
const |
Gets the TreeNode (container) for this resource (if any)
- Note
- TreeNode is a subclass of ResourcecContainer
◆ getName()
std::string sparta::Resource::getName |
( |
| ) |
const |
◆ getScheduler()
Scheduler * sparta::Resource::getScheduler |
( |
const bool |
must_exist = true | ) |
const |
- Returns
- Pointer to this resource's scheduler
◆ TreeNode
The documentation for this class was generated from the following file: