mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 17:41:45 +00:00
move New*Message apis to TransportFactory
* add facades to Device and Channel * add Transport() getter to Device * inline Transport() getter from Channel
This commit is contained in:
committed by
Mohammad Al-Turany
parent
97ca52aa0e
commit
87252edbe0
@@ -258,7 +258,28 @@ class FairMQChannel
|
||||
unsigned long GetMessagesTx() const;
|
||||
unsigned long GetMessagesRx() const;
|
||||
|
||||
FairMQTransportFactory* Transport();
|
||||
auto Transport() const -> const FairMQTransportFactory*
|
||||
{
|
||||
return fTransportFactory.get();
|
||||
};
|
||||
|
||||
template<typename... Args>
|
||||
inline FairMQMessagePtr NewMessage(Args&&... args) const
|
||||
{
|
||||
return Transport()->CreateMessage(std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline FairMQMessagePtr NewSimpleMessage(const T& data) const
|
||||
{
|
||||
return Transport()->NewSimpleMessage(data);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline FairMQMessagePtr NewStaticMessage(const T& data) const
|
||||
{
|
||||
return Transport()->NewStaticMessage(data);
|
||||
}
|
||||
|
||||
private:
|
||||
std::unique_ptr<FairMQSocket> fSocket;
|
||||
|
Reference in New Issue
Block a user