rogue
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
rogue::protocols::srp::Cmd Class Reference

Lightweight command protocol transmitter for opcode/context messages. More...

#include <Cmd.h>

Inheritance diagram for rogue::protocols::srp::Cmd:
rogue::interfaces::stream::Master rogue::EnableSharedFromThis< rogue::interfaces::stream::Master > rogue::EnableSharedFromThisBase

Public Member Functions

 Cmd ()
 Constructs an SRP command interface.
 
 ~Cmd ()
 Destroys the SRP command interface.
 
void sendCmd (uint8_t opCode, uint32_t context)
 Sends an SRP command frame.
 
- Public Member Functions inherited from rogue::interfaces::stream::Master
 Master ()
 Constructs a stream master.
 
virtual ~Master ()
 Destroys the stream master.
 
uint32_t slaveCount ()
 Returns the number of attached slaves.
 
void addSlave (std::shared_ptr< rogue::interfaces::stream::Slave > slave)
 Attaches a downstream slave.
 
std::shared_ptr< rogue::interfaces::stream::FramereqFrame (uint32_t size, bool zeroCopyEn)
 Requests allocation of a new frame from the primary slave.
 
void sendFrame (std::shared_ptr< rogue::interfaces::stream::Frame > frame)
 Sends a frame to all attached slaves.
 
bool ensureSingleBuffer (std::shared_ptr< rogue::interfaces::stream::Frame > &frame, bool reqEn)
 Ensures a frame is represented by a single buffer.
 
virtual void stop ()
 Stops frame generation and shuts down associated threads.
 
void equalsPy (boost::python::object p)
 Supports == operator usage from Python.
 
boost::python::object rshiftPy (boost::python::object p)
 Supports >> operator usage from Python.
 
void operator== (std::shared_ptr< rogue::interfaces::stream::Slave > &other)
 Supports == operator usage in C++.
 
std::shared_ptr< rogue::interfaces::stream::Slave > & operator>> (std::shared_ptr< rogue::interfaces::stream::Slave > &other)
 Connects this master to a slave via stream chaining operator.
 
- Public Member Functions inherited from rogue::EnableSharedFromThis< rogue::interfaces::stream::Master >
std::shared_ptr< rogue::interfaces::stream::Mastershared_from_this ()
 Returns a shared_ptr<T> for this instance.
 
- Public Member Functions inherited from rogue::EnableSharedFromThisBase
virtual ~EnableSharedFromThisBase ()
 Virtual destructor for polymorphic base usage.
 

Static Public Member Functions

static std::shared_ptr< rogue::protocols::srp::Cmdcreate ()
 Creates an SRP command interface instance.
 
static void setup_python ()
 Registers Python bindings for this class.
 
- Static Public Member Functions inherited from rogue::interfaces::stream::Master
static std::shared_ptr< rogue::interfaces::stream::Mastercreate ()
 Creates a stream master.
 
static void setup_python ()
 Registers this type with Python bindings.
 

Detailed Description

Lightweight command protocol transmitter for opcode/context messages.

Cmd implements a small command protocol that carries only an opcode and a context value. It is typically used for lightweight hardware commands such as triggers, strobes, and other fire-and-forget control events.

This protocol is distinct from SRP and does not model request/response memory transactions. In common usage, frames sent by Cmd do not require a response path.

Historical note: the class resides in rogue::protocols::srp for API compatibility with existing applications. Although that namespace placement is not semantically ideal, changing it would break downstream code.

Definition at line 48 of file Cmd.h.

Constructor & Destructor Documentation

◆ Cmd()

rogue::protocols::srp::Cmd::Cmd ( )

Constructs an SRP command interface.

Creator with version constant.

This constructor is a low-level C++ allocation path. Prefer create() when shared ownership or Python exposure is required.

Definition at line 54 of file Cmd.cpp.

◆ ~Cmd()

rogue::protocols::srp::Cmd::~Cmd ( )

Destroys the SRP command interface.

Deconstructor.

Definition at line 57 of file Cmd.cpp.

Member Function Documentation

◆ create()

rogue::protocols::srp::CmdPtr rogue::protocols::srp::Cmd::create ( )
static

Creates an SRP command interface instance.

Class creation.

This static factory is the preferred construction path when the object is shared across Rogue graph connections or exposed to Python. It returns std::shared_ptr ownership compatible with Rogue pointer typedefs.

Returns
Shared pointer to the created Cmd.

Company : SLAC National Accelerator Laboratory

Description :

CMD protocol bridge, Version 0

This file is part of the rogue software platform. It is subject to the license terms in the LICENSE.txt file found in the top-level directory of this distribution and at: https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. No part of the rogue software platform, including this file, may be copied, modified, propagated, or distributed except according to the terms

contained in the LICENSE.txt file.

Definition at line 39 of file Cmd.cpp.

◆ sendCmd()

void rogue::protocols::srp::Cmd::sendCmd ( uint8_t  opCode,
uint32_t  context 
)

Sends an SRP command frame.

Post a transaction.

Parameters
opCodeSRP command opcode.
contextCommand context value carried in the frame.

Definition at line 60 of file Cmd.cpp.

◆ setup_python()

void rogue::protocols::srp::Cmd::setup_python ( )
static

Registers Python bindings for this class.

Setup class in python.

Definition at line 45 of file Cmd.cpp.


The documentation for this class was generated from the following files: