13#include "sparta/utils/Utils.hpp"
93 const std::string & exported_port_name,
95 const std::string & internal_port_name) :
97 internal_port_search_path_(internal_port_search_path),
98 internal_port_name_(internal_port_name)
111 const std::string & exported_port_name,
114 internal_port_(internal_port),
115 internal_port_name_(internal_port->
getName())
128 if(
nullptr != internal_port_) {
129 return internal_port_->
isBound();
140 if(
nullptr == internal_port_) {
149 sparta_assert(
false,
"You cannot set auto precedence on an ExportedPort");
177 std::string
stringize(
bool pretty=
false)
const override {
179 std::stringstream ss;
200 const std::string internal_port_name_;
File that defines the Port base class.
#define sparta_assert(...)
Simple variadic assertion that will throw a sparta_exception if the condition fails.
Basic Node framework in sparta device tree composite pattern.
Class that "exports" a port that's contained in the same ResourceTreeNode structure.
Direction getDirection() const override
Get the direction of the port.
const sparta::Port * getInternalPort() const
Return the intenal representative port (const)
ExportedPort(sparta::TreeNode *portset, const std::string &exported_port_name, sparta::TreeNode *internal_port_search_path, const std::string &internal_port_name)
Create an ExportedPort that exposes an internal port by name.
std::string stringize(bool pretty=false) const override
Print the exported port.
bool isBound() const override final
Override Port::isBound.
sparta::Port * getInternalPort()
Return the intenal representative port (non-const)
ExportedPort(sparta::TreeNode *portset, const std::string &exported_port_name, sparta::Port *internal_port)
Create an ExportedPort for an explicit internal port.
void participateInAutoPrecedence(bool) override final
Function that cannot be used in ExportedPort. The user must set auto precedence directly in the inter...
bool doesParticipateInAutoPrecedence() const override final
Does the internal Port participate in auto-precedence.
void bind(Port *port) override final
Override Port::bind.
The port interface used to bind port types together and defines a port behavior.
std::string stringize(bool x) const override
Stringize the Port.
virtual bool isBound() const
Is this port bound to another port?
Direction
The direction of this port.
virtual bool doesParticipateInAutoPrecedence() const
Does this Port participate in auto-precedence establishment by sparta::Unit?
virtual Direction getDirection() const
The direction of the port.
Node in a composite tree representing a sparta Tree item.
std::string getLocation() const override final
const std::string & getName() const override
Gets the name of this node.
Macros for handling exponential backoff.
T * notNull(T *p)
Ensures that a pointer is not null.