Controller

TODO

Controller objects in C++ are referenced by the following shared pointer typedef:

typedef std::shared_ptr<rogue::protocols::packetizer::Controller> rogue::protocols::packetizer::ControllerPtr

The class description is shown below:

class Controller

Packetizer base controller.

Shared controller logic for packetizer variants that route data between one transport endpoint and multiple application endpoints.

Subclassed by rogue::protocols::packetizer::ControllerV1, rogue::protocols::packetizer::ControllerV2

Public Functions

Controller(std::shared_ptr<rogue::protocols::packetizer::Transport> tran, std::shared_ptr<rogue::protocols::packetizer::Application> *app, uint32_t headSize, uint32_t tailSize, uint32_t alignSize, bool enSsi)

Constructs a packetizer controller base.

Parameters:
  • tranTransport endpoint associated with this controller.

  • app – Pointer to application endpoint array indexed by destination.

  • headSize – Header bytes inserted per packet.

  • tailSize – Trailer bytes inserted per packet.

  • alignSize – Payload alignment requirement in bytes.

  • enSsi – Enable SSI framing behavior.

~Controller()

Destroys the packetizer controller base.

std::shared_ptr<rogue::interfaces::stream::Frame> reqFrame(uint32_t size)

Allocates a transport-path frame.

Parameters:

size – Minimum payload size in bytes.

Returns:

Allocated frame.

virtual void transportRx(std::shared_ptr<rogue::interfaces::stream::Frame> frame)

Processes a frame received from transport.

Parameters:

frame – Input transport frame.

void stopQueue()

Stops the internal transmit queue.

void stop()

Stops controller processing.

std::shared_ptr<rogue::interfaces::stream::Frame> transportTx()

Returns the next frame for transport transmission.

Returns:

Frame ready for transport transmit, or null when none is available.

virtual void applicationRx(std::shared_ptr<rogue::interfaces::stream::Frame> frame, uint8_t id)

Processes a frame received from an application endpoint.

Parameters:
  • frame – Input application frame.

  • idApplication destination identifier.

uint32_t getDropCount()

Returns dropped-frame counter.

Returns:

Number of dropped frames.

void setTimeout(uint32_t timeout)

Sets timeout in microseconds for frame transmits.

Parameters:

timeout – Timeout value in microseconds.