29 mock_directory = connectionId +
"_mock_dir";
35 "Creating HwInterface. Adding server socket for device: ",
connectionId,
63 if (
nodes.count(nodeId)) {
64 return *
nodes[nodeId];
66 nodes[nodeId] = std::unique_ptr<Node>(
new Node(
this, nodeId));
67 return *
nodes[nodeId];
80 std::vector<uint32_t> data = {aValue};
97 return valuePtr->at(0);
108 const std::vector<uint32_t> &aValues)
const {
121 const uint32_t &aSize)
const {
124 return *msg.value.get();
138 log(uhal::Debug(),
"Creating node: ",
nodeId);
PSocketMode::PSocketMode mock_mode
virtual ~HwInterface()
Destructor for the HwInterface class.
std::vector< uint32_t > readBlock(const std::string &nodeId, const uint32_t &aSize) const
Reads a block of data from a specific node.
std::string connectionFilePath
bool write(const std::string &nodeId, const uint32_t &aValue)
Writes data to a specific node.
Node & getNode(const std::string nodeId)
Retrieves a node by its identifier.
bool writeBlock(const std::string &nodeId, const std::vector< uint32_t > &aValues) const
Writes a block of data to a specific node.
static SocketManager manager
std::map< std::string, std::unique_ptr< Node > > nodes
std::string mock_directory
uint32_t read(const std::string nodeId) const
Reads data from a specific node.
HwInterface(std::string connectionFilePath, std::string connectionId, PSocketMode::PSocketMode _mock_mode, std::string mock_directory="")
Constructor for the HwInterface class.
bool writeBlock(const std::vector< uint32_t > &aValues) const
Writes a block of data to a specific node.
uint32_t read() const
Reads a value from the node.
~Node()
Destructor for the Node class.
Node(HwInterface *_hwInterface, const std::string _nodeId)
Constructor for the Node class.
bool write(const uint32_t &aValue) const
Writes a value to the node.
std::vector< uint32_t > readBlock(const uint32_t &aSize) const
Reads a block of data from the node.
HwInterface * hwInterface
Set of parameters to be passed as message.
std::unique_ptr< std::vector< uint32_t > > value
PGenericSocketManager< std::string, PIpBusBackend, PMockBackend > SocketManager