IpbusMock  1.0.0
Library which integrates IPbus use in Phoenix
Loading...
Searching...
No Matches
PIpBusInterface::Node Class Reference

#include <HwInterface.h>

+ Collaboration diagram for PIpBusInterface::Node:

Public Member Functions

 Node (HwInterface *_hwInterface, const std::string _nodeId)
 Constructor for the Node class.
 
uint32_t read () const
 Reads a value from the node.
 
std::vector< uint32_t > readBlock (const uint32_t &aSize) const
 Reads a block of data from the node.
 
bool write (const uint32_t &aValue) const
 Writes a value to the node.
 
bool writeBlock (const std::vector< uint32_t > &aValues) const
 Writes a block of data to a specific node.
 
 ~Node ()
 Destructor for the Node class.
 

Private Attributes

HwInterfacehwInterface
 
std::string nodeId
 

Detailed Description

Definition at line 19 of file HwInterface.h.

Constructor & Destructor Documentation

◆ Node()

Node::Node ( HwInterface * _hwInterface,
const std::string _nodeId )

Constructor for the Node class.

Initializes a Node object with a reference to the HwInterface and the node identifier.

Parameters
hwInterfacePointer to the HwInterface instance.
nodeIdIdentifier of the node.

Definition at line 136 of file HwInterface.cpp.

137 : hwInterface(_hwInterface), nodeId(_nodeId) {
138 log(uhal::Debug(), "Creating node: ", nodeId);
139}
HwInterface * hwInterface
Definition HwInterface.h:34

References hwInterface, and nodeId.

◆ ~Node()

Node::~Node ( )

Destructor for the Node class.

Logs the deletion of the node.

Definition at line 146 of file HwInterface.cpp.

146{ log(uhal::Debug(), "Deleting node: ", nodeId); }

References nodeId.

Member Function Documentation

◆ read()

uint32_t Node::read ( ) const

Reads a value from the node.

Delegates the read operation to the HwInterface instance.

Returns
The value read from the node.

Definition at line 168 of file HwInterface.cpp.

168{ return hwInterface->read(nodeId); }

References hwInterface, and nodeId.

◆ readBlock()

std::vector< uint32_t > Node::readBlock ( const uint32_t & aSize) const

Reads a block of data from the node.

Delegates the readBlock operation to the HwInterface instance.

Parameters
aSizeNumber of values to read.
Returns
Vector of values read from the node.

Definition at line 178 of file HwInterface.cpp.

178 {
179 return hwInterface->readBlock(nodeId, aSize);
180}

References hwInterface, and nodeId.

◆ write()

bool Node::write ( const uint32_t & aValue) const

Writes a value to the node.

Delegates the write operation to the HwInterface instance.

Parameters
aValueValue to write to the node.
Returns
true if the write operation was successful, false otherwise.

Definition at line 156 of file HwInterface.cpp.

156 {
157 hwInterface->write(nodeId, aValue);
158 return true;
159}

References hwInterface, and nodeId.

◆ writeBlock()

bool Node::writeBlock ( const std::vector< uint32_t > & aValues) const

Writes a block of data to a specific node.

Parameters
aValuesVector of values to write to the node.
Returns
true if the data was sent successfully, false otherwise.

Definition at line 188 of file HwInterface.cpp.

188 {
189 return hwInterface->writeBlock(nodeId, aValues);
190}

References hwInterface, and nodeId.

Member Data Documentation

◆ hwInterface

HwInterface* PIpBusInterface::Node::hwInterface
private

Definition at line 34 of file HwInterface.h.

Referenced by Node(), read(), readBlock(), write(), and writeBlock().

◆ nodeId

std::string PIpBusInterface::Node::nodeId
private

Definition at line 35 of file HwInterface.h.

Referenced by Node(), read(), readBlock(), write(), writeBlock(), and ~Node().


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