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

Scoped lock wrapper for stream frames. More...

#include <FrameLock.h>

Public Member Functions

 FrameLock (std::shared_ptr< rogue::interfaces::stream::Frame > frame)
 Constructs a lock wrapper for the provided frame.
 
 ~FrameLock ()
 Destroys the wrapper and releases any held lock.
 
void lock ()
 Locks the associated frame when not already locked.
 
void unlock ()
 Unlocks the associated frame 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::stream::FrameLockcreate (std::shared_ptr< rogue::interfaces::stream::Frame > frame)
 Creates a frame lock wrapper.
 
static void setup_python ()
 Registers this type with Python bindings.
 

Detailed Description

Scoped lock wrapper for stream frames.

Holds a lock while frame data is accessed. This allows multiple stream slaves to read/update safely while ensuring only one updater at a time. Locks are released on destruction. Instances are created via Frame::lock().

Definition at line 40 of file FrameLock.h.

Constructor & Destructor Documentation

◆ FrameLock()

rogue::interfaces::stream::FrameLock::FrameLock ( std::shared_ptr< rogue::interfaces::stream::Frame frame)
explicit

Constructs a lock wrapper for the provided frame.

Constructor.

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

Parameters
frameFrame to lock.

Definition at line 40 of file FrameLock.cpp.

◆ ~FrameLock()

rogue::interfaces::stream::FrameLock::~FrameLock ( )

Destroys the wrapper and releases any held lock.

Destructor.

Definition at line 60 of file FrameLock.cpp.

Member Function Documentation

◆ create()

rogue::interfaces::stream::FrameLockPtr rogue::interfaces::stream::FrameLock::create ( std::shared_ptr< rogue::interfaces::stream::Frame frame)
static

Creates a frame lock wrapper.

Create a frame container.

Intended for internal use by Frame. Parameter semantics are identical to the constructor; see FrameLock() 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
frameFrame to lock.
Returns
Shared pointer to the created lock object.

Company : SLAC National Accelerator Laboratory

Description:

Frame 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 FrameLock.cpp.

◆ enter()

void rogue::interfaces::stream::FrameLock::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 82 of file FrameLock.cpp.

◆ exit()

void rogue::interfaces::stream::FrameLock::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 85 of file FrameLock.cpp.

◆ lock()

void rogue::interfaces::stream::FrameLock::lock ( )

Locks the associated frame when not already locked.

lock

Exposed as lock() in Python.

Definition at line 65 of file FrameLock.cpp.

◆ setup_python()

void rogue::interfaces::stream::FrameLock::setup_python ( )
static

Registers this type with Python bindings.

Setup class in python.

Definition at line 48 of file FrameLock.cpp.

◆ unlock()

void rogue::interfaces::stream::FrameLock::unlock ( )

Unlocks the associated frame when currently locked.

lock

Exposed as unlock() in Python.

Definition at line 74 of file FrameLock.cpp.


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