chronon::sender::OutPort
#include <OutPort.hpp>
Inherits from chronon::sender::PortBase
Public Types
| Name | |
|---|---|
| using T | value_type |
Public Functions
| Name | |
|---|---|
| bool | transparentBroadcastEnabled() const |
| bool | transparentBroadcastCapacityEligible(size_t headroom_cycles) const |
| void | setPerCycleCapacity(size_t cap) |
| void | setDependencyOnlyTransport(bool enabled =true, size_t cross_thread_headroom =std::numeric_limits< size_t >::max()) |
| size_t | sentThisCycle() const |
| bool | sendImmediate(const T & data) |
| bool | sendImmediate(T && data) |
| bool | send(const T & data) |
| bool | send(T && data) |
| size_t | remainingThisCycle() const |
| size_t | perCycleCapacity() const |
| bool | isConnected() const |
| uint64_t | getCurrentCycle() const |
| bool | enableTransparentBroadcast(size_t headroom_cycles) |
| bool | dependencyOnlyTransport() const |
| const std::vector< std::unique_ptr< Connection< T > > > & | connections() const |
| Connection< T > * | connectionTo(const InPort< T > * to) Find the first connection targeting to, or nullptr if not connected. |
| const Connection< T > * | connectionTo(const InPort< T > * to) const Find the first connection targeting to, or nullptr if not connected. |
| size_t | connectionCount() const |
| Connection< T > * | connect(InPort< T > * to, uint32_t delay) |
| void | cancelInFlight() |
| bool | canSend() const |
| OutPort(Unit * owner, std::string name, size_t per_cycle_capacity =1) |
Public Attributes
| Name | |
|---|---|
| size_t | UNLIMITED_CAPACITY |
Friends
| Name | |
|---|---|
| class | PortTransaction |
Additional inherited members
Public Functions inherited from chronon::sender::PortBase
| Name | |
|---|---|
| virtual | ~PortBase() =default |
| virtual void | prepareConsumerCycle(uint64_t ) |
| Unit * | owner() const |
| const std::string & | name() const |
| virtual std::optional< uint64_t > | minArrivalCycle() const Earliest pending arrival visible through this port, if any. |
Protected Functions inherited from chronon::sender::PortBase
| Name | |
|---|---|
| PortBase(Unit * owner, std::string name) |
Protected Attributes inherited from chronon::sender::PortBase
| Name | |
|---|---|
| Unit * | owner_ |
| std::string | name_ |
Detailed Description
template <typename T >
class chronon::sender::OutPort;
OutPort - Sends data to connected InPorts.
Features:
- Connects to multiple InPorts with different delays
- Synchronous send for tick-based units
Usage: OutPort
// In tick() method. canSend() is only a preflight check; callers // must still handle send() returning false. if (out.canSend() && out.send(42)) { // local state can now advance }
Public Types Documentation
using value_type
using chronon::sender::OutPort< T >::value_type = T;
Public Functions Documentation
function transparentBroadcastEnabled
inline bool transparentBroadcastEnabled() const
function transparentBroadcastCapacityEligible
inline bool transparentBroadcastCapacityEligible(
size_t headroom_cycles
) const
function setPerCycleCapacity
inline void setPerCycleCapacity(
size_t cap
)
Set the per-cycle send capacity at runtime (UNLIMITED_CAPACITY = unlimited). Passing 0 is accepted as the legacy unlimited spelling.
function setDependencyOnlyTransport
inline void setDependencyOnlyTransport(
bool enabled =true,
size_t cross_thread_headroom =std::numeric_limits< size_t >::max()
)
Disable physical payload transport while retaining all connections as scheduler dependency edges. Configure this before simulation initialization. send()/canSend() still enforce the OutPort's per-cycle capacity without walking the fanout. A finite cross_thread_headroom is exported through every connection for scheduler reverse dependencies.
function sentThisCycle
inline size_t sentThisCycle() const
function sendImmediate
inline bool sendImmediate(
const T & data
)
function sendImmediate
inline bool sendImmediate(
T && data
)
function send
inline bool send(
const T & data
)
Parameters:
- data The data to send
Return: true if all sends succeeded, false if any destination was full. Multi-destination sends are preflighted before transfer so normal back-pressure failure is all-or-none.
Send data through all connections.
The current cycle is obtained from the owner unit.
function send
inline bool send(
T && data
)
Return: true if all sends succeeded, false if any destination was full. Multi-destination sends are preflighted before transfer so normal back-pressure failure is all-or-none.
Send data with move semantics.
function remainingThisCycle
inline size_t remainingThisCycle() const
Return: Remaining sends, or UNLIMITED_CAPACITY if unlimited.
function perCycleCapacity
inline size_t perCycleCapacity() const
Return: Max sends per cycle (UNLIMITED_CAPACITY = unlimited).
function isConnected
inline bool isConnected() const
function getCurrentCycle
uint64_t getCurrentCycle() const
Read the owning Unit's localCycle. Public so Connection
function enableTransparentBroadcast
inline bool enableTransparentBroadcast(
size_t headroom_cycles
)
Install a Port-internal one-write/many-reader transport. TickSimulation calls this only after validating the complete connected component, so every destination InPort switches atomically from physical queues to shared replay while the declared connections remain dependency edges.
function dependencyOnlyTransport
inline bool dependencyOnlyTransport() const
function connections
inline const std::vector< std::unique_ptr< Connection< T > > > & connections() const
function connectionTo
inline Connection< T > * connectionTo(
const InPort< T > * to
)
Find the first connection targeting to, or nullptr if not connected.
function connectionTo
inline const Connection< T > * connectionTo(
const InPort< T > * to
) const
Find the first connection targeting to, or nullptr if not connected.
function connectionCount
inline size_t connectionCount() const
function connect
inline Connection< T > * connect(
InPort< T > * to,
uint32_t delay
)
Parameters:
- to The destination input port
- delay The delivery delay in cycles
Return: The created connection
Connect to an input port with specified delay.
function cancelInFlight
inline void cancelInFlight()
Cancel all in-flight messages previously sent on this OutPort.
Advances a per-connection cancellation epoch. Messages already enqueued at destination ports will be dropped on receive.
function canSend
inline bool canSend() const
Check if all connected destinations can accept data.
Use this to check before sending when back pressure is important.
function OutPort
inline OutPort(
Unit * owner,
std::string name,
size_t per_cycle_capacity =1
)
Public Attributes Documentation
variable UNLIMITED_CAPACITY
static size_t UNLIMITED_CAPACITY = std::numeric_limits<size_t>::max();
Parameters:
- owner The unit that owns this port
- name The port name (for debugging)
- per_cycle_capacity Max sends per cycle. Defaults to one registered-edge entry per cycle. UNLIMITED_CAPACITY or 0 explicitly opts out.
Create an output port.
Automatically registers with PortDirectory when owner's TreeNode is set.
Friends
friend PortTransaction
friend class PortTransaction(
PortTransaction
);
Updated on 2026-07-23 at 16:24:33 +0000