Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dCache
cta
Commits
7ef2dbf7
Commit
7ef2dbf7
authored
8 years ago
by
Steven Murray
Browse files
Options
Downloads
Patches
Plain Diff
Removed unused AcsProxyZmqSingleton
parent
278fae21
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
mediachanger/AcsProxyZmqSingleton.cpp
+0
-60
0 additions, 60 deletions
mediachanger/AcsProxyZmqSingleton.cpp
mediachanger/AcsProxyZmqSingleton.hpp
+0
-95
0 additions, 95 deletions
mediachanger/AcsProxyZmqSingleton.hpp
mediachanger/CMakeLists.txt
+0
-1
0 additions, 1 deletion
mediachanger/CMakeLists.txt
with
0 additions
and
156 deletions
mediachanger/AcsProxyZmqSingleton.cpp
deleted
100644 → 0
+
0
−
60
View file @
278fae21
/*
* The CERN Tape Archive (CTA) project
* Copyright (C) 2015 CERN
*
* This program 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.
*
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include
"common/exception/Exception.hpp"
#include
"common/utils/utils.hpp"
#include
"mediachanger/AcsProxyZmqSingleton.hpp"
namespace
cta
{
namespace
mediachanger
{
//------------------------------------------------------------------------------
// s_mutex
//------------------------------------------------------------------------------
std
::
mutex
AcsProxyZmqSingleton
::
s_mutex
;
//------------------------------------------------------------------------------
// s_instance
//------------------------------------------------------------------------------
std
::
unique_ptr
<
AcsProxyZmqSingleton
>
AcsProxyZmqSingleton
::
s_instance
;
//------------------------------------------------------------------------------
// instance
//------------------------------------------------------------------------------
AcsProxyZmqSingleton
&
AcsProxyZmqSingleton
::
instance
(
void
*
const
zmqContext
)
{
try
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
s_mutex
);
if
(
nullptr
==
s_instance
)
{
s_instance
.
reset
(
new
AcsProxyZmqSingleton
(
zmqContext
));
}
return
*
s_instance
;
}
catch
(
exception
::
Exception
&
ex
)
{
throw
exception
::
Exception
(
std
::
string
(
__FUNCTION__
)
+
" failed: "
+
ex
.
getMessage
().
str
());
}
}
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
AcsProxyZmqSingleton
::
AcsProxyZmqSingleton
(
void
*
const
zmqContext
,
const
unsigned
short
serverPort
)
throw
()
:
AcsProxyZmq
(
zmqContext
,
serverPort
)
{
}
}
// namespace mediachanger
}
// namespace cta
This diff is collapsed.
Click to expand it.
mediachanger/AcsProxyZmqSingleton.hpp
deleted
100644 → 0
+
0
−
95
View file @
278fae21
/*
* The CERN Tape Archive(CTA) project
* Copyright(C) 2015 CERN
*
* This program 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.
*
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include
"mediachanger/Constants.hpp"
#include
"mediachanger/AcsProxyZmq.hpp"
#include
<memory>
#include
<mutex>
namespace
cta
{
namespace
mediachanger
{
/**
* A singleton class.
*/
class
AcsProxyZmqSingleton
:
public
AcsProxyZmq
{
public:
/**
* Delete the default constructor.
*/
AcsProxyZmqSingleton
()
=
delete
;
/**
* Delete the copy constructor.
*/
AcsProxyZmqSingleton
(
const
AcsProxyZmqSingleton
&
)
=
delete
;
/**
* Delete the move constructor.
*/
AcsProxyZmqSingleton
(
AcsProxyZmqSingleton
&&
)
=
delete
;
/**
* Delete the copy assignment oprator.
*/
AcsProxyZmqSingleton
&
operator
=
(
const
AcsProxyZmqSingleton
&
)
=
delete
;
/**
* Delete the move assignment oprator.
*/
AcsProxyZmqSingleton
&
operator
=
(
AcsProxyZmqSingleton
&&
)
=
delete
;
/**
* Returns the singleton instance.
*
* @param zmqContext The ZMQ context to be used to construct the instance if
* the instance does not already exist.
* @return the singleton instance.
*/
static
AcsProxyZmqSingleton
&
instance
(
void
*
const
zmqContext
);
private:
/**
* Provate constructor to only be used by the instance() method.
*
* @param zmqContext The ZMQ context.
* @param serverPort The TCP/IP port on which the CASTOR ACS daemon is
* listening for ZMQ messages.
*/
AcsProxyZmqSingleton
(
void
*
const
zmqContext
,
const
unsigned
short
serverPort
=
ACS_PORT
)
throw
();
/**
* Mutex used to implement a critical region around the implementation of the
* instance() method.
*/
static
std
::
mutex
s_mutex
;
/**
* The single instance.
*/
static
std
::
unique_ptr
<
AcsProxyZmqSingleton
>
s_instance
;
};
// class AcsProxyZmqSingleton
}
// namespace mediachanger
}
// namespace cta
This diff is collapsed.
Click to expand it.
mediachanger/CMakeLists.txt
+
0
−
1
View file @
7ef2dbf7
...
...
@@ -25,7 +25,6 @@ PROTOBUF_GENERATE_CPP(ProtoSources ProtoHeaders ${ProtoFiles})
set
(
MEDIACHANGER_LIB_SRC_FILES
AcsLibrarySlot.cpp
AcsProxyZmq.cpp
AcsProxyZmqSingleton.cpp
CmdLine.cpp
CmdLineTool.cpp
CommonMarshal.cpp
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment