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_file_object.hpp
Go to the documentation of this file.
1 #ifndef __IRODS_FILE_OBJECT_HPP__
2 #define __IRODS_FILE_OBJECT_HPP__
3 
4 // =-=-=-=-=-=-=-
5 // irods includes
6 #include "fileCreate.h"
7 #include "rodsConnect.h"
8 
9 // =-=-=-=-=-=-=-
10 #include "irods_data_object.hpp"
12 
13 // =-=-=-=-=-=-=-
14 // stl includes
15 #include <vector>
16 
17 namespace irods {
18 
19  class file_object : public data_object {
20  public:
21  // =-=-=-=-=-=-=-
22  // Constructors
23  file_object();
24  file_object( const file_object& );
26  rsComm_t* _comm,
27  const std::string& _logical_name,
28  const std::string& _filename,
29  rodsLong_t _resc_id,
30  int _fd,
31  int _mode,
32  int _flags );
34  rsComm_t* _comm,
35  const std::string& _logical_name,
36  const std::string& _filename,
37  const std::string& _resc_hier,
38  int _fd,
39  int _mode,
40  int _flags );
41 
43  rsComm_t* _comm,
44  const dataObjInfo_t* _dataObjInfo );
45 
46  // =-=-=-=-=-=-=-
47  // Destructor
48  virtual ~file_object();
49 
50  // =-=-=-=-=-=-=-
51  // Operators
52  virtual file_object& operator=( const file_object& );
53 
55  virtual bool operator==( const file_object& _rhs ) const;
56 
57  // =-=-=-=-=-=-=-
58  // plugin resolution operation
59  virtual error resolve(
60  const std::string&, // plugin interface name
61  plugin_ptr& ); // resolved plugin instance
62 
63  // =-=-=-=-=-=-=-
64  // accessor for rule engine variables
66 
67  // =-=-=-=-=-=-=-
68  // Accessors
69  virtual rsComm_t* comm() const {
70  return comm_;
71  }
72  virtual std::string logical_path() const {
73  return logical_path_;
74  }
75  virtual std::string data_type() const {
76  return data_type_;
77  }
78  virtual int file_descriptor() const {
79  return file_descriptor_;
80  }
81  virtual int l1_desc_idx() const {
82  return l1_desc_idx_;
83  }
84  virtual size_t size() const {
85  return size_;
86  }
87  virtual int repl_requested() const {
88  return repl_requested_;
89  }
90  virtual std::vector< physical_object > replicas() const {
91  return replicas_;
92  }
93  virtual const std::string& in_pdmo() const {
94  return in_pdmo_;
95  }
96 
97  // =-=-=-=-=-=-=-
98  // Mutators
99  virtual void logical_path( const std::string& _s ) {
100  logical_path_ = _s;
101  }
102  virtual void file_descriptor( int _fd ) {
103  file_descriptor_ = _fd;
104  }
105  virtual void comm( rsComm_t* _c ) {
106  comm_ = _c;
107  }
108  virtual void size( size_t _v ) {
109  size_ = _v;
110  }
111  virtual void repl_requested( int _v ) {
112  repl_requested_ = _v;
113  }
114  virtual void in_pdmo( const std::string& _v ) {
115  in_pdmo_ = _v;
116  }
117  virtual void replicas( const std::vector< physical_object >& _v ) {
118  replicas_ = _v;
119  }
120 
121  protected:
122  // =-=-=-=-=-=-=-
123  // Attributes
124  // NOTE :: These are not guaranteed to be properly populated right now
125  // :: that will need be done later when these changes are pushed
126  // :: higher in the original design
127  rsComm_t* comm_; // connection to irods session
128  std::string logical_path_; // full logical path from icat
129  std::string data_type_; // data type as described in objInfo.h:32
130  int file_descriptor_; // file descriptor, if the file is in flight
131  int l1_desc_idx_; // index into irods L1 file descriptor table
132  size_t size_; // size of the file in bytes
133  int repl_requested_; // requested replica number
134  std::string in_pdmo_; // hierarchy indicating the current operations are
135  // occurring from within a pdmo
136  // call made from within the hierarchy
137  std::vector< physical_object > replicas_; // structures holding replica info initialized
138  // by factory fcn from
139  // dataObjInfoHead
140 
141  }; // class file_object
142 
145  typedef boost::shared_ptr< file_object > file_object_ptr;
146 
147 // =-=-=-=-=-=-=-
148 // factory function which will take a dataObjInfo pointer and create a file_object
149  error file_object_factory( rsComm_t*, // server network connection
150  dataObjInp_t*, // incoming data object request struct
151  file_object_ptr, // out var for file object
152  dataObjInfo_t** );
153 
154 }; // namespace irods
155 
156 #endif // __IRODS_FILE_OBJECT_HPP__
irods::plugin_ptr
boost::shared_ptr< plugin_base > plugin_ptr
Definition: irods_first_class_object.hpp:18
irods_physical_object.hpp
rsComm_t
Definition: rcConnect.h:145
irods::file_object::l1_desc_idx
virtual int l1_desc_idx() const
Definition: irods_file_object.hpp:81
irods::file_object::operator=
virtual file_object & operator=(const file_object &)
Definition: irods_file_object.cpp:139
irods::file_object::in_pdmo
virtual const std::string & in_pdmo() const
Definition: irods_file_object.hpp:93
irods::file_object::size
virtual void size(size_t _v)
Definition: irods_file_object.hpp:108
irods::file_object::repl_requested
virtual int repl_requested() const
Definition: irods_file_object.hpp:87
irods::file_object::comm
virtual rsComm_t * comm() const
Definition: irods_file_object.hpp:69
irods::file_object::file_descriptor
virtual int file_descriptor() const
Definition: irods_file_object.hpp:78
irods_data_object.hpp
irods::file_object::in_pdmo
virtual void in_pdmo(const std::string &_v)
Definition: irods_file_object.hpp:114
irods::data_object
Definition: irods_data_object.hpp:22
irods::file_object::repl_requested_
int repl_requested_
Definition: irods_file_object.hpp:133
rodsConnect.h
irods::file_object::replicas
virtual void replicas(const std::vector< physical_object > &_v)
Definition: irods_file_object.hpp:117
irods::file_object::logical_path_
std::string logical_path_
Definition: irods_file_object.hpp:128
irods::file_object::~file_object
virtual ~file_object()
Definition: irods_file_object.cpp:133
irods::file_object::data_type_
std::string data_type_
Definition: irods_file_object.hpp:129
irods::file_object::logical_path
virtual void logical_path(const std::string &_s)
Definition: irods_file_object.hpp:99
fileCreate.h
irods::file_object::comm
virtual void comm(rsComm_t *_c)
Definition: irods_file_object.hpp:105
irods::file_object_factory
error file_object_factory(rsComm_t *, dataObjInp_t *, file_object_ptr, dataObjInfo_t **)
Definition: irods_file_object.cpp:271
irods::file_object::replicas_
std::vector< physical_object > replicas_
Definition: irods_file_object.hpp:137
irods
Definition: apiHandler.hpp:35
irods::file_object::file_descriptor_
int file_descriptor_
Definition: irods_file_object.hpp:130
DataObjInp
Definition: dataObjInpOut.h:65
irods::file_object::operator==
virtual bool operator==(const file_object &_rhs) const
Definition: irods_file_object.cpp:161
irods::file_object::get_re_vars
virtual error get_re_vars(rule_engine_vars_t &)
Definition: irods_file_object.cpp:237
irods::file_object::comm_
rsComm_t * comm_
Definition: irods_file_object.hpp:127
irods::file_object::l1_desc_idx_
int l1_desc_idx_
Definition: irods_file_object.hpp:131
irods::file_object::logical_path
virtual std::string logical_path() const
Definition: irods_file_object.hpp:72
irods::error
Definition: irods_error.hpp:23
irods::file_object::size
virtual size_t size() const
Definition: irods_file_object.hpp:84
irods::file_object::resolve
virtual error resolve(const std::string &, plugin_ptr &)
Definition: irods_file_object.cpp:173
irods::file_object
Definition: irods_file_object.hpp:19
irods::file_object::file_descriptor
virtual void file_descriptor(int _fd)
Definition: irods_file_object.hpp:102
irods::file_object::data_type
virtual std::string data_type() const
Definition: irods_file_object.hpp:75
irods::file_object_ptr
boost::shared_ptr< file_object > file_object_ptr
Definition: irods_file_object.hpp:145
irods::file_object::repl_requested
virtual void repl_requested(int _v)
Definition: irods_file_object.hpp:111
irods::file_object::replicas
virtual std::vector< physical_object > replicas() const
Definition: irods_file_object.hpp:90
irods::file_object::in_pdmo_
std::string in_pdmo_
Definition: irods_file_object.hpp:134
irods::file_object::file_object
file_object()
Definition: irods_file_object.cpp:23
DataObjInfo
Definition: objInfo.h:129
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
irods::file_object::size_
size_t size_
Definition: irods_file_object.hpp:132