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_data_object.hpp
Go to the documentation of this file.
1 #ifndef __IRODS_DATA_OBJECT_HPP__
2 #define __IRODS_DATA_OBJECT_HPP__
3 
4 // =-=-=-=-=-=-=-
6 
7 // =-=-=-=-=-=-=-
8 // irods includes
9 #include "rcConnect.h"
10 #include "rcMisc.h"
11 
12 
13 namespace irods {
14 
17  class data_object;
18  typedef boost::shared_ptr< data_object > data_object_ptr;
19 
20 // =-=-=-=-=-=-=-
21 // base class for all object types
23  public:
24  // =-=-=-=-=-=-=-
25  // Constructors
26  data_object();
28  const std::string&, // phy path
29  rodsLong_t, // resc id
30  int, // mode
31  int ); // flags
33  const std::string&, // phy path
34  rodsLong_t, // resc id
35  int, // mode
36  int, // flags
37  const keyValPair_t& ); // cond_input
39  const std::string&, // phy path
40  const std::string&, // resc hier
41  int, // mode
42  int ); // flags
44  const std::string&, // phy path
45  const std::string&, // resc hier
46  int, // mode
47  int, // flags
48  const keyValPair_t& ); // cond_input
49 
50 
51  data_object( const data_object& );
52 
53  // =-=-=-=-=-=-=-
54  // Destructor
55  virtual ~data_object();
56 
57  // =-=-=-=-=-=-=-
58  // Operators
59  virtual data_object& operator=( const data_object& );
60 
61  // =-=-=-=-=-=-=-
62  // plugin resolution operators
63  virtual error resolve(
64  const std::string&, // plugin interface name
65  plugin_ptr& ) = 0; // resolved plugin instance
66 
67  // =-=-=-=-=-=-=-
68  // accessor for rule engine variables
70 
71  // =-=-=-=-=-=-=-
72  // Accessors
73 
74  virtual std::string physical_path() const {
75  return physical_path_;
76  }
77  virtual std::string resc_hier() const {
78  return resc_hier_;
79  }
80  virtual long id() const {
81  return id_;
82  }
83  virtual int mode() const {
84  return mode_;
85  }
86  virtual int flags() const {
87  return flags_;
88  }
89  virtual const keyValPair_t& cond_input() const {
90  return cond_input_;
91  }
92  virtual rodsLong_t resc_id() const {
93  return resc_id_;
94  }
95 
96  // =-=-=-=-=-=-=-
97  // Mutators
98  virtual void physical_path( const std::string& _path ) {
99  physical_path_ = _path;
100  }
101  virtual void resc_hier( const std::string& _hier ) {
102  resc_hier_ = _hier;
103  }
104  virtual void id( long _id ) {
105  id_ = _id;
106  }
107  virtual void mode( int _m ) {
108  mode_ = _m;
109  }
110  virtual void flags( int _f ) {
111  flags_ = _f;
112  }
113  virtual void cond_input( const keyValPair_t& _cond_input ) {
114  replKeyVal( &_cond_input, &cond_input_ );
115  }
116  virtual void resc_id( rodsLong_t _id ) {
117  resc_id_ = _id;
118  }
119 
120  friend void add_key_val(
121  data_object_ptr& _do,
122  const std::string& _k,
123  const std::string& _v );
124 
125  friend void remove_key_val(
126  data_object_ptr& _do,
127  const std::string& _k );
128 
129  protected:
130  // =-=-=-=-=-=-=-
131  // Attributes
132  // NOTE :: These are not guaranteed to be properly populated right now
133  // :: that will need be done later when these changes are pushed
134  // :: higher in the original design
135  std::string physical_path_; // full physical path in the vault
136  std::string resc_hier_; // where this lives in the resource hierarchy
137  long id_; // object id
138  int mode_; // mode when opened or modified
139  int flags_; // flags for object operations
140  keyValPair_t cond_input_; // input key-value pairs
141  rodsLong_t resc_id_; // leaf resource id used to generate hierarchy
142 
143  }; // class data_object
144 
145 }; // namespace irods
146 
147 #endif // __IRODS_DATA_OBJECT_HPP__
irods::plugin_ptr
boost::shared_ptr< plugin_base > plugin_ptr
Definition: irods_first_class_object.hpp:18
irods::data_object::cond_input_
keyValPair_t cond_input_
Definition: irods_data_object.hpp:140
irods::data_object::id_
long id_
Definition: irods_data_object.hpp:137
irods::data_object::flags
virtual void flags(int _f)
Definition: irods_data_object.hpp:110
irods::data_object::flags_
int flags_
Definition: irods_data_object.hpp:139
irods::data_object::mode
virtual int mode() const
Definition: irods_data_object.hpp:83
irods::data_object::resc_hier
virtual void resc_hier(const std::string &_hier)
Definition: irods_data_object.hpp:101
irods::data_object_ptr
boost::shared_ptr< data_object > data_object_ptr
Definition: irods_data_object.hpp:17
irods::data_object::physical_path
virtual void physical_path(const std::string &_path)
Definition: irods_data_object.hpp:98
rcMisc.h
rcConnect.h
irods::data_object::resc_id
virtual rodsLong_t resc_id() const
Definition: irods_data_object.hpp:92
irods::data_object
Definition: irods_data_object.hpp:22
irods::data_object::physical_path_
std::string physical_path_
Definition: irods_data_object.hpp:135
irods::data_object::cond_input
virtual void cond_input(const keyValPair_t &_cond_input)
Definition: irods_data_object.hpp:113
irods::data_object::add_key_val
friend void add_key_val(data_object_ptr &_do, const std::string &_k, const std::string &_v)
Definition: irods_data_object.cpp:172
irods::data_object::resolve
virtual error resolve(const std::string &, plugin_ptr &)=0
irods::data_object::id
virtual long id() const
Definition: irods_data_object.hpp:80
irods::data_object::cond_input
virtual const keyValPair_t & cond_input() const
Definition: irods_data_object.hpp:89
irods::data_object::operator=
virtual data_object & operator=(const data_object &)
Definition: irods_data_object.cpp:122
irods
Definition: apiHandler.hpp:35
irods::data_object::physical_path
virtual std::string physical_path() const
Definition: irods_data_object.hpp:74
irods::data_object::mode_
int mode_
Definition: irods_data_object.hpp:138
irods::data_object::resc_hier
virtual std::string resc_hier() const
Definition: irods_data_object.hpp:77
irods::data_object::id
virtual void id(long _id)
Definition: irods_data_object.hpp:104
irods::data_object::~data_object
virtual ~data_object()
Definition: irods_data_object.cpp:116
irods::error
Definition: irods_error.hpp:23
irods::data_object::data_object
data_object()
Definition: irods_data_object.cpp:11
irods_first_class_object.hpp
irods::data_object::flags
virtual int flags() const
Definition: irods_data_object.hpp:86
irods::data_object::resc_id
virtual void resc_id(rodsLong_t _id)
Definition: irods_data_object.hpp:116
irods::data_object::get_re_vars
virtual error get_re_vars(rule_engine_vars_t &)
Definition: irods_data_object.cpp:137
irods::first_class_object
Definition: irods_first_class_object.hpp:23
irods::data_object::mode
virtual void mode(int _m)
Definition: irods_data_object.hpp:107
irods::data_object::remove_key_val
friend void remove_key_val(data_object_ptr &_do, const std::string &_k)
Definition: irods_data_object.cpp:182
irods::data_object::resc_hier_
std::string resc_hier_
Definition: irods_data_object.hpp:136
irods::data_object::resc_id_
rodsLong_t resc_id_
Definition: irods_data_object.hpp:141
KeyValPair
Definition: objInfo.h:120
replKeyVal
int replKeyVal(const keyValPair_t *srcCondInput, keyValPair_t *destCondInput)
Definition: rcMisc.cpp:739
irods::rule_engine_vars_t
std::map< std::string, std::string > rule_engine_vars_t
Definition: irods_first_class_object.hpp:20
rodsLong_t
long long rodsLong_t
Definition: rodsType.h:32