LMDBAL 0.6.0
LMDB (Lightning Memory-Mapped Database Manager) Abstraction Layer
Loading...
Searching...
No Matches
LMDBAL::Session Class Reference

RAII guard that keeps the database environment active. More...

Public Member Functions

 Session ()
 Constructs an empty session that is not bound to any database.
 ~Session ()
 Destroys the session, unregistering it if still active.
 Session (const Session &)=delete
 Session (Session &&)
 Transfers ownership of the session to a new instance.
Sessionoperator= (const Session &)=delete
Sessionoperator= (Session &&)
 Move-assigns a session, releasing the currently held one if present.
void close ()
 Closes the session explicitly.
bool opened () const
 Reports whether this session still owns an opened database.

Friends

class Base

Detailed Description

RAII guard that keeps the database environment active.

Instances are obtained from LMDBAL::Base::open(). While at least one session exists, the underlying LMDB environment remains opened. Destroying or closing the session releases the reference; the final session deactivates the database.

Constructor & Destructor Documentation

◆ Session() [1/2]

LMDBAL::Session::Session ( )
explicit

Constructs an empty session that is not bound to any database.

Users normally receive ready-to-use sessions from LMDBAL::Base::open().

◆ Session() [2/2]

LMDBAL::Session::Session ( Session && other)

Transfers ownership of the session to a new instance.

The original session becomes inactive, while the database keeps tracking the new object.

Member Function Documentation

◆ close()

void LMDBAL::Session::close ( )

Closes the session explicitly.

Unregisters the session and deactivates the database if it was the last holder.


The documentation for this class was generated from the following files:
  • /workspace/blue/lmdbal/src/session.h
  • /workspace/blue/lmdbal/src/session.cpp