Merge remote-tracking branch 'origin/ip-address-soo' into develop

This commit is contained in:
aleks-f
2013-02-17 16:33:44 -06:00
98 changed files with 4278 additions and 1834 deletions

View File

@@ -44,6 +44,12 @@
#include "Poco/Data/Connector.h"
// Note: to avoid static (de)initialization problems,
// during connector automatic (un)registration, it is
// best to have this as a macro.
#define POCO_DATA_MYSQL_CONNECTOR_NAME "mysql"
namespace Poco {
namespace Data {
namespace MySQL {
@@ -80,4 +86,55 @@ public:
} } } // namespace Poco::Data::MySQL
//
// Automatic Connector registration
//
struct MySQL_API MySQLConnectorRegistrator
/// Connector registering class.
/// A global instance of this class is instantiated
/// with sole purpose to automatically register the
/// MySQL connector with central Poco Data registry.
{
MySQLConnectorRegistrator()
/// Calls Poco::Data::MySQL::registerConnector();
{
Poco::Data::MySQL::Connector::registerConnector();
}
~MySQLConnectorRegistrator()
/// Calls Poco::Data::MySQL::unregisterConnector();
{
Poco::Data::MySQL::Connector::unregisterConnector();
}
};
#if !defined(POCO_NO_AUTOMATIC_LIB_INIT)
#if defined(POCO_OS_FAMILY_WINDOWS)
extern "C" const struct MySQL_API MySQLConnectorRegistrator pocoMySQLConnectorRegistrator;
#if defined(MySQL_EXPORTS)
#if defined(_WIN64)
#define POCO_DATA_MYSQL_FORCE_SYMBOL(s) __pragma(comment (linker, "/export:"#s))
#elif defined(_WIN32)
#define POCO_DATA_MYSQL_FORCE_SYMBOL(s) __pragma(comment (linker, "/export:_"#s))
#endif
#else // !MySQL_EXPORTS
#if defined(_WIN64)
#define POCO_DATA_MYSQL_FORCE_SYMBOL(s) __pragma(comment (linker, "/include:"#s))
#elif defined(_WIN32)
#define POCO_DATA_MYSQL_FORCE_SYMBOL(s) __pragma(comment (linker, "/include:_"#s))
#endif
#endif // MySQL_EXPORTS
#else // !POCO_OS_FAMILY_WINDOWS
#define POCO_DATA_MYSQL_FORCE_SYMBOL(s) extern "C" const struct MySQLConnectorRegistrator s;
#endif // POCO_OS_FAMILY_WINDOWS
POCO_DATA_MYSQL_FORCE_SYMBOL(pocoMySQLConnectorRegistrator)
#endif // POCO_NO_AUTOMATIC_LIB_INIT
//
// End automatic Connector registration
//
#endif // Data_MySQL_Connector_INCLUDED

View File

@@ -141,7 +141,7 @@ public:
SessionHandle& handle();
// Get handle
const std::string& connectorName();
const std::string& connectorName() const;
/// Returns the name of the connector.
private:
@@ -208,7 +208,7 @@ inline SessionHandle& SessionImpl::handle()
}
inline const std::string& SessionImpl::connectorName()
inline const std::string& SessionImpl::connectorName() const
{
return _connector;
}