17#ifndef __ROGUE_INTERFACES_MEMORY_TRANSACTION_H__
18#define __ROGUE_INTERFACES_MEMORY_TRANSACTION_H__
23#include <condition_variable>
34 #include <boost/python.hpp>
48using TransactionMap = std::map<uint32_t, std::shared_ptr<rogue::interfaces::memory::Transaction>>;
89 static uint32_t classIdx_;
92 static std::mutex classMtx_;
95 std::condition_variable cond_;
152 std::shared_ptr<rogue::Logging>
log_;
167 static std::shared_ptr<rogue::interfaces::memory::Transaction>
create(
struct timeval timeout);
201 std::shared_ptr<rogue::interfaces::memory::TransactionLock>
lock();
277 void refreshTimer(std::shared_ptr<rogue::interfaces::memory::Transaction> reference);
304 void error(
const char* fmt, ...);
340 void getData(boost::python::object p, uint32_t offset);
352 void setData(boost::python::object p, uint32_t offset);
Typed shared-from-this helper for Rogue classes.
Memory interface Hub device.
Master endpoint for memory transactions.
Scoped lock wrapper for a memory transaction.
Memory transaction container passed between master and slave.
uint64_t address()
Returns the transaction address.
void getData(boost::python::object p, uint32_t offset)
Copies transaction data into a Python byte-array-like object.
uint8_t * end()
Returns iterator to the end of transaction data.
void errorStr(std::string error)
Marks transaction completion with an error string (Python interface).
std::shared_ptr< rogue::Logging > log_
void doneSubTransactions()
Marks subtransaction creation as complete for this transaction.
uint32_t id()
Returns the transaction ID.
static void setup_python()
bool expired()
Returns whether this transaction has expired.
struct timeval startTime_
std::string wait()
Wait for the transaction to complete.
~Transaction()
Destroy object.
void refreshTimer(std::shared_ptr< rogue::interfaces::memory::Transaction > reference)
Refreshes the transaction timer.
uint32_t size()
Returns the transaction size.
uint8_t * begin()
Returns iterator to the beginning of transaction data.
std::weak_ptr< rogue::interfaces::memory::Transaction > parentTransaction_
void error(const char *fmt,...)
Marks transaction completion with a formatted C-string error.
uint8_t * iterator
Iterator alias for transaction byte access.
void setData(boost::python::object p, uint32_t offset)
Copies data from a Python byte-array-like object into the transaction.
uint32_t type()
Returns the transaction type constant.
bool doneCreatingSubTransactions_
static std::shared_ptr< rogue::interfaces::memory::Transaction > create(struct timeval timeout)
Creates a transaction container.
TransactionMap subTranMap_
void done()
Marks transaction completion without error.
std::shared_ptr< rogue::interfaces::memory::TransactionLock > lock()
Locks the transaction and returns a lock wrapper.
std::shared_ptr< rogue::interfaces::memory::Transaction > createSubTransaction()
Creates a subtransaction linked to this parent transaction.
std::map< uint32_t, std::shared_ptr< rogue::interfaces::memory::Transaction > > TransactionMap
std::shared_ptr< rogue::interfaces::memory::Transaction > TransactionPtr
Shared pointer alias for Transaction.