Commit 6946d2bd authored by David COME's avatar David COME
Browse files

Moved SmartZmqContext from castor/tape/utils to castor/messages

parent 748c4f7c
......@@ -16,6 +16,7 @@ add_library(castormessages SHARED
RecallJobFromReadTp.pb.cc
RecallJobFromTapeGateway.pb.cc
ReturnValue.pb.cc
SmartZmqContext.cpp
StopProcessForker.pb.cc
TapeMountedForMigration.pb.cc
TapeMountedForRecall.pb.cc
......
......@@ -22,7 +22,7 @@
* @author Castor Dev team, castor-dev@cern.ch
*****************************************************************************/
#include "castor/tape/utils/SmartZmqContext.hpp"
#include "castor/messages/SmartZmqContext.hpp"
#include <errno.h>
#include <unistd.h>
......@@ -31,21 +31,21 @@
//-----------------------------------------------------------------------------
// constructor
//-----------------------------------------------------------------------------
castor::tape::utils::SmartZmqContext::SmartZmqContext() throw() :
castor::messages::SmartZmqContext::SmartZmqContext() throw() :
m_zmqContext(NULL) {
}
//-----------------------------------------------------------------------------
// constructor
//-----------------------------------------------------------------------------
castor::tape::utils::SmartZmqContext::SmartZmqContext(void *const zmqContext)
castor::messages::SmartZmqContext::SmartZmqContext(void *const zmqContext)
throw() : m_zmqContext(zmqContext) {
}
//-----------------------------------------------------------------------------
// reset
//-----------------------------------------------------------------------------
void castor::tape::utils::SmartZmqContext::reset(void *const zmqContext)
void castor::messages::SmartZmqContext::reset(void *const zmqContext)
throw() {
// If the new ZMQ context is not the one already owned
if(zmqContext != m_zmqContext) {
......@@ -63,8 +63,8 @@ void castor::tape::utils::SmartZmqContext::reset(void *const zmqContext)
//-----------------------------------------------------------------------------
// SmartZmqContext assignment operator
//-----------------------------------------------------------------------------
castor::tape::utils::SmartZmqContext
&castor::tape::utils::SmartZmqContext::operator=(SmartZmqContext& obj) {
castor::messages::SmartZmqContext
&castor::messages::SmartZmqContext::operator=(SmartZmqContext& obj) {
reset(obj.release());
return *this;
}
......@@ -72,21 +72,21 @@ castor::tape::utils::SmartZmqContext
//-----------------------------------------------------------------------------
// destructor
//-----------------------------------------------------------------------------
castor::tape::utils::SmartZmqContext::~SmartZmqContext() throw() {
castor::messages::SmartZmqContext::~SmartZmqContext() throw() {
reset();
}
//-----------------------------------------------------------------------------
// get
//-----------------------------------------------------------------------------
void *castor::tape::utils::SmartZmqContext::get() const throw() {
void *castor::messages::SmartZmqContext::get() const throw() {
return m_zmqContext;
}
//-----------------------------------------------------------------------------
// release
//-----------------------------------------------------------------------------
void *castor::tape::utils::SmartZmqContext::release() {
void *castor::messages::SmartZmqContext::release() {
// If this smart pointer does not own a ZMQ context
if(NULL == m_zmqContext) {
castor::exception::NotAnOwner ex;
......
......@@ -29,8 +29,7 @@
namespace castor {
namespace tape {
namespace utils {
namespace messages {
/**
* A smart pointer that owns a ZMQ context. If the smart pointer goes out of
......@@ -118,7 +117,6 @@ private:
}; // class SmartZmqContext
} // namespace utils
} // namespace tape
} // namespace message
} // namespace castor
......@@ -38,7 +38,7 @@
#include "castor/tape/tapeserver/daemon/ProcessForkerMsgType.hpp"
#include "castor/tape/tapeserver/daemon/ProcessForkerUtils.hpp"
#include "castor/tape/utils/DriveConfig.hpp"
#include "castor/tape/utils/SmartZmqContext.hpp"
#include "castor/messages/SmartZmqContext.hpp"
#include "castor/utils/SmartArrayPtr.hpp"
#include "castor/utils/utils.hpp"
#include "h/serrno.h"
......@@ -506,7 +506,7 @@ int castor::tape::tapeserver::daemon::ProcessForker::runDataTransferSession(
legacymsg::RmcProxyTcpIp rmc(m_log, rqst.rmcport(), netTimeout);
const int sizeOfIOThreadPoolForZMQ = 1;
utils::SmartZmqContext
messages::SmartZmqContext
zmqContext(instantiateZmqContext(sizeOfIOThreadPoolForZMQ));
messages::TapeserverProxyZmq tapeserver(m_log,
......
......@@ -29,7 +29,6 @@ set (TAPE_UTILS_LIB_SRC_FILES
BoolFunctor.cpp
DriveConfigMap.cpp
ShutdownBoolFunctor.cpp
SmartZmqContext.cpp
Timer.cpp
TpconfigLine.cpp
utils.cpp)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment