rogue
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
rogue::interfaces::memory::TransactionLock Class Reference

Scoped lock wrapper for a memory transaction. More...

#include <TransactionLock.h>

Public Member Functions

 TransactionLock (std::shared_ptr< rogue::interfaces::memory::Transaction > transaction)
 Constructs a lock wrapper for the provided transaction.
 
 ~TransactionLock ()
 Destroys the wrapper and releases any held lock.
 
void lock ()
 Locks the associated transaction when not already locked.
 
void unlock ()
 Unlocks the associated transaction when currently locked.
 
void enter ()
 Python context-manager entry hook.
 
void exit (void *, void *, void *)
 Python context-manager exit hook.
 

Static Public Member Functions

static std::shared_ptr< rogue::interfaces::memory::TransactionLockcreate (std::shared_ptr< rogue::interfaces::memory::Transaction > transaction)
 Creates a transaction lock wrapper.
 
static void setup_python ()
 Registers this type with Python bindings.
 

Detailed Description

Scoped lock wrapper for a memory transaction.

Holds a lock on transaction data while client code accesses it. The lock prevents transaction destruction while a slave updates data and completion state. Instances are created via Transaction::lock().

Definition at line 40 of file TransactionLock.h.

Constructor & Destructor Documentation

◆ TransactionLock()

rogue::interfaces::memory::TransactionLock::TransactionLock ( std::shared_ptr< rogue::interfaces::memory::Transaction transaction)
explicit

Constructs a lock wrapper for the provided transaction.

Constructor.

This constructor is a low-level C++ allocation path. Prefer create() when shared ownership or Python exposure is required.

Parameters
transactionTransaction to guard.

Definition at line 40 of file TransactionLock.cpp.

◆ ~TransactionLock()

rogue::interfaces::memory::TransactionLock::~TransactionLock ( )

Destroys the wrapper and releases any held lock.

Destructor.

Definition at line 69 of file TransactionLock.cpp.

Member Function Documentation

◆ create()

rogue::interfaces::memory::TransactionLockPtr rogue::interfaces::memory::TransactionLock::create ( std::shared_ptr< rogue::interfaces::memory::Transaction transaction)
static

Creates a transaction lock wrapper.

Create a container.

Parameter semantics are identical to the constructor; see TransactionLock() for lock-wrapper behavior details. 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.

Parameters
transactionTransaction to guard.
Returns
Shared pointer to the created lock object.

Company : SLAC National Accelerator Laboratory

Description:

Memory Transaction lock

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

contained in the LICENSE.txt file.

Definition at line 34 of file TransactionLock.cpp.

◆ enter()

void rogue::interfaces::memory::TransactionLock::enter ( )

Python context-manager entry hook.

Enter method for python, do nothing.

Exists to support Python with usage. Exposed as __enter__() in Python.

Definition at line 91 of file TransactionLock.cpp.

◆ exit()

void rogue::interfaces::memory::TransactionLock::exit ( void *  ,
void *  ,
void *   
)

Python context-manager exit hook.

Exit method for python, do nothing.

Exists to support Python with usage. Exposed as __exit__() in Python.

Definition at line 94 of file TransactionLock.cpp.

◆ lock()

void rogue::interfaces::memory::TransactionLock::lock ( )

Locks the associated transaction when not already locked.

lock

Exposed as lock() in Python.

Definition at line 74 of file TransactionLock.cpp.

◆ setup_python()

void rogue::interfaces::memory::TransactionLock::setup_python ( )
static

Registers this type with Python bindings.

Setup class in python.

Definition at line 57 of file TransactionLock.cpp.

◆ unlock()

void rogue::interfaces::memory::TransactionLock::unlock ( )

Unlocks the associated transaction when currently locked.

lock

Exposed as unlock() in Python.

Definition at line 83 of file TransactionLock.cpp.


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