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_resource_plugin.hpp
Go to the documentation of this file.
1 #ifndef ___IRODS_RESC_PLUGIN_HPP__
2 #define ___IRODS_RESC_PLUGIN_HPP__
3 
4 // =-=-=-=-=-=-=-
5 #include "irods_plugin_base.hpp"
8 
9 #include <iostream>
10 #include <utility>
11 #include <boost/any.hpp>
12 
13 namespace irods {
14 
15  const std::string RESC_CHILD_MAP_PROP( "resource_child_map_property" );
16  const std::string RESC_PARENT_PROP( "resource_parent_property" );
18 
19 // =-=-=-=-=-=-=-
25  class resource : public plugin_base {
26  public:
27  // =-=-=-=-=-=-=-
30  const std::string& _inst,
31  const std::string& _ctx ) :
33  _inst,
34  _ctx ) {
37  &children_ );
40  parent_ );
41  } // ctor
42 
43  // =-=-=-=-=-=-=-
45  virtual ~resource() {
46  }
47 
48  // =-=-=-=-=-=-=-
50  resource( const resource& _rhs ) :
51  plugin_base( _rhs ) {
52  children_ = _rhs.children_;
53  parent_ = _rhs.parent_;
54  } // cctor
55 
56  // =-=-=-=-=-=-=-
58  resource& operator=( const resource& _rhs ) {
59  if ( &_rhs == this ) {
60  return *this;
61  }
62  plugin_base::operator=( _rhs );
63  children_ = _rhs.children_;
64  parent_ = _rhs.parent_;
65  return *this;
66  }
67 
68  // =-=-=-=-=-=-=-
70  virtual error add_child( const std::string&, const std::string&, resource_ptr );
71  virtual error remove_child( const std::string& );
72  virtual size_t num_children() {
73  return children_.size();
74  }
75  virtual bool has_child(
76  const std::string& _name ) {
77  return children_.has_entry( _name );
78  }
79  virtual void children( std::vector<std::string>& );
80 
81  // =-=-=-=-=-=-=-
83  virtual error set_parent( const resource_ptr& );
84  virtual error get_parent( resource_ptr& );
85 
86  protected:
87  // =-=-=-=-=-=-=-
91 
92  }; // class resource
93 
94 }; // namespace irods
95 
96 
97 #endif // ___IRODS_RESC_PLUGIN_HPP__
98 
99 
100 
irods::lookup_table
Definition: irods_lookup_table.hpp:24
irods::resource::~resource
virtual ~resource()
Definition: irods_resource_plugin.hpp:45
irods::resource
Definition: irods_resource_plugin.hpp:25
irods_plugin_base.hpp
irods::resource_ptr
boost::shared_ptr< resource > resource_ptr
Definition: irods_resource_types.hpp:11
irods::resource::remove_child
virtual error remove_child(const std::string &)
Definition: irods_resource_plugin.cpp:45
irods::resource::operator=
resource & operator=(const resource &_rhs)
Definition: irods_resource_plugin.hpp:58
irods::resource::resource
resource(const std::string &_inst, const std::string &_ctx)
Definition: irods_resource_plugin.hpp:29
irods::resource::get_parent
virtual error get_parent(resource_ptr &)
Definition: irods_resource_plugin.cpp:66
irods::resource::set_parent
virtual error set_parent(const resource_ptr &)
Definition: irods_resource_plugin.cpp:60
irods_resource_types.hpp
irods::lookup_table::size
int size() const
Definition: irods_lookup_table.hpp:38
irods::RESC_PARENT_PROP
const std::string RESC_PARENT_PROP("resource_parent_property")
irods::plugin_base::operator=
plugin_base & operator=(const plugin_base &_rhs)
Definition: irods_plugin_base.hpp:75
irods_resource_constants.hpp
irods::plugin_base::properties_
plugin_property_map properties_
Definition: irods_plugin_base.hpp:332
irods
Definition: apiHandler.hpp:35
irods::plugin_base
Definition: irods_plugin_base.hpp:48
irods::lookup_table::has_entry
bool has_entry(KeyType _k) const
Definition: irods_lookup_table.hpp:41
irods::RESC_CHILD_MAP_PROP
const std::string RESC_CHILD_MAP_PROP("resource_child_map_property")
irods::error
Definition: irods_error.hpp:23
irods::resource::children_
resource_child_map children_
Definition: irods_resource_plugin.hpp:89
irods::resource::resource
resource(const resource &_rhs)
Definition: irods_resource_plugin.hpp:50
irods::resource::num_children
virtual size_t num_children()
Definition: irods_resource_plugin.hpp:72
irods::resource::add_child
virtual error add_child(const std::string &, const std::string &, resource_ptr)
Definition: irods_resource_plugin.cpp:19
irods::resource::has_child
virtual bool has_child(const std::string &_name)
Definition: irods_resource_plugin.hpp:75
irods::resource_child_map
lookup_table< std::pair< std::string, resource_ptr > > resource_child_map
Definition: irods_resource_plugin.hpp:17
irods::lookup_table::set
error set(const std::string &_key, const ValueType &_val)
Definition: irods_lookup_table.hpp:83
irods::resource::parent_
resource_ptr parent_
Definition: irods_resource_plugin.hpp:90
irods::resource::children
virtual void children(std::vector< std::string > &)
Definition: irods_resource_plugin.cpp:79