mirror of
https://github.com/silverqx/TinyORM.git
synced 2026-05-20 16:28:23 -05:00
097c2c0c22
- explicit QStringLiteral and QChar - fixed macro guard names - inline from defn. to decl. - whitespaces and comments - added Q_DISABLE_COPY() - removed friend class DB; from DM - removed schemagrammar.cpp, was empty
49 lines
1.3 KiB
C++
49 lines
1.3 KiB
C++
#pragma once
|
|
#ifndef ORM_CONNECTIONRESOLVERINTERFACE_HPP
|
|
#define ORM_CONNECTIONRESOLVERINTERFACE_HPP
|
|
|
|
#include "orm/macros/systemheader.hpp"
|
|
TINY_SYSTEM_HEADER
|
|
|
|
#include <QString>
|
|
|
|
#include "orm/macros/commonnamespace.hpp"
|
|
|
|
TINYORM_BEGIN_COMMON_NAMESPACE
|
|
|
|
namespace Orm
|
|
{
|
|
class ConnectionInterface;
|
|
|
|
/*! Database connection resolver interface. */
|
|
class ConnectionResolverInterface
|
|
{
|
|
Q_DISABLE_COPY(ConnectionResolverInterface)
|
|
|
|
public:
|
|
/*! Default constructor. */
|
|
inline ConnectionResolverInterface() = default;
|
|
/*! Pure virtual destructor. */
|
|
inline virtual ~ConnectionResolverInterface() = 0;
|
|
|
|
/*! Get a database connection instance. */
|
|
virtual ConnectionInterface &connection(const QString &name = "") = 0;
|
|
|
|
/*! Get the default connection name. */
|
|
virtual const QString &getDefaultConnection() const = 0;
|
|
|
|
/*! Set the default connection name. */
|
|
virtual void setDefaultConnection(const QString &defaultConnection) = 0;
|
|
|
|
/*! Reset the default connection name to a default value. */
|
|
virtual void resetDefaultConnection() = 0;
|
|
};
|
|
|
|
ConnectionResolverInterface::~ConnectionResolverInterface() = default;
|
|
|
|
} // namespace Orm
|
|
|
|
TINYORM_END_COMMON_NAMESPACE
|
|
|
|
#endif // ORM_CONNECTIONRESOLVERINTERFACE_HPP
|