mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 08:41:16 +00:00
Remove FairMQConfigurable
This commit is contained in:
parent
26cfe69b41
commit
179968db1e
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
{
|
||||
}
|
|
@ -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 <string>
|
||||
|
||||
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_ */
|
|
@ -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<FairMQTransportFactory> FairMQDevice::AddTransport(const string& transport)
|
||||
{
|
||||
auto i = fTransports.find(FairMQ::TransportTypes.at(transport));
|
||||
|
|
|
@ -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<bool(FairMQParts&, int)>;
|
|||
|
||||
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<FairMQTransportFactory> AddTransport(const std::string& transport);
|
||||
|
|
|
@ -28,9 +28,6 @@ int runStateMachine(TMQDevice& device, FairMQProgOptions& cfg)
|
|||
std::string control = cfg.GetValue<std::string>("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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user