-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add experimental fair::mq::Msg & Socket API
- Loading branch information
Showing
19 changed files
with
1,080 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/******************************************************************************** | ||
* Copyright (C) 2014-2020 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * | ||
* * | ||
* This software is distributed under the terms of the * | ||
* GNU Lesser General Public Licence (LGPL) version 3, * | ||
* copied verbatim in the file "LICENSE" * | ||
********************************************************************************/ | ||
|
||
#ifndef FAIR_MQ_BUFFER_H_ | ||
#define FAIR_MQ_BUFFER_H_ | ||
|
||
#include "FairMQMessage.h" | ||
|
||
namespace fair | ||
{ | ||
namespace mq | ||
{ | ||
|
||
class Buffer | ||
{ | ||
public: | ||
Buffer() = delete; | ||
Buffer(FairMQMessagePtr&& msgPtr) | ||
: fBuffer(std::move(msgPtr)) | ||
{} | ||
|
||
Buffer(const Buffer&) = delete; | ||
Buffer(Buffer&) = delete; | ||
Buffer& operator=(const Buffer&) = delete; | ||
Buffer& operator=(Buffer&) = delete; | ||
|
||
Buffer(Buffer&&) = default; | ||
Buffer& operator=(Buffer&&) = default; | ||
|
||
void Rebuild() { fBuffer->Rebuild(); } | ||
void Rebuild(size_t size) { fBuffer->Rebuild(size); } | ||
void Rebuild(void* data, size_t size, fairmq_free_fn* ffn, void* hint = nullptr) { fBuffer->Rebuild(data, size, ffn, hint); } | ||
|
||
void* GetData() const { return fBuffer->GetData(); } | ||
size_t GetSize() const { return fBuffer->GetSize(); } | ||
|
||
bool SetUsedSize(size_t size) { return fBuffer->SetUsedSize(size); } | ||
|
||
fair::mq::Transport GetType() const { return fBuffer->GetType(); } | ||
FairMQTransportFactory* GetTransport() { return fBuffer->GetTransport(); } | ||
void SetTransport(FairMQTransportFactory* transport) { fBuffer->SetTransport(transport); } | ||
|
||
void Copy(const Buffer& buf) { fBuffer->Copy(*(buf.fBuffer)); } | ||
|
||
~Buffer() {}; | ||
|
||
FairMQMessagePtr fBuffer; | ||
}; | ||
|
||
} // namespace mq | ||
} // namespace fair | ||
|
||
#endif /* FAIR_MQ_BUFFER_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.