|
rogue
|
Memory TCP bridge server. More...
#include <TcpServer.h>
Public Member Functions | |
| TcpServer (std::string addr, uint16_t port) | |
| Constructs a TCP memory bridge server. | |
| ~TcpServer () | |
| Destroys the TCP server and releases transport resources. | |
| void | close () |
| Closes bridge connections. | |
| void | stop () |
| Stops the bridge interface and worker thread. | |
| void | start () |
| Managed-lifecycle startup hook. | |
Public Member Functions inherited from rogue::interfaces::memory::Master | |
| Master () | |
| Constructs a memory master instance. | |
| virtual | ~Master () |
| Destroys the memory master instance. | |
| void | setSlave (std::shared_ptr< rogue::interfaces::memory::Slave > slave) |
| Sets the downstream slave or hub. | |
| std::shared_ptr< rogue::interfaces::memory::Slave > | getSlave () |
| Returns the configured downstream slave or hub. | |
| uint32_t | reqSlaveId () |
| Queries the downstream slave ID. | |
| std::string | reqSlaveName () |
| Queries the downstream slave name. | |
| uint32_t | reqMinAccess () |
| Queries minimum access size in bytes for this interface path. | |
| uint32_t | reqMaxAccess () |
| Queries maximum access size in bytes for this interface path. | |
| uint64_t | reqAddress () |
| Queries the address offset of the next downstream layer. | |
| std::string | getError () |
| Returns the last transaction error string. | |
| void | clearError () |
| Clears the stored transaction error string. | |
| void | setTimeout (uint64_t timeout) |
| Sets the timeout value for future transactions. | |
| uint32_t | reqTransaction (uint64_t address, uint32_t size, void *data, uint32_t type) |
| Starts a new transaction. | |
| uint32_t | reqTransactionPy (uint64_t address, boost::python::object p, uint32_t size, uint32_t offset, uint32_t type) |
Python variant of reqTransaction. | |
| void | rshiftPy (boost::python::object p) |
Supports >> operator usage from Python. | |
| std::shared_ptr< rogue::interfaces::memory::Slave > & | operator>> (std::shared_ptr< rogue::interfaces::memory::Slave > &other) |
| Connects this master to a slave via stream chaining operator. | |
| void | waitTransaction (uint32_t id) |
| Waits for transaction completion or timeout. | |
Static Public Member Functions | |
| static std::shared_ptr< rogue::interfaces::memory::TcpServer > | create (std::string addr, uint16_t port) |
| Creates a TCP memory bridge server. | |
| static void | setup_python () |
| Registers this type with Python bindings. | |
Static Public Member Functions inherited from rogue::interfaces::memory::Master | |
| static std::shared_ptr< rogue::interfaces::memory::Master > | create () |
| Creates a memory master instance. | |
| static void | setup_python () |
| Registers this type with Python bindings. | |
| static void | copyBits (uint8_t *dstData, uint32_t dstLsb, uint8_t *srcData, uint32_t srcLsb, uint32_t size) |
| Copies bits between two byte arrays. | |
| static void | copyBitsPy (boost::python::object dst, uint32_t dstLsb, boost::python::object src, uint32_t srcLsb, uint32_t size) |
Python wrapper for copyBits. | |
| static void | setBits (uint8_t *dstData, uint32_t lsb, uint32_t size) |
| Sets a contiguous bit range in a byte array. | |
| static void | setBitsPy (boost::python::object dst, uint32_t lsb, uint32_t size) |
Python wrapper for setBits. | |
| static bool | anyBits (uint8_t *srcData, uint32_t lsb, uint32_t size) |
| Tests whether any bit in a range is set. | |
| static bool | anyBitsPy (boost::python::object src, uint32_t lsb, uint32_t size) |
Python wrapper for anyBits. | |
Additional Inherited Members | |
Protected Member Functions inherited from rogue::interfaces::memory::Master | |
| uint32_t | intTransaction (std::shared_ptr< rogue::interfaces::memory::Transaction > tran) |
| Starts an internal transaction from an existing transaction object. | |
Memory TCP bridge server.
Implements the server side of the memory TCP bridge.
The server receives request messages from remote TcpClient instances on a base port and returns completion/result messages on base port + 1. Each inbound request is translated into a local memory transaction executed through this Master interface to the attached downstream slave path.
Operational behavior:
Definition at line 52 of file TcpServer.h.
| rogue::interfaces::memory::TcpServer::TcpServer | ( | std::string | addr, |
| uint16_t | port | ||
| ) |
Constructs a TCP memory bridge server.
Creator.
addr may be a hostname, IP address, or "*" to bind on all interfaces. The bridge uses two consecutive TCP ports starting at port; for example, port=8000 uses ports 8000 and 8001.
This constructor is a low-level C++ allocation path. Prefer create() when shared ownership or Python exposure is required.
| addr | Local bind address. |
| port | Base TCP port number. |
Definition at line 47 of file TcpServer.cpp.
| rogue::interfaces::memory::TcpServer::~TcpServer | ( | ) |
Destroys the TCP server and releases transport resources.
Destructor.
Definition at line 111 of file TcpServer.cpp.
| void rogue::interfaces::memory::TcpServer::close | ( | ) |
|
static |
Creates a TCP memory bridge server.
Class creation.
Parameter semantics are identical to the constructor; see TcpServer() for address and port behavior details.
Exposed as rogue.interfaces.memory.TcpServer() in Python.
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.
| addr | Local bind address. |
| port | Base TCP port number. |
Description:
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
Definition at line 41 of file TcpServer.cpp.
|
static |
Registers this type with Python bindings.
Definition at line 249 of file TcpServer.cpp.
| void rogue::interfaces::memory::TcpServer::start | ( | ) |
Managed-lifecycle startup hook.
The server binds and starts its worker thread in the constructor, so the managed startup hook is a no-op. It exists so TcpServer can participate uniformly in PyRogue managed interface lifecycle handling.
Definition at line 119 of file TcpServer.cpp.
|
virtual |
Stops the bridge interface and worker thread.
Reimplemented from rogue::interfaces::memory::Master.
Definition at line 125 of file TcpServer.cpp.