Skip to content
Snippets Groups Projects
Commit 9cf0af14 authored by Jan David Mol's avatar Jan David Mol
Browse files

Task #7347: Added message protocol for lofar.task.feedback.dataproducts

parent 0a801e08
No related branches found
No related tags found
No related merge requests found
......@@ -10,3 +10,4 @@ install(FILES
MsgBus.h
DESTINATION include/${PACKAGE_NAME})
add_subdirectory(Protocols)
# $Id$
# Create symbolic link to include directory.
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_BINARY_DIR}/include/${PACKAGE_NAME}/Protocols)
# Install header files.
install(FILES
TaskFeedbackDataproducts.h
DESTINATION include/${PACKAGE_NAME}/Protocols)
//# TaskFeedbackDataproducts.h: Protocol for emission of dataproducts feedback information
//#
//# Copyright (C) 2015
//# ASTRON (Netherlands Institute for Radio Astronomy)
//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
//#
//# This file is part of the LOFAR software suite.
//# The LOFAR software suite is free software: you can redistribute it and/or
//# modify it under the terms of the GNU General Public License as published
//# by the Free Software Foundation, either version 3 of the License, or
//# (at your option) any later version.
//#
//# The LOFAR software suite is distributed in the hope that it will be useful,
//# but WITHOUT ANY WARRANTY; without even the implied warranty of
//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//# GNU General Public License for more details.
//#
//# You should have received a copy of the GNU General Public License along
//# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
//#
//# $Id$
#ifndef LOFAR_MESSAGEBUS_TASK_FEEDBACK_DATAPRODUCTS_H
#define LOFAR_MESSAGEBUS_TASK_FEEDBACK_DATAPRODUCTS_H
#ifdef HAVE_QPID
#include <MessageBus/Message.h>
namespace LOFAR {
namespace Protocols {
// Name of the system sending these messages
static const std::string system = "LOFAR";
// Version of the header we write
static const std::string headerVersion = "1.0.0";
class TaskFeedbackDataproducts: public Message
{
public:
TaskFeedbackDataproducts(
// End-user responsible for this request (if applicable)
const std::string &forUser,
// Human-readable summary describing this request
const std::string &summary,
// Payload: a parset containing the generated feedback
const ParameterSet &feedback
):
Message(
"lofar.task.feedback.dataproducts",
forUser,
summary,
"lofar.task.feedback.dataproducts",
"1.0.0")
{
std::string buffer;
feedback.writeBuffer(buffer);
setTXTPayload(buffer);
}
// Parse a message
TaskFeedbackDataproducts(const qpid::messaging::Message qpidMsg)
:
Message(qpidMsg)
{
}
// Read a message from disk (header + payload)
TaskFeedbackDataproducts(const std::string &rawContent)
:
Message(rawContent)
{
}
ParameterSet feedback() const {
ParameterSet result;
result.adoptBuffer(payload());
return result;
}
};
} // namespace Protocols
} // namespace LOFAR
#endif
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment