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_environment_properties.hpp
Go to the documentation of this file.
1 #ifndef IRODS_ENVIRONMENT_PROPERTIES_HPP_
2 #define IRODS_ENVIRONMENT_PROPERTIES_HPP_
3 
4 
7 #include "irods_exception.hpp"
8 
9 #include <map>
10 
11 namespace irods {
12 
13  static const std::string IRODS_JSON_ENV_FILE = "/.irods/irods_environment.json";
14 
15  error get_json_environment_file( std::string& _env_file, std::string& _session_file);
16 
18 
19  public:
21 
26 
30  void capture( );
31 
36  template< typename T >
37  error get_property( const std::string& _key, T& _val ) {
38  try {
39  _val = get_property<T>( _key );
40  } catch ( const irods::exception& e ) {
41  return irods::error(e);
42  }
43  return SUCCESS();
44  }
45 
46 
47  template< typename T >
48  T& get_property( const std::string& _key ) {
49  return config_props_.get< T >( _key );
50  }
51 
52  template< typename T >
53  T& set_property( const std::string& _key, const T& _val ) {
54  return config_props_.set< T >( _key, _val );
55  }
56 
57  template< typename T >
58  T remove( const std::string& _key ) {
59  return config_props_.remove(_key);
60  }
61 
62  void remove( const std::string& _key );
63 
64  std::unordered_map<std::string, boost::any>& map() {
65  return config_props_.map();
66  }
67  private:
68  // Disable constructors
72 
76  void capture_json( const std::string& );
77 
82 
83  }; // class environment_properties
84 
85  template< typename T >
86  T& get_environment_property( const std::string& _prop ) {
88  }
89 
90  template< typename T >
91  T& set_environment_property( const std::string& _prop, const T& _val ) {
93  }
94 } // namespace irods
95 
96 #endif /* IRODS_ENVIRONMENT_PROPERTIES_HPP_ */
irods::configuration_parser::map
std::unordered_map< std::string, boost::any > & map()
Definition: irods_configuration_parser.hpp:131
irods::environment_properties::operator=
void operator=(environment_properties const &)
irods_configuration_keywords.hpp
irods::environment_properties::capture
void capture()
Definition: irods_environment_properties.cpp:81
irods::environment_properties::instance
static environment_properties & instance()
Definition: irods_environment_properties.cpp:72
irods::environment_properties
Definition: irods_environment_properties.hpp:17
irods::configuration_parser::remove
T remove(const std::string &_key)
Definition: irods_configuration_parser.hpp:119
irods_exception.hpp
irods::environment_properties::remove
T remove(const std::string &_key)
Definition: irods_environment_properties.hpp:58
irods::configuration_parser::get
T & get(const std::string &_key)
Definition: irods_configuration_parser.hpp:76
irods::get_json_environment_file
error get_json_environment_file(std::string &_env_file, std::string &_session_file)
Definition: irods_environment_properties.cpp:19
irods::configuration_parser::set
T & set(const std::string &_key, const T &_val)
Definition: irods_configuration_parser.hpp:38
irods::environment_properties::config_props_
configuration_parser config_props_
Definition: irods_environment_properties.hpp:81
irods::environment_properties::get_property
T & get_property(const std::string &_key)
Definition: irods_environment_properties.hpp:48
SUCCESS
#define SUCCESS()
Definition: irods_error.hpp:121
irods::IRODS_JSON_ENV_FILE
static const std::string IRODS_JSON_ENV_FILE
Definition: irods_environment_properties.hpp:13
irods
Definition: apiHandler.hpp:35
irods::environment_properties::get_property
error get_property(const std::string &_key, T &_val)
Definition: irods_environment_properties.hpp:37
irods::configuration_parser
Definition: irods_configuration_parser.hpp:20
terminate_irods_processes.e
e
Definition: terminate_irods_processes.py:19
irods::get_environment_property
T & get_environment_property(const std::string &_prop)
Definition: irods_environment_properties.hpp:86
irods::environment_properties::environment_properties
environment_properties(environment_properties const &)
irods::error
Definition: irods_error.hpp:23
irods::environment_properties::map
std::unordered_map< std::string, boost::any > & map()
Definition: irods_environment_properties.hpp:64
irods::environment_properties::environment_properties
environment_properties()
Definition: irods_environment_properties.cpp:77
error
int error
Definition: filesystem.cpp:101
irods::environment_properties::capture_json
void capture_json(const std::string &)
Definition: irods_environment_properties.cpp:109
irods::exception
Definition: irods_exception.hpp:15
irods_configuration_parser.hpp
irods::set_environment_property
T & set_environment_property(const std::string &_prop, const T &_val)
Definition: irods_environment_properties.hpp:91
irods::environment_properties::set_property
T & set_property(const std::string &_key, const T &_val)
Definition: irods_environment_properties.hpp:53