irods  4.2.8
About: iRODS (the integrated Rule Oriented Data System) is a distributed data-management system for creating data grids, digital libraries, persistent archives, and real-time data systems.
  Fossies Dox: irods-4.2.8.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

irods_server_state.cpp
Go to the documentation of this file.
1 
2 
3 #include "rodsErrorTable.h"
4 #include "irods_server_state.hpp"
5 
6 namespace irods {
7 
8  const std::string server_state::RUNNING( "server_state_running" );
9  const std::string server_state::PAUSED( "server_state_paused" );
10  const std::string server_state::STOPPED( "server_state_stopped" );
11  const std::string server_state::EXITED( "server_state_exited" );
12 
13 
15  state_( RUNNING ) {
16  }
17 
19  static server_state instance_;
20  return instance_;
21  }
22 
23  error server_state::operator()( const std::string& _s ) {
24  boost::mutex::scoped_lock lock( mutex_ );
25  if ( RUNNING != _s &&
26  PAUSED != _s &&
27  STOPPED != _s &&
28  EXITED != _s ) {
29  std::string msg( "invalid state [" );
30  msg += _s;
31  msg += "]";
32  return ERROR(
34  msg );
35 
36  }
37 
38  state_ = _s;
39 
40  return SUCCESS();
41  }
42 
43  std::string server_state::operator()() {
44  boost::mutex::scoped_lock lock( mutex_ );
45  return state_;
46  }
47 
48 
49 }; // namespace irods
50 
51 
52 
53 
irods::server_state::instance
static server_state & instance()
Definition: irods_server_state.cpp:18
irods::server_state::RUNNING
static const std::string RUNNING
Definition: irods_server_state.hpp:17
irods::server_state::state_
std::string state_
Definition: irods_server_state.hpp:28
irods::server_state::PAUSED
static const std::string PAUSED
Definition: irods_server_state.hpp:18
SYS_INVALID_INPUT_PARAM
@ SYS_INVALID_INPUT_PARAM
Definition: rodsErrorTable.h:195
SUCCESS
#define SUCCESS()
Definition: irods_error.hpp:121
irods::server_state::EXITED
static const std::string EXITED
Definition: irods_server_state.hpp:20
irods.pypyodbc.lock
lock
Definition: pypyodbc.py:66
irods::server_state::STOPPED
static const std::string STOPPED
Definition: irods_server_state.hpp:19
irods
Definition: apiHandler.hpp:35
irods::server_state
Definition: irods_server_state.hpp:11
ERROR
#define ERROR(code_, message_)
Definition: irods_error.hpp:117
irods::error
Definition: irods_error.hpp:23
irods::server_state::server_state
server_state()
Definition: irods_server_state.cpp:14
irods::server_state::operator()
std::string operator()()
Definition: irods_server_state.cpp:43
irods_server_state.hpp
rodsErrorTable.h
irods::server_state::mutex_
boost::mutex mutex_
Definition: irods_server_state.hpp:27