Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | List of all members
TableWorkspaceTester Class Reference

#include <FakeObjects.h>

Inheritance diagram for TableWorkspaceTester:
Mantid::API::ITableWorkspace Mantid::API::Workspace Mantid::Kernel::DataItem

Public Member Functions

Column_sptr addColumn (const std::string &, const std::string &) override
 Creates a new column. More...
 
std::unique_ptr< TableWorkspaceTesterclone () const
 Returns a clone of the workspace. More...
 
std::unique_ptr< TableWorkspaceTestercloneEmpty () const
 Returns a default-initialized clone of the workspace. More...
 
size_t columnCount () const override
 Number of columns in the workspace. More...
 
void find (Boolean, size_t &, size_t) override
 find method to get the index of API::Boolean value cell in a table workspace More...
 
void find (const Mantid::Kernel::V3D &, size_t &, size_t) override
 find method to get the index of Mantid::Kernel::V3D cell value in a table workspace More...
 
void find (const std::string &, size_t &, size_t) override
 find method to get the index of cellstd::string value in a table workspace More...
 
void find (double, size_t &, size_t) override
 find method to get the index of double cell value in a table workspace More...
 
void find (float, size_t &, size_t) override
 find method to get the index of float cell value in a table workspace More...
 
void find (size_t, size_t &, size_t) override
 find method to get the index of integer cell value in a table workspace More...
 
Column_const_sptr getColumn (const std::string &) const override
 Gets the shared pointer to a column by name. More...
 
Column_sptr getColumn (const std::string &) override
 Gets the shared pointer to a column by name. More...
 
Column_const_sptr getColumn (size_t) const override
 Gets the shared pointer to a column by index - return none-modifyable column. More...
 
Column_sptr getColumn (size_t) override
 Gets the shared pointer to a column by index. More...
 
std::vector< std::string > getColumnNames () const override
 Returns a vector of all column names. More...
 
LogManager_const_sptr getLogs () const override
 Get constant access to shared pointer containing workspace properties. More...
 
size_t getMemorySize () const override
 Get the footprint in memory in bytes. More...
 
const std::string id () const override
 Return the workspace typeID. More...
 
size_t insertRow (size_t) override
 Inserts a row before row pointed to by index and fills it with default vales. More...
 
LogManager_sptr logs () override
 Get access to shared pointer containing workspace properties. More...
 
void removeColumn (const std::string &) override
 Removes a column. More...
 
void removeRow (size_t) override
 Delets a row if it exists. More...
 
size_t rowCount () const override
 Number of rows in the workspace. More...
 
void setRowCount (size_t) override
 Resizes the workspace. More...
 
- Public Member Functions inherited from Mantid::API::ITableWorkspace
virtual Column_sptr addColumn (const std::string &type, const std::string &name)=0
 Creates a new column. More...
 
virtual bool addColumns (const std::string &type, const std::string &name, size_t n)
 Creates n new columns of the same type. More...
 
TableRowHelper appendRow ()
 Appends a row. More...
 
BooleanBool (size_t row, size_t col)
 Get the reference to the element in row row and column col if its type is bool. More...
 
template<class T >
T & cell (size_t row, size_t col)
 Get the reference to the element in row row and column col. More...
 
ITableWorkspace_uptr clone () const
 Returns a clone of the workspace. More...
 
ITableWorkspace_uptr cloneColumns (const std::vector< std::string > &colNames) const
 Returns a clone of the workspace. More...
 
ITableWorkspace_uptr cloneEmpty () const
 Returns a default-initialized clone of the workspace. More...
 
virtual size_t columnCount () const =0
 Number of columns in the workspace. More...
 
virtual bool customSort () const
 Does this type of TableWorkspace need a custom sorting call (e.g. More...
 
double & Double (size_t row, size_t col)
 Get the reference to the element in row row and column col if its type is double. More...
 
virtual void find (API::Boolean value, size_t &row, size_t col)=0
 find method to get the index of API::Boolean value cell in a table workspace More...
 
virtual void find (const Mantid::Kernel::V3D &value, size_t &row, size_t col)=0
 find method to get the index of Mantid::Kernel::V3D cell value in a table workspace More...
 
virtual void find (const std::string &value, size_t &row, size_t col)=0
 find method to get the index of cellstd::string value in a table workspace More...
 
virtual void find (double value, size_t &row, size_t col)=0
 find method to get the index of double cell value in a table workspace More...
 
virtual void find (float value, size_t &row, size_t col)=0
 find method to get the index of float cell value in a table workspace More...
 
virtual void find (size_t value, size_t &row, size_t col)=0
 find method to get the index of integer cell value in a table workspace More...
 
virtual Column_const_sptr getColumn (const std::string &name) const =0
 Gets the shared pointer to a column by name. More...
 
virtual Column_sptr getColumn (const std::string &name)=0
 Gets the shared pointer to a column by name. More...
 
virtual Column_const_sptr getColumn (size_t index) const =0
 Gets the shared pointer to a column by index - return none-modifyable column. More...
 
virtual Column_sptr getColumn (size_t index)=0
 Gets the shared pointer to a column by index. More...
 
virtual std::vector< std::string > getColumnNames () const =0
 Returns a vector of all column names. More...
 
TableRowHelper getFirstRow ()
 Creates a TableRow object for the first row (row == 0). More...
 
virtual API::LogManager_const_sptr getLogs () const =0
 Get constant access to shared pointer containing workspace properties. More...
 
template<class T >
T & getRef (const std::string &name, size_t index)
 Get a reference to a data element. More...
 
TableRowHelper getRow (size_t row)
 Creates a TableRow object for row row. More...
 
TableColumnHelper getVector (const std::string &name)
 Access the column with name name trough a ColumnVector object. More...
 
TableConstColumnHelper getVector (const std::string &name) const
 Access the column with name name trough a ColumnVector object. More...
 
const std::string id () const override
 Return the workspace typeID. More...
 
virtual size_t insertRow (size_t index)=0
 Inserts a row before row pointed to by index and fills it with default vales. More...
 
int & Int (size_t row, size_t col)
 Get the reference to the element in row row and column col if its type is int. More...
 
 ITableWorkspace ()
 Constructor. More...
 
virtual API::LogManager_sptr logs ()=0
 Get access to shared pointer containing workspace properties. More...
 
void modified ()
 If the workspace is the AnalysisDataService sends AfterReplaceNotification. More...
 
ITableWorkspaceoperator= (const ITableWorkspace &)=delete
 
virtual void removeColumn (const std::string &name)=0
 Removes a column. More...
 
virtual void removeRow (size_t index)=0
 Delets a row if it exists. More...
 
virtual size_t rowCount () const =0
 Number of rows in the workspace. More...
 
virtual void setRowCount (size_t count)=0
 Resizes the workspace. More...
 
virtual void sort (std::vector< std::pair< std::string, bool > > &criteria)
 Overridable method to custom-sort the workspace. More...
 
std::string & String (size_t row, size_t col)
 Get the reference to the element in row row and column col if its type is std::string. More...
 
const std::string toString () const override
 Serializes the object to a string. More...
 
- Public Member Functions inherited from Mantid::API::Workspace
Workspace_uptr clone () const
 Returns a clone (copy) of the workspace with covariant return type in all derived classes. More...
 
Workspace_uptr cloneEmpty () const
 Returns a default-initialized clone of the workspace. More...
 
const std::string & getComment () const
 Get the workspace comment. More...
 
const WorkspaceHistorygetHistory () const
 Returns a reference to the WorkspaceHistory const. More...
 
virtual size_t getMemorySize () const =0
 Get the footprint in memory in bytes. More...
 
std::string getMemorySizeAsStr () const
 Returns the memory footprint in sensible units. More...
 
const std::string & getName () const override
 Get the workspace name. More...
 
virtual const std::string getTitle () const
 Get the workspace title. More...
 
WorkspaceHistoryhistory ()
 Returns a reference to the WorkspaceHistory. More...
 
bool isDirty (const int n=1) const
 Check whether other algorithms have been applied to the workspace by checking the history length. More...
 
virtual bool isGroup () const
 
Workspaceoperator= (const Workspace &other)=delete
 
void setComment (const std::string &)
 Set the comment field of the workspace. More...
 
virtual void setTitle (const std::string &)
 Set the title of the workspace. More...
 
Parallel::StorageMode storageMode () const
 Returns the storage mode (used for MPI runs) More...
 
bool threadSafe () const override
 Marks the workspace as safe for multiple threads to edit data simutaneously. More...
 
 Workspace (const Parallel::StorageMode storageMode=Parallel::StorageMode::Cloned)
 
 ~Workspace ()
 
- Public Member Functions inherited from Mantid::Kernel::DataItem
 DataItem ()
 Default constructor. More...
 
 DataItem (const DataItem &other)
 Copy constructor Always makes a unique lock. More...
 
virtual ~DataItem ()
 Destructor. More...
 
void readLock ()
 Acquires a read lock. More...
 
void unlock ()
 

Private Member Functions

TableWorkspaceTesterdoClone () const override
 Virtual clone method. Not implemented to force implementation in children. More...
 
ITableWorkspacedoCloneColumns (const std::vector< std::string > &) const override
 
TableWorkspaceTesterdoCloneEmpty () const override
 Virtual cloneEmpty method. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Mantid::API::ITableWorkspace
void insertInColumn (Column *c, size_t index)
 Insert a new element into a column. More...
 
 ITableWorkspace (const ITableWorkspace &)=default
 Protected copy constructor. May be used by childs for cloning. More...
 
void removeFromColumn (Column *c, size_t index)
 Remove an element from a column. More...
 
void resizeColumn (Column *c, size_t size)
 Resize a column. More...
 
- Protected Member Functions inherited from Mantid::API::Workspace
void setStorageMode (Parallel::StorageMode mode)
 Sets the storage mode (used for MPI runs) More...
 
 Workspace (const Workspace &)
 Protected copy constructor. May be used by childs for cloning. More...
 
- Protected Member Functions inherited from Mantid::Kernel::DataItem
Poco::RWLock * getLock () const
 Private method to access the RWLock object. More...
 

Detailed Description

Definition at line 258 of file FakeObjects.h.

Member Function Documentation

◆ addColumn()

Column_sptr TableWorkspaceTester::addColumn ( const std::string &  type,
const std::string &  name 
)
inlineoverridevirtual

Creates a new column.

Parameters
type:: The datatype of the column
name:: The name to assign to the column
Returns
True if the column was successfully added

Implements Mantid::API::ITableWorkspace.

Definition at line 272 of file FakeObjects.h.

◆ clone()

std::unique_ptr< TableWorkspaceTester > TableWorkspaceTester::clone ( ) const
inline

Returns a clone of the workspace.

Definition at line 261 of file FakeObjects.h.

References doClone().

◆ cloneEmpty()

std::unique_ptr< TableWorkspaceTester > TableWorkspaceTester::cloneEmpty ( ) const
inline

Returns a default-initialized clone of the workspace.

Definition at line 264 of file FakeObjects.h.

References doCloneEmpty().

◆ columnCount()

size_t TableWorkspaceTester::columnCount ( ) const
inlineoverridevirtual

Number of columns in the workspace.

Implements Mantid::API::ITableWorkspace.

Definition at line 282 of file FakeObjects.h.

◆ doClone()

TableWorkspaceTester * TableWorkspaceTester::doClone ( ) const
inlineoverrideprivatevirtual

Virtual clone method. Not implemented to force implementation in children.

Reimplemented from Mantid::API::ITableWorkspace.

Definition at line 323 of file FakeObjects.h.

Referenced by clone().

◆ doCloneColumns()

ITableWorkspace * TableWorkspaceTester::doCloneColumns ( const std::vector< std::string > &  ) const
inlineoverrideprivatevirtual

Implements Mantid::API::ITableWorkspace.

Definition at line 329 of file FakeObjects.h.

◆ doCloneEmpty()

TableWorkspaceTester * TableWorkspaceTester::doCloneEmpty ( ) const
inlineoverrideprivatevirtual

Virtual cloneEmpty method.

Not implemented to force implementation in children.

Implements Mantid::API::ITableWorkspace.

Definition at line 326 of file FakeObjects.h.

Referenced by cloneEmpty().

◆ find() [1/6]

void TableWorkspaceTester::find ( Boolean  value,
size_t &  row,
size_t  col 
)
inlineoverridevirtual

find method to get the index of API::Boolean value cell in a table workspace

Implements Mantid::API::ITableWorkspace.

Definition at line 314 of file FakeObjects.h.

◆ find() [2/6]

void TableWorkspaceTester::find ( const Mantid::Kernel::V3D value,
size_t &  row,
size_t  col 
)
inlineoverridevirtual

find method to get the index of Mantid::Kernel::V3D cell value in a table workspace

Implements Mantid::API::ITableWorkspace.

Definition at line 318 of file FakeObjects.h.

◆ find() [3/6]

void TableWorkspaceTester::find ( const std::string &  value,
size_t &  row,
size_t  col 
)
inlineoverridevirtual

find method to get the index of cellstd::string value in a table workspace

Implements Mantid::API::ITableWorkspace.

Definition at line 316 of file FakeObjects.h.

◆ find() [4/6]

void TableWorkspaceTester::find ( double  value,
size_t &  row,
size_t  col 
)
inlineoverridevirtual

find method to get the index of double cell value in a table workspace

Implements Mantid::API::ITableWorkspace.

Definition at line 310 of file FakeObjects.h.

◆ find() [5/6]

void TableWorkspaceTester::find ( float  value,
size_t &  row,
size_t  col 
)
inlineoverridevirtual

find method to get the index of float cell value in a table workspace

Implements Mantid::API::ITableWorkspace.

Definition at line 312 of file FakeObjects.h.

◆ find() [6/6]

void TableWorkspaceTester::find ( size_t  value,
size_t &  row,
size_t  col 
)
inlineoverridevirtual

find method to get the index of integer cell value in a table workspace

Implements Mantid::API::ITableWorkspace.

Definition at line 308 of file FakeObjects.h.

◆ getColumn() [1/4]

Column_const_sptr TableWorkspaceTester::getColumn ( const std::string &  name) const
inlineoverridevirtual

Gets the shared pointer to a column by name.

Implements Mantid::API::ITableWorkspace.

Definition at line 286 of file FakeObjects.h.

◆ getColumn() [2/4]

Column_sptr TableWorkspaceTester::getColumn ( const std::string &  name)
inlineoverridevirtual

Gets the shared pointer to a column by name.

Implements Mantid::API::ITableWorkspace.

Definition at line 284 of file FakeObjects.h.

◆ getColumn() [3/4]

Column_const_sptr TableWorkspaceTester::getColumn ( size_t  index) const
inlineoverridevirtual

Gets the shared pointer to a column by index - return none-modifyable column.

Implements Mantid::API::ITableWorkspace.

Definition at line 292 of file FakeObjects.h.

◆ getColumn() [4/4]

Column_sptr TableWorkspaceTester::getColumn ( size_t  index)
inlineoverridevirtual

Gets the shared pointer to a column by index.

Implements Mantid::API::ITableWorkspace.

Definition at line 290 of file FakeObjects.h.

◆ getColumnNames()

std::vector< std::string > TableWorkspaceTester::getColumnNames ( ) const
inlineoverridevirtual

Returns a vector of all column names.

Implements Mantid::API::ITableWorkspace.

Definition at line 296 of file FakeObjects.h.

◆ getLogs()

LogManager_const_sptr TableWorkspaceTester::getLogs ( ) const
inlineoverridevirtual

Get constant access to shared pointer containing workspace properties.

Implements Mantid::API::ITableWorkspace.

Definition at line 278 of file FakeObjects.h.

◆ getMemorySize()

size_t TableWorkspaceTester::getMemorySize ( ) const
inlineoverridevirtual

Get the footprint in memory in bytes.

Implements Mantid::API::Workspace.

Definition at line 270 of file FakeObjects.h.

◆ id()

const std::string TableWorkspaceTester::id ( ) const
inlineoverridevirtual

Return the workspace typeID.

Reimplemented from Mantid::API::ITableWorkspace.

Definition at line 268 of file FakeObjects.h.

◆ insertRow()

size_t TableWorkspaceTester::insertRow ( size_t  index)
inlineoverridevirtual

Inserts a row before row pointed to by index and fills it with default vales.

Implements Mantid::API::ITableWorkspace.

Definition at line 304 of file FakeObjects.h.

◆ logs()

LogManager_sptr TableWorkspaceTester::logs ( )
inlineoverridevirtual

Get access to shared pointer containing workspace properties.

Implements Mantid::API::ITableWorkspace.

Definition at line 276 of file FakeObjects.h.

◆ removeColumn()

void TableWorkspaceTester::removeColumn ( const std::string &  name)
inlineoverridevirtual

Removes a column.

Implements Mantid::API::ITableWorkspace.

Definition at line 280 of file FakeObjects.h.

◆ removeRow()

void TableWorkspaceTester::removeRow ( size_t  index)
inlineoverridevirtual

Delets a row if it exists.

Implements Mantid::API::ITableWorkspace.

Definition at line 306 of file FakeObjects.h.

◆ rowCount()

size_t TableWorkspaceTester::rowCount ( ) const
inlineoverridevirtual

Number of rows in the workspace.

Implements Mantid::API::ITableWorkspace.

Definition at line 300 of file FakeObjects.h.

◆ setRowCount()

void TableWorkspaceTester::setRowCount ( size_t  count)
inlineoverridevirtual

Resizes the workspace.

Implements Mantid::API::ITableWorkspace.

Definition at line 302 of file FakeObjects.h.


The documentation for this class was generated from the following file: