Harlinn.Windows 0.1
Loading...
Searching...
No Matches
Harlinn::Common::Core::Ese::Session Class Reference

#include <HCCEse.h>

Public Member Functions

constexpr Session () noexcept
 
 Session (JET_INSTANCE instance, JET_SESID sessionId)
 
 ~Session ()
 
 Session (const Session &other)=delete
 
 Session (Session &&other) noexcept
 
Sessionoperator= (const Session &other)=delete
 
Sessionoperator= (Session &&other) noexcept
 
JET_SESID Handle () const
 
constexpr bool IsValid () const noexcept
 Checks that the session is valid.
 
constexpr operator bool () const noexcept
 
bool SetContext (JET_API_PTR context) const
 
void ResetContext () const
 
TimeSpan QuerySnapshotTimeout () const
 
void SetSnapshotTimeout (const TimeSpan &value)
 
void End ()
 
Transaction StartTransaction () const
 
void BeginTransaction () const
 
void CommitTransaction (TransactionFlags flags=TransactionFlags::None) const
 
void Rollback (bool all=false) const
 
template<DatabaseType T = Database, SimpleWideStringLike StringT>
T CreateDatabase (const StringT &filename, CreateDatabaseFlags flags, unsigned long maxDatabaseSizeInNumberOfPages=0) const
 Creates and attaches a database file to be used with the database engine with a maximum database size specified.
 
template<DatabaseType T = Database, SimpleAnsiStringLike StringT>
T CreateDatabase (const StringT &filename, CreateDatabaseFlags flags, unsigned long maxDatabaseSizeInNumberOfPages=0) const
 Creates and attaches a database file to be used with the database engine with a maximum database size specified.
 
template<SimpleWideStringLike StringT>
void AttachDatabase (const StringT &filename, AttachDatabaseFlags flags=AttachDatabaseFlags::None, unsigned long maxDatabaseSizeInNumberOfPages=0) const
 Attaches a database file for use with a database instance and specifies a maximum size for that database. In order to use the database, it will need to be subsequently opened with OpenDatabase.
 
template<SimpleAnsiStringLike StringT>
void AttachDatabase (const StringT &filename, AttachDatabaseFlags flags=AttachDatabaseFlags::None, unsigned long maxDatabaseSizeInNumberOfPages=0) const
 Attaches a database file for use with a database instance and specifies a maximum size for that database. In order to use the database, it will need to be subsequently opened with OpenDatabase.
 
template<SimpleWideStringLike StringT>
void DetachDatabase (const StringT &filename, DetachDatabaseFlags flags) const
 
template<SimpleWideStringLike StringT>
bool DetachDatabaseNX (const StringT &filename, DetachDatabaseFlags flags) const
 
template<SimpleAnsiStringLike StringT>
void DetachDatabase (const StringT &filename, DetachDatabaseFlags flags) const
 
template<SimpleAnsiStringLike StringT>
bool DetachDatabaseNX (const StringT &filename, DetachDatabaseFlags flags) const
 
void DetachAll (DetachDatabaseFlags flags=DetachDatabaseFlags::None) const
 
template<DatabaseType T = Database, SimpleWideStringLike StringT>
T OpenDatabase (const StringT &filename, OpenDatabaseFlags flags=OpenDatabaseFlags::None) const
 Opens a previously attached database.
 
template<DatabaseType T = Database, SimpleAnsiStringLike StringT>
T OpenDatabase (const StringT &filename, OpenDatabaseFlags flags=OpenDatabaseFlags::None) const
 
Session Clone () const
 

Private Member Functions

unsigned long long GetSystemNumericParameter (unsigned long paramId) const
 
void GetSystemStringParameter (unsigned long paramId, JET_PWSTR szParam, unsigned long cbMax) const
 
template<WideStringLike StringT>
StringT GetSystemStringParameter (unsigned long paramId) const
 
template<AnsiStringLike StringT>
StringT GetSystemStringParameter (unsigned long paramId) const
 
void SetSystemParameter (unsigned long paramId, unsigned long long value)
 
template<SimpleWideStringLike StringT>
void SetSystemParameter (unsigned long paramId, const StringT &value)
 
template<SimpleAnsiStringLike StringT>
void SetSystemParameter (unsigned long paramId, const StringT &value)
 

Private Attributes

JET_INSTANCE instance_
 
JET_SESID sessionId_
 

Constructor & Destructor Documentation

◆ Session() [1/4]

Harlinn::Common::Core::Ese::Session::Session ( )
inlineconstexprnoexcept

◆ Session() [2/4]

Harlinn::Common::Core::Ese::Session::Session ( JET_INSTANCE instance,
JET_SESID sessionId )
inlineexplicit

◆ ~Session()

Harlinn::Common::Core::Ese::Session::~Session ( )
inline

◆ Session() [3/4]

Harlinn::Common::Core::Ese::Session::Session ( const Session & other)
delete

◆ Session() [4/4]

Harlinn::Common::Core::Ese::Session::Session ( Session && other)
inlinenoexcept

Member Function Documentation

◆ AttachDatabase() [1/2]

template<SimpleWideStringLike StringT>
void Harlinn::Common::Core::Ese::Session::AttachDatabase ( const StringT & filename,
AttachDatabaseFlags flags = AttachDatabaseFlags::None,
unsigned long maxDatabaseSizeInNumberOfPages = 0 ) const
inline

Attaches a database file for use with a database instance and specifies a maximum size for that database. In order to use the database, it will need to be subsequently opened with OpenDatabase.

Parameters
filenameThe name of the database to attach
flagsOptions to be used for this call
maxDatabaseSizeInNumberOfPagesThe maximum size, in database pages, for database. The default, 0, means that there is no maximum enforced by the database engine

◆ AttachDatabase() [2/2]

template<SimpleAnsiStringLike StringT>
void Harlinn::Common::Core::Ese::Session::AttachDatabase ( const StringT & filename,
AttachDatabaseFlags flags = AttachDatabaseFlags::None,
unsigned long maxDatabaseSizeInNumberOfPages = 0 ) const
inline

Attaches a database file for use with a database instance and specifies a maximum size for that database. In order to use the database, it will need to be subsequently opened with OpenDatabase.

Parameters
filenameThe name of the database to attach
flagsOptions to be used for this call
maxDatabaseSizeInNumberOfPagesThe maximum size, in database pages, for database. The default, 0, means that there is no maximum enforced by the database engine

◆ BeginTransaction()

void Harlinn::Common::Core::Ese::Session::BeginTransaction ( ) const
inline

◆ Clone()

Session Harlinn::Common::Core::Ese::Session::Clone ( ) const
inline

◆ CommitTransaction()

void Harlinn::Common::Core::Ese::Session::CommitTransaction ( TransactionFlags flags = TransactionFlags::None) const
inline

◆ CreateDatabase() [1/2]

template<DatabaseType T = Database, SimpleWideStringLike StringT>
T Harlinn::Common::Core::Ese::Session::CreateDatabase ( const StringT & filename,
CreateDatabaseFlags flags,
unsigned long maxDatabaseSizeInNumberOfPages = 0 ) const
inlinenodiscard

Creates and attaches a database file to be used with the database engine with a maximum database size specified.

Template Parameters
T
Parameters
filenameThe name of the database to be created
flagsFlags control how the database is created and attached to the engine.
maxDatabaseSizeInNumberOfPagesThe maximum size, in database pages, for the database.
Returns
The Database object for the database.

◆ CreateDatabase() [2/2]

template<DatabaseType T = Database, SimpleAnsiStringLike StringT>
T Harlinn::Common::Core::Ese::Session::CreateDatabase ( const StringT & filename,
CreateDatabaseFlags flags,
unsigned long maxDatabaseSizeInNumberOfPages = 0 ) const
inlinenodiscard

Creates and attaches a database file to be used with the database engine with a maximum database size specified.

Template Parameters
T
Parameters
filenameThe name of the database to be created
flagsFlags control how the database is created and attached to the engine.
maxDatabaseSizeInNumberOfPagesThe maximum size, in database pages, for the database.
Returns
The Database object for the database.

◆ DetachAll()

void Harlinn::Common::Core::Ese::Session::DetachAll ( DetachDatabaseFlags flags = DetachDatabaseFlags::None) const
inline

◆ DetachDatabase() [1/2]

template<SimpleWideStringLike StringT>
void Harlinn::Common::Core::Ese::Session::DetachDatabase ( const StringT & filename,
DetachDatabaseFlags flags ) const
inline

◆ DetachDatabase() [2/2]

template<SimpleAnsiStringLike StringT>
void Harlinn::Common::Core::Ese::Session::DetachDatabase ( const StringT & filename,
DetachDatabaseFlags flags ) const
inline

◆ DetachDatabaseNX() [1/2]

template<SimpleWideStringLike StringT>
bool Harlinn::Common::Core::Ese::Session::DetachDatabaseNX ( const StringT & filename,
DetachDatabaseFlags flags ) const
inline

◆ DetachDatabaseNX() [2/2]

template<SimpleAnsiStringLike StringT>
bool Harlinn::Common::Core::Ese::Session::DetachDatabaseNX ( const StringT & filename,
DetachDatabaseFlags flags ) const
inline

◆ End()

void Harlinn::Common::Core::Ese::Session::End ( )
inline

◆ GetSystemNumericParameter()

unsigned long long Harlinn::Common::Core::Ese::Session::GetSystemNumericParameter ( unsigned long paramId) const
inlineprivate

◆ GetSystemStringParameter() [1/3]

template<WideStringLike StringT>
StringT Harlinn::Common::Core::Ese::Session::GetSystemStringParameter ( unsigned long paramId) const
inlineprivate

◆ GetSystemStringParameter() [2/3]

template<AnsiStringLike StringT>
StringT Harlinn::Common::Core::Ese::Session::GetSystemStringParameter ( unsigned long paramId) const
inlineprivate

◆ GetSystemStringParameter() [3/3]

void Harlinn::Common::Core::Ese::Session::GetSystemStringParameter ( unsigned long paramId,
JET_PWSTR szParam,
unsigned long cbMax ) const
inlineprivate

◆ Handle()

JET_SESID Harlinn::Common::Core::Ese::Session::Handle ( ) const
inline

◆ IsValid()

bool Harlinn::Common::Core::Ese::Session::IsValid ( ) const
inlineconstexprnoexcept

Checks that the session is valid.

Returns
true if the session and instance handles are not nil

◆ OpenDatabase() [1/2]

template<DatabaseType T = Database, SimpleWideStringLike StringT>
T Harlinn::Common::Core::Ese::Session::OpenDatabase ( const StringT & filename,
OpenDatabaseFlags flags = OpenDatabaseFlags::None ) const
inlinenodiscard

Opens a previously attached database.

Template Parameters
TDatabase, or a move assignable type derived from Database
Parameters
filenameThe name of the database to open
flagsOptions controlling how the database is opened.
Returns

◆ OpenDatabase() [2/2]

template<DatabaseType T = Database, SimpleAnsiStringLike StringT>
T Harlinn::Common::Core::Ese::Session::OpenDatabase ( const StringT & filename,
OpenDatabaseFlags flags = OpenDatabaseFlags::None ) const
inlinenodiscard

◆ operator bool()

Harlinn::Common::Core::Ese::Session::operator bool ( ) const
inlineexplicitconstexprnoexcept

◆ operator=() [1/2]

Session & Harlinn::Common::Core::Ese::Session::operator= ( const Session & other)
delete

◆ operator=() [2/2]

Session & Harlinn::Common::Core::Ese::Session::operator= ( Session && other)
inlinenoexcept

◆ QuerySnapshotTimeout()

TimeSpan Harlinn::Common::Core::Ese::Session::QuerySnapshotTimeout ( ) const
inline

◆ ResetContext()

void Harlinn::Common::Core::Ese::Session::ResetContext ( ) const
inline

◆ Rollback()

void Harlinn::Common::Core::Ese::Session::Rollback ( bool all = false) const
inline

◆ SetContext()

bool Harlinn::Common::Core::Ese::Session::SetContext ( JET_API_PTR context) const
inline

◆ SetSnapshotTimeout()

void Harlinn::Common::Core::Ese::Session::SetSnapshotTimeout ( const TimeSpan & value)
inline

◆ SetSystemParameter() [1/3]

template<SimpleWideStringLike StringT>
void Harlinn::Common::Core::Ese::Session::SetSystemParameter ( unsigned long paramId,
const StringT & value )
inlineprivate

◆ SetSystemParameter() [2/3]

template<SimpleAnsiStringLike StringT>
void Harlinn::Common::Core::Ese::Session::SetSystemParameter ( unsigned long paramId,
const StringT & value )
inlineprivate

◆ SetSystemParameter() [3/3]

void Harlinn::Common::Core::Ese::Session::SetSystemParameter ( unsigned long paramId,
unsigned long long value )
inlineprivate

◆ StartTransaction()

Transaction Harlinn::Common::Core::Ese::Session::StartTransaction ( ) const
inlinenodiscard

Member Data Documentation

◆ instance_

JET_INSTANCE Harlinn::Common::Core::Ese::Session::instance_
private

◆ sessionId_

JET_SESID Harlinn::Common::Core::Ese::Session::sessionId_
private

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