mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 09:31:45 +00:00
Extend the FairMQ transport interface by allowing the user of the FairMQMessage class to define his own deallocation function.
This function will be called when the transport machanism no longer needs the data. Use this extension with the Protobuf data format, to enable more efficient transport, avoiding memcpy.
This commit is contained in:
@@ -17,12 +17,14 @@
|
||||
|
||||
#include <cstddef> // for size_t
|
||||
|
||||
typedef void (fairmq_free_fn) (void *data, void *hint);
|
||||
|
||||
class FairMQMessage
|
||||
{
|
||||
public:
|
||||
virtual void Rebuild() = 0;
|
||||
virtual void Rebuild(size_t size) = 0;
|
||||
virtual void Rebuild(void* data, size_t size) = 0;
|
||||
virtual void Rebuild(void* data, size_t size, fairmq_free_fn *ffn = NULL, void* hint = NULL) = 0;
|
||||
|
||||
virtual void* GetMessage() = 0;
|
||||
virtual void* GetData() = 0;
|
||||
|
Reference in New Issue
Block a user