diff --git a/fairmq/CMakeLists.txt b/fairmq/CMakeLists.txt index 94a941e1..473d1556 100644 --- a/fairmq/CMakeLists.txt +++ b/fairmq/CMakeLists.txt @@ -65,7 +65,6 @@ set(FAIRMQ_HEADER_FILES ${FAIRMQ_DEPRECATED_HEADER_FILES} EventManager.h FairMQChannel.h - FairMQConfigurable.h FairMQDevice.h FairMQLogger.h FairMQMessage.h @@ -134,7 +133,6 @@ endif() set(FAIRMQ_SOURCE_FILES FairMQChannel.cxx - FairMQConfigurable.cxx FairMQDevice.cxx FairMQLogger.cxx FairMQMessage.cxx diff --git a/fairmq/FairMQConfigurable.cxx b/fairmq/FairMQConfigurable.cxx deleted file mode 100644 index 29f61e9d..00000000 --- a/fairmq/FairMQConfigurable.cxx +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************** - * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * - * * - * This software is distributed under the terms of the * - * GNU Lesser General Public Licence version 3 (LGPL) version 3, * - * copied verbatim in the file "LICENSE" * - ********************************************************************************/ -/** - * FairMQConfigurable.cxx - * - * @since 2012-10-25 - * @author D. Klein, A. Rybalchenko - */ - -#include "FairMQLogger.h" -#include "FairMQConfigurable.h" - -using namespace std; - -FairMQConfigurable::FairMQConfigurable() -{ -} - -void FairMQConfigurable::SetProperty(const int key, const string& value) -{ - LOG(ERROR) << "Reached end of the property list. SetProperty(" << key << ", " << value << ") has no effect."; - exit(EXIT_FAILURE); -} - -string FairMQConfigurable::GetProperty(const int key, const string& default_ /*= ""*/) -{ - LOG(ERROR) << "Reached end of the property list. The requested property " << key << " was not found."; - return default_; -} - -void FairMQConfigurable::SetProperty(const int key, const int value) -{ - LOG(ERROR) << "Reached end of the property list. SetProperty(" << key << ", " << value << ") has no effect."; - exit(EXIT_FAILURE); -} - -int FairMQConfigurable::GetProperty(const int key, const int default_ /*= 0*/) -{ - LOG(ERROR) << "Reached end of the property list. The requested property " << key << " was not found."; - return default_; -} - -string FairMQConfigurable::GetPropertyDescription(const int key) -{ - LOG(ERROR) << "Reached end of the property list. The description of the requested property " << key << " was not found."; - return "0"; -} - -FairMQConfigurable::~FairMQConfigurable() -{ -} diff --git a/fairmq/FairMQConfigurable.h b/fairmq/FairMQConfigurable.h deleted file mode 100644 index 3bc9e12f..00000000 --- a/fairmq/FairMQConfigurable.h +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************** - * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * - * * - * This software is distributed under the terms of the * - * GNU Lesser General Public Licence version 3 (LGPL) version 3, * - * copied verbatim in the file "LICENSE" * - ********************************************************************************/ -/** - * FairMQConfigurable.h - * - * @since 2012-10-25 - * @author D. Klein, A. Rybalchenko - */ - -#ifndef FAIRMQCONFIGURABLE_H_ -#define FAIRMQCONFIGURABLE_H_ - -#include - -class FairMQConfigurable -{ - public: - enum - { - Last = 1 - }; - FairMQConfigurable(); - virtual ~FairMQConfigurable(); - - virtual void SetProperty(const int key, const std::string& value); - virtual std::string GetProperty(const int key, const std::string& default_ = ""); - virtual void SetProperty(const int key, const int value); - virtual int GetProperty(const int key, const int default_ = 0); - - virtual std::string GetPropertyDescription(const int key); -}; - -#endif /* FAIRMQCONFIGURABLE_H_ */ diff --git a/fairmq/FairMQDevice.cxx b/fairmq/FairMQDevice.cxx index 8898ee17..0ff95402 100644 --- a/fairmq/FairMQDevice.cxx +++ b/fairmq/FairMQDevice.cxx @@ -764,81 +764,6 @@ void FairMQDevice::Pause() LOG(DEBUG) << "Unpausing"; } -// Method for setting properties represented as a string. -void FairMQDevice::SetProperty(const int key, const string& value) -{ - switch (key) - { - case Id: - fId = value; - break; - default: - FairMQConfigurable::SetProperty(key, value); - break; - } -} - -// Method for setting properties represented as an integer. -void FairMQDevice::SetProperty(const int key, const int value) -{ - switch (key) - { - case NumIoThreads: - fNumIoThreads = value; - break; - default: - FairMQConfigurable::SetProperty(key, value); - break; - } -} - -// Method for getting properties represented as an string. -string FairMQDevice::GetProperty(const int key, const string& default_ /*= ""*/) -{ - switch (key) - { - case Id: - return fId; - default: - return FairMQConfigurable::GetProperty(key, default_); - } -} - -string FairMQDevice::GetPropertyDescription(const int key) -{ - switch (key) - { - case Id: - return "Id: Device ID"; - case NumIoThreads: - return "NumIoThreads: Number of I/O Threads (size of the 0MQ thread pool to handle I/O operations. If your application is using only the inproc transport for messaging you may set this to zero, otherwise set it to at least one.)"; - default: - return FairMQConfigurable::GetPropertyDescription(key); - } -} - -void FairMQDevice::ListProperties() -{ - LOG(INFO) << "Properties of FairMQDevice:"; - for (int p = FairMQConfigurable::Last; p < FairMQDevice::Last; ++p) - { - LOG(INFO) << " " << GetPropertyDescription(p); - } - LOG(INFO) << "---------------------------"; -} - -// Method for getting properties represented as an integer. -int FairMQDevice::GetProperty(const int key, const int default_ /*= 0*/) -{ - switch (key) - { - case NumIoThreads: - return fNumIoThreads; - default: - return FairMQConfigurable::GetProperty(key, default_); - } -} - shared_ptr FairMQDevice::AddTransport(const string& transport) { auto i = fTransports.find(FairMQ::TransportTypes.at(transport)); diff --git a/fairmq/FairMQDevice.h b/fairmq/FairMQDevice.h index 98a7ce76..c4a5777b 100644 --- a/fairmq/FairMQDevice.h +++ b/fairmq/FairMQDevice.h @@ -9,7 +9,6 @@ #ifndef FAIRMQDEVICE_H_ #define FAIRMQDEVICE_H_ -#include "FairMQConfigurable.h" #include "FairMQStateMachine.h" #include "FairMQTransportFactory.h" #include "FairMQTransports.h" @@ -42,18 +41,11 @@ using InputMultipartCallback = std::function; class FairMQProgOptions; -class FairMQDevice : public FairMQStateMachine, public FairMQConfigurable +class FairMQDevice : public FairMQStateMachine { friend class FairMQChannel; public: - enum - { - Id = FairMQConfigurable::Last, ///< Device ID - NumIoThreads, ///< Number of ZeroMQ I/O threads - Last - }; - /// Default constructor FairMQDevice(); @@ -299,32 +291,6 @@ class FairMQDevice : public FairMQStateMachine, public FairMQConfigurable /// Waits for the first initialization run to finish void WaitForInitialValidation(); - /// Set Device properties stored as strings - /// @param key Property key - /// @param value Property value - virtual void SetProperty(const int key, const std::string& value); - /// Get Device properties stored as strings - /// @param key Property key - /// @param default_ not used - /// @return Property value - virtual std::string GetProperty(const int key, const std::string& default_ = ""); - /// Set Device properties stored as integers - /// @param key Property key - /// @param value Property value - virtual void SetProperty(const int key, const int value); - /// Get Device properties stored as integers - /// @param key Property key - /// @param default_ not used - /// @return Property value - virtual int GetProperty(const int key, const int default_ = 0); - - /// Get property description for a given property name - /// @param key Property name/key - /// @return String with the property description - virtual std::string GetPropertyDescription(const int key); - /// Print all properties of this and the parent class to LOG(INFO) - virtual void ListProperties(); - /// Adds a transport to the device if it doesn't exist /// @param transport Transport string ("zeromq"/"nanomsg"/"shmem") std::shared_ptr AddTransport(const std::string& transport); diff --git a/fairmq/tools/runSimpleMQStateMachine.h b/fairmq/tools/runSimpleMQStateMachine.h index 4b657e42..be922892 100644 --- a/fairmq/tools/runSimpleMQStateMachine.h +++ b/fairmq/tools/runSimpleMQStateMachine.h @@ -28,9 +28,6 @@ int runStateMachine(TMQDevice& device, FairMQProgOptions& cfg) std::string control = cfg.GetValue("control"); device.ChangeState(TMQDevice::INIT_DEVICE); - // Wait for the binding channels to bind - device.WaitForInitialValidation(); - device.WaitForEndOfState(TMQDevice::INIT_DEVICE); device.ChangeState(TMQDevice::INIT_TASK);