Transaction

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

typedef std::shared_ptr<rogue::interfaces::memory::Transaction> rogue::interfaces::memory::TransactionPtr

Alias for using shared pointer as TransactionPtr.

The class description is shown below:

class Transaction : public rogue::EnableSharedFromThis<rogue::interfaces::memory::Transaction>

Transaction Container.

The Transaction is passed between the Master and Slave to initiate a transaction. The Transaction class contains information about the transaction as well as the transaction data pointer. Each created transaction object has a unique 32-bit transaction ID which is used to track the transaction. Transactions are never created directly, instead they are created in the Master() class.

Public Types

typedef uint8_t *iterator

Alias for using uint8_t * as Transaction::iterator.

Public Functions

std::shared_ptr<rogue::interfaces::memory::TransactionLock> lock()

Lock Transaction and return a TransactionLockPtr object.

Exposed as lock() to Python

Returns:

TransactionLock pointer (TransactonLockPtr)

bool expired()

Get expired flag.

The expired flag is set by the Master when the Transaction times out and the Master is no longer waiting for the Transaction to complete. Lock must be held before checking the expired status.

Exposed as expired() to Python

Returns:

True if transaction is expired.

uint32_t id()

Get 32-bit Transaction ID.

Exposed as id() to Python

Returns:

32-bit transaction ID

uint64_t address()

Get Transaction address.

Exposed as address() to Python

Returns:

64-bit Transaction ID

uint32_t size()

Get Transaction size.

Exposed as size() to Python

Returns:

32-bit Transaction size

uint32_t type()

Get Transaction type.

The transaction type values are defined in Constants Exposed as type() to Python

Returns:

32-bit Transaction type

std::shared_ptr<rogue::interfaces::memory::Transaction> createSubTransaction()

Create a subtransaction.

Create a new transaction and assign internal pointers linking it to this parent transaction

Returns:

A pointer to the newly created subtransaction

void refreshTimer(std::shared_ptr<rogue::interfaces::memory::Transaction> reference)

Refresh transaction timer.

Called to refresh the Transaction timer. If the passed reference Transaction is NULL or the Transaction start time is later than the reference transaction, the Transaction timer will be refreshed.

Not exposed to Python

Parameters:

reference – Reference TransactionPtr

void done()

Complete transaction without error.

Lock must be held before calling this method. The error types are defined in Constants.

Exposed as done() to Python

void errorStr(std::string error)

Complete transaction with passed error, python interface.

Lock must be held before calling this method.

Exposed as error() to Python

Parameters:

errorTransaction error message

void error(const char *fmt, ...)

Complete transaction with passed error.

Lock must be held before calling this method.

Parameters:

errorTransaction error message

uint8_t *begin()

Get start iterator for Transaction data.

Not exposed to Python

Lock must be held before calling this method and while updating Transaction data.

Returns:

Data iterator as Transaction::iterator

uint8_t *end()

Get end iterator for Transaction data.

Not exposed to Python

Lock must be held before calling this method and while updating Transaction data.

Returns:

Data iterator as Transaction::iterator

void getData(boost::python::object p, uint32_t offset)

Method for copying transaction data to Python byte array.

Exposed to Python as getData()

The size of the data to be copied is defined by the size of the passed data buffer.

Parameters:
  • p – Python byte array object

  • offset – Offset for Transaction data access.

void setData(boost::python::object p, uint32_t offset)

Method for copying transaction data from Python byte array.

Exposed to Python as setData()

The size of the data to be copied is defined by the size of the passed data buffer.

Parameters:
  • p – Python byte array object

  • offset – Offset for Transaction data access.