Skip to content

Commit

Permalink
Added workspace helper to CatalogHelper. Refs #9186.
Browse files Browse the repository at this point in the history
  • Loading branch information
jawrainey committed Apr 1, 2014
1 parent 01be35b commit e362b0d
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions Code/Mantid/Framework/ICat/inc/MantidICat/CatalogHelper.h
@@ -1,8 +1,7 @@
#ifndef MANTID_ICAT_CATALOGHELPER_H_
#define MANTID_ICAT_CATALOGHELPER_H_

#include <iostream>
#include <stdexcept>
#include "MantidAPI/TableRow.h"

namespace Mantid
{
Expand All @@ -12,6 +11,19 @@ namespace Mantid
{
public:


/**
* Save data value to table workspace if it exists, otherwise insert empty string.
* @param value :: Pointer to input value.
* @param table :: Table row reference.
*/
template<class T>
void saveValueToTableWorkspace(T* value, API::TableRow &table)
{
if(value || value != 0) table << *value;
else table << "";
}

/**
* Parse the message returned by ICAT to obtain a user friendly error message.
* @param icatProxy :: The PortBindingProxy of the ICAT instance.
Expand All @@ -37,7 +49,6 @@ namespace Mantid

throw std::runtime_error(exception);
}

};
}
}
Expand Down

0 comments on commit e362b0d

Please sign in to comment.