Mantid
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
Mantid::DataObjects::TableWorkspace Class Reference

TableWorkspace is an implementation of Workspace in which the data are organised in columns of same size. More...

#include <TableWorkspace.h>

Inheritance diagram for Mantid::DataObjects::TableWorkspace:
Mantid::API::ITableWorkspace Mantid::API::Workspace Mantid::Kernel::DataItem Mantid::DataObjects::MementoTableWorkspace Mantid::DataObjects::SplittersWorkspace

Classes

class  FindName
 Used in std::find_if algorithm to find a Column with name name. More...
 

Public Member Functions

API::Column_sptr addColumn (const std::string &type, const std::string &name) override
 Creates a new column. More...
 
template<class U >
cell_cast (size_t nRow, const std::string &col_name) const
 
template<class U >
cell_cast (size_t nRow, size_t nCol) const
 Casts cells through converting their values to/from double without type checking; Can produce stuped results in case if the type is in any way not related to double. More...
 
std::unique_ptr< TableWorkspaceclone () const
 Returns a clone of the workspace. More...
 
std::unique_ptr< TableWorkspacecloneEmpty () const
 Returns a default-initialized clone of the workspace. More...
 
size_t columnCount () const override
 Number of columns in the workspace. More...
 
void find (API::Boolean value, size_t &row, size_t col) override
 This method finds the row and column index of an API::Bollean value in a table workspace. More...
 
void find (const Mantid::Kernel::V3D &value, size_t &row, size_t col) override
 This method finds the row and column index of an Mantid::Kernel::V3D cell value in a table workspace. More...
 
void find (const std::string &value, size_t &row, size_t col) override
 This method finds the row and column index of an string cell value in a table workspace. More...
 
void find (double value, size_t &row, size_t col) override
 This method finds the row and column index of an double cell value in a table workspace. More...
 
void find (float value, size_t &row, size_t col) override
 This method finds the row and column index of an float value in a table workspace. More...
 
void find (size_t value, size_t &row, size_t col) override
 This method finds the row and column index of an integer cell value in a table workspace. More...
 
template<class T >
T * getColDataArray (const std::string &name)
 Non-throwing access to the pointer to the column data array for the column with given name. More...
 
template<class T >
T * getColDataArray (const std::string &name) const
 Non-throwing const access to the pointer to the column data array for the column with given name. More...
 
API::Column_const_sptr getColumn (const std::string &name) const override
 Gets the shared pointer to a column. More...
 
API::Column_sptr getColumn (const std::string &name) override
 Gets the shared pointer to a column. More...
 
API::Column_const_sptr getColumn (size_t index) const override
 Gets the shared pointer to a column by index - return none-modifyable column. More...
 
API::Column_sptr getColumn (size_t index) override
 Gets the shared pointer to a column. More...
 
std::vector< std::string > getColumnNames () const override
 Returns a vector of all column names. More...
 
template<class T >
std::vector< T > & getColVector (const std::string &name)
 get access to the column vector for column with given name . More...
 
template<class T >
const std::vector< T > & getColVector (const std::string &name) const
 get access to column vector for column with given name
More...
 
template<class T >
std::vector< T > & getColVector (size_t index)
 get access to column vector for index i. More...
 
template<class T >
const std::vector< T > & getColVector (size_t index) const
 get constant access to column vector for index i. More...
 
API::LogManager_const_sptr getLogs () const override
 Get constant access to shared pointer containing workspace porperties. More...
 
size_t getMemorySize () const override
 Get the footprint in memory in KB. More...
 
const std::string id () const override
 Return the workspace typeID. More...
 
size_t insertRow (size_t index) override
 Inserts a row before row pointed to by index and fills it with default vales. More...
 
API::LogManager_sptr logs () override
 Get access to shared pointer containing workspace porperties. More...
 
TableWorkspaceoperator= (const TableWorkspace &other)=delete
 
void removeColumn (const std::string &name) override
 Removes a column. More...
 
void removeRow (size_t index) override
 Delets a row if it exists. More...
 
size_t rowCount () const override
 Number of rows in the workspace. More...
 
void setRowCount (size_t count) override
 Resizes the workspace. More...
 
void sort (std::vector< std::pair< std::string, bool > > &criteria) override
 Sort this table. More...
 
 TableWorkspace (size_t nrows=0)
 Constructor. 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 ()
 

Protected Member Functions

 TableWorkspace (const TableWorkspace &other)
 Protected copy constructor. May be used by childs for cloning. More...
 
- 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...
 

Private Types

using column_const_it = std::vector< std::shared_ptr< API::Column > >::const_iterator
 
using column_it = std::vector< std::shared_ptr< API::Column > >::iterator
 Column const iterator. More...
 

Private Member Functions

void addColumn (const std::shared_ptr< API::Column > &column)
 
TableWorkspacedoClone () const override
 Virtual clone method. Not implemented to force implementation in children. More...
 
TableWorkspacedoCloneColumns (const std::vector< std::string > &colNames) const override
 Clone the workspace keeping only selected columns. More...
 
TableWorkspacedoCloneEmpty () const override
 Virtual cloneEmpty method. More...
 
template<typename Type >
void findValue (const Type value, size_t &row, size_t colIndex)
 template method to find a given value in a table. More...
 

Private Attributes

std::vector< std::shared_ptr< API::Column > > m_columns
 Shared pointers to the columns. More...
 
API::LogManager_sptr m_LogManager
 shared pointer to the logManager, responsible for the workspace properties. More...
 
size_t m_rowCount
 row count More...
 

Detailed Description

TableWorkspace is an implementation of Workspace in which the data are organised in columns of same size.

Elements of a column have the same data type. Columns can be added to the TableWorkspace with ctreateColumn(type,name). name is a name given to the column. type is a symbolic name for the data type of the column. Predefined types are:

User defined types can be used after declaring them with DECLARE_TABLECOLUMN macro: DECLARE_TABLECOLUMN(typeName, UserDefinedType)

Ways to access the data:

Author
Roman Tolchenov
Date
31/10/2008

Definition at line 66 of file TableWorkspace.h.

Member Typedef Documentation

◆ column_const_it

using Mantid::DataObjects::TableWorkspace::column_const_it = std::vector<std::shared_ptr<API::Column> >::const_iterator
private

Definition at line 317 of file TableWorkspace.h.

◆ column_it

using Mantid::DataObjects::TableWorkspace::column_it = std::vector<std::shared_ptr<API::Column> >::iterator
private

Column const iterator.

Definition at line 313 of file TableWorkspace.h.

Constructor & Destructor Documentation

◆ TableWorkspace() [1/2]

Mantid::DataObjects::TableWorkspace::TableWorkspace ( size_t  nrows = 0)

Constructor.

Definition at line 31 of file TableWorkspace.cpp.

References nrows.

◆ TableWorkspace() [2/2]

Mantid::DataObjects::TableWorkspace::TableWorkspace ( const TableWorkspace other)
protected

Protected copy constructor. May be used by childs for cloning.

Definition at line 35 of file TableWorkspace.cpp.

References addColumn(), m_LogManager, and setRowCount().

Member Function Documentation

◆ addColumn() [1/2]

void Mantid::DataObjects::TableWorkspace::addColumn ( const std::shared_ptr< API::Column > &  column)
private

Definition at line 187 of file TableWorkspace.cpp.

References m_columns, and Mantid::API::ITableWorkspace::modified().

◆ addColumn() [2/2]

API::Column_sptr Mantid::DataObjects::TableWorkspace::addColumn ( const std::string &  type,
const std::string &  name 
)
overridevirtual

◆ cell_cast() [1/2]

template<class U >
U Mantid::DataObjects::TableWorkspace::cell_cast ( size_t  nRow,
const std::string &  col_name 
) const
inline

Definition at line 256 of file TableWorkspace.h.

◆ cell_cast() [2/2]

template<class U >
U Mantid::DataObjects::TableWorkspace::cell_cast ( size_t  nRow,
size_t  nCol 
) const
inline

Casts cells through converting their values to/from double without type checking; Can produce stuped results in case if the type is in any way not related to double.

Definition at line 252 of file TableWorkspace.h.

◆ clone()

std::unique_ptr< TableWorkspace > Mantid::DataObjects::TableWorkspace::clone ( ) const
inline

Returns a clone of the workspace.

Definition at line 74 of file TableWorkspace.h.

◆ cloneEmpty()

std::unique_ptr< TableWorkspace > Mantid::DataObjects::TableWorkspace::cloneEmpty ( ) const
inline

Returns a default-initialized clone of the workspace.

Definition at line 77 of file TableWorkspace.h.

◆ columnCount()

size_t Mantid::DataObjects::TableWorkspace::columnCount ( ) const
inlineoverridevirtual

Number of columns in the workspace.

Implements Mantid::API::ITableWorkspace.

Definition at line 88 of file TableWorkspace.h.

Referenced by getColumn(), Mantid::DataObjects::MementoTableWorkspace::isMementoWorkspace(), and sort().

◆ doClone()

TableWorkspace * Mantid::DataObjects::TableWorkspace::doClone ( ) const
inlineoverrideprivatevirtual

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

Reimplemented from Mantid::API::ITableWorkspace.

Definition at line 269 of file TableWorkspace.h.

◆ doCloneColumns()

TableWorkspace * Mantid::DataObjects::TableWorkspace::doCloneColumns ( const std::vector< std::string > &  colNames) const
overrideprivatevirtual

Clone the workspace keeping only selected columns.

Parameters
colNames:: Names of columns to clone.

Implements Mantid::API::ITableWorkspace.

Definition at line 274 of file TableWorkspace.cpp.

References m_columns, m_LogManager, and rowCount().

◆ doCloneEmpty()

TableWorkspace * Mantid::DataObjects::TableWorkspace::doCloneEmpty ( ) const
inlineoverrideprivatevirtual

Virtual cloneEmpty method.

Not implemented to force implementation in children.

Implements Mantid::API::ITableWorkspace.

Definition at line 271 of file TableWorkspace.h.

◆ find() [1/6]

void Mantid::DataObjects::TableWorkspace::find ( API::Boolean  value,
size_t &  row,
size_t  col 
)
inlineoverridevirtual

This method finds the row and column index of an API::Bollean value in a table workspace.

Parameters
value:: -value to search
rowrow number of the value searched
colcolumn number of the value searched

Implements Mantid::API::ITableWorkspace.

Definition at line 233 of file TableWorkspace.h.

References value.

◆ find() [2/6]

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

This method finds the row and column index of an Mantid::Kernel::V3D cell value in a table workspace.

Parameters
value:: -value to search
rowrow number of the value searched
colcolumn number of the value searched

Implements Mantid::API::ITableWorkspace.

Definition at line 247 of file TableWorkspace.h.

References value.

◆ find() [3/6]

void Mantid::DataObjects::TableWorkspace::find ( const std::string &  value,
size_t &  row,
size_t  col 
)
inlineoverridevirtual

This method finds the row and column index of an string cell value in a table workspace.

Parameters
value:: -value to search
rowrow number of the value searched
colcolumn number of the value searched

Implements Mantid::API::ITableWorkspace.

Definition at line 219 of file TableWorkspace.h.

References value.

◆ find() [4/6]

void Mantid::DataObjects::TableWorkspace::find ( double  value,
size_t &  row,
size_t  col 
)
inlineoverridevirtual

This method finds the row and column index of an double cell value in a table workspace.

Parameters
value:: -value to search
rowrow number of the value searched
colcolumn number of the value searched

Implements Mantid::API::ITableWorkspace.

Definition at line 240 of file TableWorkspace.h.

References value.

◆ find() [5/6]

void Mantid::DataObjects::TableWorkspace::find ( float  value,
size_t &  row,
size_t  col 
)
inlineoverridevirtual

This method finds the row and column index of an float value in a table workspace.

Parameters
value:: -value to search
rowrow number of the value searched
colcolumn number of the value searched

Implements Mantid::API::ITableWorkspace.

Definition at line 226 of file TableWorkspace.h.

References value.

◆ find() [6/6]

void Mantid::DataObjects::TableWorkspace::find ( size_t  value,
size_t &  row,
size_t  col 
)
inlineoverridevirtual

This method finds the row and column index of an integer cell value in a table workspace.

Parameters
value:: -value to search
rowrow number of the value searched
colcolumn number of the value searched

Implements Mantid::API::ITableWorkspace.

Definition at line 212 of file TableWorkspace.h.

References value.

◆ findValue()

template<typename Type >
void Mantid::DataObjects::TableWorkspace::findValue ( const Type  value,
size_t &  row,
size_t  colIndex 
)
inlineprivate

template method to find a given value in a table.

Definition at line 276 of file TableWorkspace.h.

References value.

◆ getColDataArray() [1/2]

template<class T >
T * Mantid::DataObjects::TableWorkspace::getColDataArray ( const std::string &  name)
inline

Non-throwing access to the pointer to the column data array for the column with given name.

Returns null on error or if the coulmn has not been found No checks if one tries to use pointer to work out of the array limits are performed; The pointer has to be received right before usage as underlying vectoor changes within the table workspace immidiately make this pointer invalid. Nasty method. Use only if no choice.

Definition at line 170 of file TableWorkspace.h.

References Mantid::DataObjects::TableColumn< Type >::dataArray().

◆ getColDataArray() [2/2]

template<class T >
T * Mantid::DataObjects::TableWorkspace::getColDataArray ( const std::string &  name) const
inline

Non-throwing const access to the pointer to the column data array for the column with given name.

Returns null on error or if the coulmn has not been found No checks if one tries to use pointer to work out of the array limits are performed; The pointer has to be received right before usage as underlying vectoor changes within the table workspace immidiately make this pointer invalid. Nasty method. Use only if no choice.

Definition at line 187 of file TableWorkspace.h.

References Mantid::DataObjects::TableColumn< Type >::dataArray().

◆ getColumn() [1/4]

API::Column_const_sptr Mantid::DataObjects::TableWorkspace::getColumn ( const std::string &  name) const
overridevirtual

Gets the shared pointer to a column.

Implements Mantid::API::ITableWorkspace.

Definition at line 112 of file TableWorkspace.cpp.

References m_columns.

◆ getColumn() [2/4]

API::Column_sptr Mantid::DataObjects::TableWorkspace::getColumn ( const std::string &  name)
overridevirtual

Gets the shared pointer to a column.

Implements Mantid::API::ITableWorkspace.

Definition at line 103 of file TableWorkspace.cpp.

References m_columns.

Referenced by Mantid::DataObjects::MementoTableWorkspace::isMementoWorkspace(), and sort().

◆ getColumn() [3/4]

API::Column_const_sptr Mantid::DataObjects::TableWorkspace::getColumn ( size_t  index) const
overridevirtual

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

Gets the shared pointer to a column.

Implements Mantid::API::ITableWorkspace.

Definition at line 132 of file TableWorkspace.cpp.

References columnCount(), index, and m_columns.

◆ getColumn() [4/4]

API::Column_sptr Mantid::DataObjects::TableWorkspace::getColumn ( size_t  index)
overridevirtual

Gets the shared pointer to a column.

Implements Mantid::API::ITableWorkspace.

Definition at line 122 of file TableWorkspace.cpp.

References columnCount(), index, and m_columns.

◆ getColumnNames()

std::vector< std::string > Mantid::DataObjects::TableWorkspace::getColumnNames ( ) const
overridevirtual

Returns a vector of all column names.

Implements Mantid::API::ITableWorkspace.

Definition at line 179 of file TableWorkspace.cpp.

References m_columns.

◆ getColVector() [1/4]

template<class T >
std::vector< T > & Mantid::DataObjects::TableWorkspace::getColVector ( const std::string &  name)
inline

get access to the column vector for column with given name .

The operation is unsafe with regards to the operations resizing obtained vector. This will destroy all table ws internal coherency. DO NOT ABUSE! e.g.: resise/reserve are unsafe Writing/reading data to vector through [] or at() is safe.

Definition at line 139 of file TableWorkspace.h.

References Mantid::DataObjects::TableColumn< Type >::data().

◆ getColVector() [2/4]

template<class T >
const std::vector< T > & Mantid::DataObjects::TableWorkspace::getColVector ( const std::string &  name) const
inline

get access to column vector for column with given name

Definition at line 152 of file TableWorkspace.h.

References Mantid::DataObjects::TableColumn< Type >::data().

◆ getColVector() [3/4]

template<class T >
std::vector< T > & Mantid::DataObjects::TableWorkspace::getColVector ( size_t  index)
inline

get access to column vector for index i.

The operation is unsafe with regards to the operations resizing obtained vector. This will destroy all table ws internal coherency. DO NOT ABUSE! e.g.: resise/reserve are unsafe Writing/reading data to vector through [] or at() is safe.

Definition at line 113 of file TableWorkspace.h.

References Mantid::DataObjects::TableColumn< Type >::data(), and index.

Referenced by Mantid::Algorithms::SofQWNormalisedPolygon::initAngularCachesTable().

◆ getColVector() [4/4]

template<class T >
const std::vector< T > & Mantid::DataObjects::TableWorkspace::getColVector ( size_t  index) const
inline

get constant access to column vector for index i.

Definition at line 123 of file TableWorkspace.h.

References Mantid::DataObjects::TableColumn< Type >::data(), and index.

◆ getLogs()

API::LogManager_const_sptr Mantid::DataObjects::TableWorkspace::getLogs ( ) const
inlineoverridevirtual

Get constant access to shared pointer containing workspace porperties.

Implements Mantid::API::ITableWorkspace.

Definition at line 104 of file TableWorkspace.h.

◆ getMemorySize()

size_t Mantid::DataObjects::TableWorkspace::getMemorySize ( ) const
overridevirtual

Get the footprint in memory in KB.

Implements Mantid::API::Workspace.

Definition at line 48 of file TableWorkspace.cpp.

References m_columns, and m_LogManager.

◆ id()

const std::string Mantid::DataObjects::TableWorkspace::id ( ) const
inlineoverridevirtual

Return the workspace typeID.

Reimplemented from Mantid::API::ITableWorkspace.

Definition at line 80 of file TableWorkspace.h.

◆ insertRow()

size_t Mantid::DataObjects::TableWorkspace::insertRow ( size_t  index)
overridevirtual

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

Parameters
index:: Points where to insert the new row.
Returns
Position of the inserted row.

Implements Mantid::API::ITableWorkspace.

Definition at line 155 of file TableWorkspace.cpp.

References index, Mantid::API::ITableWorkspace::insertInColumn(), m_columns, m_rowCount, Mantid::API::ITableWorkspace::modified(), and rowCount().

◆ logs()

API::LogManager_sptr Mantid::DataObjects::TableWorkspace::logs ( )
inlineoverridevirtual

Get access to shared pointer containing workspace porperties.

Implements Mantid::API::ITableWorkspace.

Definition at line 102 of file TableWorkspace.h.

◆ operator=()

TableWorkspace & Mantid::DataObjects::TableWorkspace::operator= ( const TableWorkspace other)
delete

◆ removeColumn()

void Mantid::DataObjects::TableWorkspace::removeColumn ( const std::string &  name)
overridevirtual

◆ removeRow()

void Mantid::DataObjects::TableWorkspace::removeRow ( size_t  index)
overridevirtual

◆ rowCount()

size_t Mantid::DataObjects::TableWorkspace::rowCount ( ) const
inlineoverridevirtual

◆ setRowCount()

void Mantid::DataObjects::TableWorkspace::setRowCount ( size_t  count)
overridevirtual

Resizes the workspace.

If count is greater than the current number of rows extra rows are added to the bottom of the table.

Otherwise rows at the end are erased to reach the new size.

Parameters
count:: New number of rows.

Implements Mantid::API::ITableWorkspace.

Definition at line 94 of file TableWorkspace.cpp.

References count, m_columns, m_rowCount, Mantid::API::ITableWorkspace::resizeColumn(), and rowCount().

Referenced by TableWorkspace().

◆ sort()

void Mantid::DataObjects::TableWorkspace::sort ( std::vector< std::pair< std::string, bool > > &  criteria)
overridevirtual

Sort this table.

Sort.

See also
ITableWorkspace::sort
Parameters
criteria: a vector with a list of pairs: column name, bool; where bool = true for ascending, false for descending sort.

Reimplemented from Mantid::API::ITableWorkspace.

Definition at line 204 of file TableWorkspace.cpp.

References columnCount(), getColumn(), keyIndex, Mantid::API::ITableWorkspace::modified(), and rowCount().

Member Data Documentation

◆ m_columns

std::vector<std::shared_ptr<API::Column> > Mantid::DataObjects::TableWorkspace::m_columns
private

Shared pointers to the columns.

Definition at line 320 of file TableWorkspace.h.

Referenced by addColumn(), doCloneColumns(), getColumn(), getColumnNames(), getMemorySize(), insertRow(), removeColumn(), removeRow(), and setRowCount().

◆ m_LogManager

API::LogManager_sptr Mantid::DataObjects::TableWorkspace::m_LogManager
private

shared pointer to the logManager, responsible for the workspace properties.

Definition at line 326 of file TableWorkspace.h.

Referenced by doCloneColumns(), getMemorySize(), and TableWorkspace().

◆ m_rowCount

size_t Mantid::DataObjects::TableWorkspace::m_rowCount
private

row count

Definition at line 322 of file TableWorkspace.h.

Referenced by insertRow(), removeRow(), and setRowCount().


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