Skip to content

Commit

Permalink
Add some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jlsalmon committed Apr 4, 2013
1 parent ecbcdfa commit 24786de
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/PyXRootDCopyProcess.cc
Expand Up @@ -21,6 +21,9 @@

namespace PyXRootD
{
//----------------------------------------------------------------------------
// Add a job to the copy process
//----------------------------------------------------------------------------
PyObject* CopyProcess::AddJob( CopyProcess *self, PyObject *args, PyObject *kwds )
{
static char *kwlist[] = { "source", "target", "sourcelimit", "force",
Expand Down Expand Up @@ -56,12 +59,18 @@ namespace PyXRootD
Py_RETURN_NONE;
}

//----------------------------------------------------------------------------
// Prepare the copy jobs
//----------------------------------------------------------------------------
PyObject* CopyProcess::Prepare( CopyProcess *self, PyObject *args, PyObject *kwds )
{
XrdCl::XRootDStatus status = self->process->Prepare();
return ConvertType<XrdCl::XRootDStatus>( &status );
}

//----------------------------------------------------------------------------
// Run the copy jobs
//----------------------------------------------------------------------------
PyObject* CopyProcess::Run( CopyProcess *self, PyObject *args, PyObject *kwds )
{
XrdCl::CopyProgressHandler *handler = new PyCopyProgressHandler();
Expand Down
17 changes: 16 additions & 1 deletion src/PyXRootDCopyProcess.hh
Expand Up @@ -26,18 +26,33 @@

namespace PyXRootD
{
//----------------------------------------------------------------------------
//! Interface for copy progress notification (not really used here)
//----------------------------------------------------------------------------
class PyCopyProgressHandler : public XrdCl::CopyProgressHandler
{
public:
//------------------------------------------------------------------------
//! Notify when a new job is about to start
//------------------------------------------------------------------------
void BeginJob( uint16_t jobNum, uint16_t jobTotal,
const XrdCl::URL *source, const XrdCl::URL *destination ) {}

//------------------------------------------------------------------------
//! Notify when the previous job has finished
//------------------------------------------------------------------------
void EndJob( const XrdCl::XRootDStatus &status ) {}

//------------------------------------------------------------------------
//! Notify about the progress of the current job
//------------------------------------------------------------------------
void JobProgress( uint64_t bytesProcessed, uint64_t bytesTotal ) {}

};

//----------------------------------------------------------------------------
//! Copy the data from one point to another
//----------------------------------------------------------------------------
class CopyProcess
{
public:
Expand All @@ -53,7 +68,7 @@ namespace PyXRootD
PyDoc_STRVAR(copyprocess_type_doc, "CopyProcess object (internal)");

//----------------------------------------------------------------------------
//! __init__() equivalent
//! __init__()
//----------------------------------------------------------------------------
static int CopyProcess_init( CopyProcess *self, PyObject *args )
{
Expand Down

0 comments on commit 24786de

Please sign in to comment.