vrtd::Bar

class Bar

Value-type metadata handle for a device BAR (Base Address Register).

Provides discovery information and a convenience method to open/map the BAR.

Semantics

Lifetime

A Bar becomes invalid if its originating Session is closed or moved. Any subsequent member call will throw.

Thread safety

Methods are thread-safe and may be called concurrently; they synchronize on the originating Session.

Public Functions

uint32_t getDeviceNum() const noexcept

Zero-based device index that owns this BAR.

uint8_t getNum() const noexcept

Zero-based BAR index on the device.

bool isUsable() const noexcept

Whether this BAR is currently usable (mappable) by the caller.

bool isInUse() const noexcept

Whether this BAR is currently in use by another tenant.

Note

In the current implementation this always returns false.

uint64_t getStartAddress() const noexcept

Physical start address of the BAR.

uint64_t getLength() const noexcept

Length/size of the BAR (bytes).

BarFile openBarFile() const

Open and mmap() this BAR, returning an owning BarFile.

Throws:

vrtd::Error – on failure.

Returns:

BarFile that RAII-owns the FD and mapping; its destructor unmaps and closes automatically.