mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 09:31:45 +00:00
fix: First round of using new non-namespaced typenames
This commit is contained in:
@@ -13,18 +13,19 @@
|
||||
*/
|
||||
|
||||
#include "JSONParser.h"
|
||||
#include "FairMQChannel.h"
|
||||
#include <fairmq/PropertyOutput.h>
|
||||
#include <fairmq/tools/Strings.h>
|
||||
|
||||
#include <fairlogger/Logger.h>
|
||||
|
||||
#include <boost/any.hpp>
|
||||
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
|
||||
#include <boost/property_tree/json_parser.hpp>
|
||||
#undef BOOST_BIND_GLOBAL_PLACEHOLDERS
|
||||
#include <boost/property_tree/ptree.hpp>
|
||||
#include <boost/any.hpp>
|
||||
|
||||
#include <fairlogger/Logger.h>
|
||||
#include <fairmq/Channel.h>
|
||||
#include <fairmq/JSONParser.h>
|
||||
#include <fairmq/PropertyOutput.h>
|
||||
#include <fairmq/tools/Strings.h>
|
||||
#include <iomanip>
|
||||
|
||||
using namespace std;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/********************************************************************************
|
||||
* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
|
||||
* Copyright (C) 2017-2021 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
|
||||
* *
|
||||
* This software is distributed under the terms of the *
|
||||
* GNU Lesser General Public Licence (LGPL) version 3, *
|
||||
@@ -9,8 +9,8 @@
|
||||
#ifndef FAIR_MQ_PLUGINSERVICES_H
|
||||
#define FAIR_MQ_PLUGINSERVICES_H
|
||||
|
||||
#include <fairmq/Device.h>
|
||||
#include <fairmq/States.h>
|
||||
#include <FairMQDevice.h>
|
||||
#include <fairmq/ProgOptions.h>
|
||||
#include <fairmq/Properties.h>
|
||||
|
||||
@@ -40,7 +40,7 @@ class PluginServices
|
||||
{
|
||||
public:
|
||||
PluginServices() = delete;
|
||||
PluginServices(ProgOptions& config, FairMQDevice& device)
|
||||
PluginServices(ProgOptions& config, Device& device)
|
||||
: fConfig(config)
|
||||
, fDevice(device)
|
||||
{}
|
||||
@@ -117,7 +117,7 @@ class PluginServices
|
||||
/// The state transition may not happen immediately, but when the current state evaluates the
|
||||
/// pending transition event and terminates. In other words, the device states are scheduled cooperatively.
|
||||
/// If the device control role has not been taken yet, calling this function will take over control implicitely.
|
||||
auto ChangeDeviceState(const std::string& controller, const DeviceStateTransition next) -> bool;
|
||||
auto ChangeDeviceState(const std::string& controller, DeviceStateTransition next) -> bool;
|
||||
|
||||
/// @brief Subscribe with a callback to device state changes
|
||||
/// @param subscriber id
|
||||
@@ -269,7 +269,7 @@ class PluginServices
|
||||
|
||||
private:
|
||||
fair::mq::ProgOptions& fConfig;
|
||||
FairMQDevice& fDevice;
|
||||
Device& fDevice;
|
||||
boost::optional<std::string> fDeviceController;
|
||||
mutable std::mutex fDeviceControllerMutex;
|
||||
std::condition_variable fReleaseDeviceControlCondition;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/********************************************************************************
|
||||
* Copyright (C) 2014-2018 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
|
||||
* Copyright (C) 2014-2021 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
|
||||
* *
|
||||
* This software is distributed under the terms of the *
|
||||
* GNU Lesser General Public Licence (LGPL) version 3, *
|
||||
@@ -9,22 +9,20 @@
|
||||
#ifndef FAIR_MQ_PROGOPTIONS_H
|
||||
#define FAIR_MQ_PROGOPTIONS_H
|
||||
|
||||
#include "FairMQChannel.h"
|
||||
#include "FairMQLogger.h"
|
||||
#include <boost/program_options.hpp>
|
||||
#include <fairlogger/Logger.h>
|
||||
#include <fairmq/Channel.h>
|
||||
#include <fairmq/EventManager.h>
|
||||
#include <fairmq/ProgOptionsFwd.h>
|
||||
#include <fairmq/Properties.h>
|
||||
#include <fairmq/tools/Strings.h>
|
||||
|
||||
#include <boost/program_options.hpp>
|
||||
|
||||
#include <functional>
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
#include <stdexcept>
|
||||
|
||||
namespace fair::mq
|
||||
{
|
||||
@@ -38,10 +36,10 @@ class ProgOptions
|
||||
virtual ~ProgOptions() = default;
|
||||
|
||||
void ParseAll(const std::vector<std::string>& cmdArgs, bool allowUnregistered);
|
||||
void ParseAll(const int argc, char const* const* argv, bool allowUnregistered = true);
|
||||
void ParseAll(int argc, char const* const* argv, bool allowUnregistered = true);
|
||||
void Notify();
|
||||
|
||||
void AddToCmdLineOptions(const boost::program_options::options_description optDesc, bool visible = true);
|
||||
void AddToCmdLineOptions(boost::program_options::options_description optDesc, bool visible = true);
|
||||
boost::program_options::options_description& GetCmdLineOptions();
|
||||
|
||||
/// @brief Checks a property with the given key exist in the configuration
|
||||
@@ -174,7 +172,7 @@ class ProgOptions
|
||||
/// @brief Takes the provided channel and creates properties based on it
|
||||
/// @param name channel name
|
||||
/// @param channel FairMQChannel reference
|
||||
void AddChannel(const std::string& name, const FairMQChannel& channel);
|
||||
void AddChannel(const std::string& name, const Channel& channel);
|
||||
|
||||
/// @brief Subscribe to property updates of type T
|
||||
/// @param subscriber
|
||||
|
@@ -59,12 +59,12 @@ class TransportFactory
|
||||
/// @brief Create new Message of specified size
|
||||
/// @param size message size
|
||||
/// @return pointer to Message
|
||||
virtual MessagePtr CreateMessage(const size_t size) = 0;
|
||||
virtual MessagePtr CreateMessage(size_t size) = 0;
|
||||
/// @brief Create new Message of specified size and alignment
|
||||
/// @param size message size
|
||||
/// @param alignment message alignment
|
||||
/// @return pointer to Message
|
||||
virtual MessagePtr CreateMessage(const size_t size, Alignment alignment) = 0;
|
||||
virtual MessagePtr CreateMessage(size_t size, Alignment alignment) = 0;
|
||||
/// @brief Create new Message with user provided buffer and size
|
||||
/// @param data pointer to user provided buffer
|
||||
/// @param size size of the user provided buffer
|
||||
@@ -72,8 +72,8 @@ class TransportFactory
|
||||
/// @param obj optional helper pointer that can be used in the callback
|
||||
/// @return pointer to Message
|
||||
virtual MessagePtr CreateMessage(void* data,
|
||||
const size_t size,
|
||||
fairmq_free_fn* ffn,
|
||||
size_t size,
|
||||
FreeFn* ffn,
|
||||
void* hint = nullptr) = 0;
|
||||
/// @brief create a message with the buffer located within the corresponding unmanaged region
|
||||
/// @param unmanagedRegion the unmanaged region that this message buffer belongs to
|
||||
@@ -82,8 +82,8 @@ class TransportFactory
|
||||
/// @param hint optional parameter, returned to the user in the RegionCallback
|
||||
virtual MessagePtr CreateMessage(UnmanagedRegionPtr& unmanagedRegion,
|
||||
void* data,
|
||||
const size_t size,
|
||||
void* hint = 0) = 0;
|
||||
size_t size,
|
||||
void* hint = nullptr) = 0;
|
||||
|
||||
/// @brief Create a socket
|
||||
virtual SocketPtr CreateSocket(const std::string& type, const std::string& name) = 0;
|
||||
|
@@ -5,19 +5,18 @@
|
||||
* GNU Lesser General Public Licence (LGPL) version 3, *
|
||||
* copied verbatim in the file "LICENSE" *
|
||||
********************************************************************************/
|
||||
|
||||
#ifndef FAIR_MQ_SHMEM_POLLER_H_
|
||||
#define FAIR_MQ_SHMEM_POLLER_H_
|
||||
|
||||
#include "Socket.h"
|
||||
#include <fairlogger/Logger.h>
|
||||
#include <fairmq/Channel.h>
|
||||
#include <fairmq/Poller.h>
|
||||
#include <fairmq/shmem/Socket.h>
|
||||
#include <fairmq/tools/Strings.h>
|
||||
#include <FairMQChannel.h>
|
||||
#include <FairMQLogger.h>
|
||||
#include <FairMQPoller.h>
|
||||
|
||||
#include <zmq.h>
|
||||
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
#include <zmq.h>
|
||||
|
||||
namespace fair::mq::shmem
|
||||
{
|
||||
@@ -25,7 +24,7 @@ namespace fair::mq::shmem
|
||||
class Poller final : public fair::mq::Poller
|
||||
{
|
||||
public:
|
||||
Poller(const std::vector<FairMQChannel>& channels)
|
||||
Poller(const std::vector<Channel>& channels)
|
||||
: fItems()
|
||||
, fNumItems(0)
|
||||
{
|
||||
@@ -45,7 +44,7 @@ class Poller final : public fair::mq::Poller
|
||||
}
|
||||
}
|
||||
|
||||
Poller(const std::vector<FairMQChannel*>& channels)
|
||||
Poller(const std::vector<Channel*>& channels)
|
||||
: fItems()
|
||||
, fNumItems(0)
|
||||
{
|
||||
@@ -65,7 +64,7 @@ class Poller final : public fair::mq::Poller
|
||||
}
|
||||
}
|
||||
|
||||
Poller(const std::unordered_map<std::string, std::vector<FairMQChannel>>& channelsMap, const std::vector<std::string>& channelList)
|
||||
Poller(const std::unordered_map<std::string, std::vector<Channel>>& channelsMap, const std::vector<std::string>& channelList)
|
||||
: fItems()
|
||||
, fNumItems(0)
|
||||
{
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/********************************************************************************
|
||||
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
|
||||
* Copyright (C) 2014-2021 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
|
||||
* *
|
||||
* This software is distributed under the terms of the *
|
||||
* GNU Lesser General Public Licence (LGPL) version 3, *
|
||||
@@ -9,16 +9,14 @@
|
||||
#ifndef FAIR_MQ_ZMQ_POLLER_H
|
||||
#define FAIR_MQ_ZMQ_POLLER_H
|
||||
|
||||
#include <fairmq/zeromq/Socket.h>
|
||||
#include <fairlogger/Logger.h>
|
||||
#include <fairmq/Channel.h>
|
||||
#include <fairmq/Poller.h>
|
||||
#include <fairmq/tools/Strings.h>
|
||||
#include <FairMQChannel.h>
|
||||
#include <FairMQLogger.h>
|
||||
#include <FairMQPoller.h>
|
||||
|
||||
#include <zmq.h>
|
||||
|
||||
#include <fairmq/zeromq/Socket.h>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
#include <zmq.h>
|
||||
|
||||
namespace fair::mq::zmq
|
||||
{
|
||||
@@ -26,7 +24,7 @@ namespace fair::mq::zmq
|
||||
class Poller final : public fair::mq::Poller
|
||||
{
|
||||
public:
|
||||
Poller(const std::vector<FairMQChannel>& channels)
|
||||
Poller(const std::vector<Channel>& channels)
|
||||
: fItems()
|
||||
, fNumItems(0)
|
||||
{
|
||||
@@ -46,7 +44,7 @@ class Poller final : public fair::mq::Poller
|
||||
}
|
||||
}
|
||||
|
||||
Poller(const std::vector<FairMQChannel*>& channels)
|
||||
Poller(const std::vector<Channel*>& channels)
|
||||
: fItems()
|
||||
, fNumItems(0)
|
||||
{
|
||||
@@ -66,14 +64,14 @@ class Poller final : public fair::mq::Poller
|
||||
}
|
||||
}
|
||||
|
||||
Poller(const std::unordered_map<std::string, std::vector<FairMQChannel>>& channelsMap, const std::vector<std::string>& channelList)
|
||||
Poller(const std::unordered_map<std::string, std::vector<Channel>>& channelsMap, const std::vector<std::string>& channelList)
|
||||
: fItems()
|
||||
, fNumItems(0)
|
||||
{
|
||||
try {
|
||||
int offset = 0;
|
||||
// calculate offsets and the total size of the poll item set
|
||||
for (std::string channel : channelList) {
|
||||
for (std::string const & channel : channelList) {
|
||||
fOffsetMap[channel] = offset;
|
||||
offset += channelsMap.at(channel).size();
|
||||
fNumItems += channelsMap.at(channel).size();
|
||||
|
Reference in New Issue
Block a user