Back to index

nordugrid-arc-nox  1.1.0~rc6
job_request.cpp
Go to the documentation of this file.
00001 #ifdef HAVE_CONFIG_H
00002 #include <config.h>
00003 #endif
00004 
00005 #include "job_request.h"
00006 
00007 namespace Arc {
00008 
00009 JobRequest::JobRequest():buffer_(0) 
00010 {
00011     // NOP
00012 }
00013 
00014 JobRequest::~JobRequest() 
00015 {
00016     // NOP
00017 }
00018 
00019 JobRequest::JobRequest(Arc::XMLNode &r):buffer_(0)
00020 {
00021     r.New(request_);
00022 }
00023 
00024 JobRequest::JobRequest(const JobRequest &r):buffer_(0)
00025 {
00026     r.request_.New(request_);
00027 }
00028 
00029 JobRequest::JobRequest(ByteArray &buffer)
00030 {
00031     int buf_len = 0;
00032     char *buf = buffer.data();
00033     std::string xml_str = buf;
00034     buf_len = xml_str.size() + 1;
00035     Arc::XMLNode n(xml_str);
00036     n.New(request_);
00037 }
00038 
00039 ByteArray &JobRequest::serialize(void)
00040 {
00041     buffer_.clean();
00042     std::string xml_str;
00043     request_.GetXML(xml_str);
00044     buffer_.append(xml_str);
00045     return buffer_;
00046 }
00047 
00048 JobRequest::operator std::string(void) const
00049 {
00050     std::string xml_str;
00051     request_.GetXML(xml_str);
00052     std::string out = "Request XML:\n" + xml_str + "\n";
00053     return out;
00054 }
00055 
00056 } //namespace