Commit 6ea38b9e authored by Marco De Marco's avatar Marco De Marco
Browse files

Configuration shared pointer is global

parent dbb7c443
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ Tango::DevState Client::readState()
}

//==============================================================================
//      Client::getStatus()
//      Client::readStatus()
//==============================================================================
std::string Client::readStatus()
{
+8 −8
Original line number Diff line number Diff line
@@ -154,15 +154,10 @@ void MetadataImporter::init_device()
    {
        try
        {
            Configuration::SP configuration_sp = Configuration::create(certificateFile,
                remoteHost, remotePort, remoteUsername, remotePassword, databaseHost,
                databasePort, databaseUsername, databasePassword, databaseSchema,
                databaseTable, refreshTime, timeout);

            if(enableSSL)
                m_client_sp = SSLClient::create(this, configuration_sp);
                m_client_sp = SSLClient::create(this, m_configuration_sp);
            else
                m_client_sp = PlainClient::create(this, configuration_sp);
                m_client_sp = PlainClient::create(this, m_configuration_sp);
        }
        catch(std::exception& ex)
        {
@@ -424,6 +419,11 @@ void MetadataImporter::get_device_property()

        if(timeout<1 || timeout>MAX_TIMEOUT)
            throw(invalid_argument("Timeout property out of range or not defined"));

        m_configuration_sp = Configuration::create(certificateFile,
            remoteHost, remotePort, remoteUsername, remotePassword, databaseHost,
            databasePort, databaseUsername, databasePassword, databaseSchema,
            databaseTable, refreshTime, timeout);
    }
    catch(invalid_argument& ex)
    {
@@ -444,7 +444,7 @@ void MetadataImporter::get_device_property()
//--------------------------------------------------------
void MetadataImporter::always_executed_hook()
{
	INFO_STREAM << "MetadataImporter::always_executed_hook()  " << device_name << endl;
	DEBUG_STREAM << "MetadataImporter::always_executed_hook()  " << device_name << endl;
	/*----- PROTECTED REGION ID(MetadataImporter::always_executed_hook) ENABLED START -----*/

    if(get_state() != Tango::FAULT)
+3 −0
Original line number Diff line number Diff line
@@ -65,6 +65,9 @@ class MetadataImporter : public TANGO_BASE_CLASS
//------------------------------------------------------------------------------
//  [Private] Class variables
//------------------------------------------------------------------------------
    //Configuration class shared pointer
    Configuration::SP m_configuration_sp;

    //Client class shared pointer
    Client::SP m_client_sp;