00001
00002
00003
00004
00005 #include "eirods_data_object.h"
00006 #include "eirods_resource_manager.h"
00007
00008 namespace eirods {
00009
00010
00011
00012 data_object::data_object() :
00013 physical_path_(""),
00014 resc_hier_(""),
00015 mode_(0),
00016 flags_(0) {
00017 }
00018
00019
00020
00021 data_object::data_object(
00022 const std::string& _phy_path,
00023 const std::string& _resc_hier,
00024 int _mode,
00025 int _flags ) :
00026 physical_path_( _phy_path ),
00027 resc_hier_( _resc_hier ),
00028 mode_( _mode ),
00029 flags_( _flags ) {
00030 }
00031
00032
00033
00034 data_object::data_object(
00035 const data_object& _rhs ) {
00036 physical_path_ = _rhs.physical_path_;
00037 resc_hier_ = _rhs.resc_hier_;
00038 mode_ = _rhs.mode_;
00039 flags_ = _rhs.flags_;
00040
00041 }
00042
00043
00044
00045 data_object::~data_object() {
00046 }
00047
00048
00049
00050 data_object& data_object::operator=(
00051 const data_object& _rhs ) {
00052 physical_path_ = _rhs.physical_path_;
00053 resc_hier_ = _rhs.resc_hier_;
00054 mode_ = _rhs.mode_;
00055 flags_ = _rhs.flags_;
00056
00057 return *this;
00058 }
00059
00060
00061
00062 error data_object::get_re_vars(
00063 keyValPair_t& _kvp ) {
00064
00065 addKeyVal( &_kvp, PHYSICAL_PATH_KW, physical_path_.c_str() );
00066 addKeyVal( &_kvp, RESC_HIER_STR_KW, resc_hier_.c_str() );
00067
00068 std::stringstream mode_str;
00069 mode_str << mode_;
00070 addKeyVal( &_kvp, MODE_KW, mode_str.str().c_str() );
00071
00072 std::stringstream flags_str;
00073 flags_str << flags_;
00074 addKeyVal( &_kvp, FLAGS_KW, flags_str.str().c_str() );
00075
00076 return SUCCESS();
00077
00078 }
00079
00080 };
00081
00082
00083