mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 09:31:45 +00:00
Rename device property to have a common format and some code cleanup.
FairMQDevice: Rename property for socket rate logging to have common format (old name is still available for compatibility). FairMQ: Avoid using std namespace in class headers (may require adding std namespace to some child devices). FairMQ: A bit of code cleanup FairMQConfigurable: Stop with an error if a property assignment failed due to incorrect key.
This commit is contained in:
committed by
Florian Uhlig
parent
61f24eb73a
commit
26a1033e9d
@@ -17,45 +17,40 @@ class GenericProcessor: public FairMQDevice,
|
||||
public TaskPolicy
|
||||
{
|
||||
public:
|
||||
|
||||
GenericProcessor() : InputPolicy(), OutputPolicy(), TaskPolicy()
|
||||
{}
|
||||
|
||||
|
||||
virtual ~GenericProcessor()
|
||||
{}
|
||||
|
||||
|
||||
void SetTransport(FairMQTransportFactory* transport)
|
||||
{
|
||||
FairMQDevice::SetTransport(transport);
|
||||
//InputPolicy::SetTransport(transport);
|
||||
//OutputPolicy::SetTransport(transport);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template <typename... Args>
|
||||
void InitTask(Args... args)
|
||||
{
|
||||
TaskPolicy::InitTask(std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
|
||||
template <typename... Args>
|
||||
void InitInputContainer(Args... args)
|
||||
{
|
||||
InputPolicy::InitContainer(std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
|
||||
template <typename... Args>
|
||||
void InitOutputContainer(Args... args)
|
||||
{
|
||||
OutputPolicy::InitContainer(std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//void SendPart();
|
||||
//bool ReceivePart();
|
||||
|
||||
|
||||
|
||||
void SendPart()
|
||||
{
|
||||
fPayloadOutputs->at(0)->Send(OutputPolicy::SerializeMsg(TaskPolicy::GetData()), "snd-more");
|
||||
@@ -81,7 +76,7 @@ class GenericProcessor: public FairMQDevice,
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
protected:
|
||||
virtual void Init()
|
||||
{
|
||||
@@ -91,7 +86,7 @@ class GenericProcessor: public FairMQDevice,
|
||||
//fProcessorTask->SetSendPart(boost::bind(&FairMQProcessor::SendPart, this));
|
||||
//fProcessorTask->SetReceivePart(boost::bind(&FairMQProcessor::ReceivePart, this));
|
||||
}
|
||||
|
||||
|
||||
virtual void Run()
|
||||
{
|
||||
MQLOG(INFO) << ">>>>>>> Run <<<<<<<";
|
||||
@@ -100,7 +95,7 @@ class GenericProcessor: public FairMQDevice,
|
||||
int receivedMsgs = 0;
|
||||
int sentMsgs = 0;
|
||||
int received = 0;
|
||||
|
||||
|
||||
while ( fState == RUNNING )
|
||||
{
|
||||
FairMQMessage* msg = fTransportFactory->CreateMessage();
|
||||
@@ -148,7 +143,6 @@ class GenericProcessor: public FairMQDevice,
|
||||
fRunningCondition.notify_one();
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
//#include "GenericSampler.tpl"
|
||||
|
Reference in New Issue
Block a user