Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef MANTID_DATAOBJECTS_ICOLUMN_H_
#define MANTID_DATAOBJECTS_ICOLUMN_H_
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include "MantidKernel/System.h"
#include <string>
#include <typeinfo>
namespace Mantid
{
//----------------------------------------------------------------------
// Forward declarations
//----------------------------------------------------------------------
namespace DataObjects
{
class TableWorkspace;
}
namespace DataObjects
{
/** \class IColumn
IColumn is the base class for columns of TableWorkspace.
\author Roman Tolchenov
\date 31/10/2008
Copyright © 2007-8 STFC Rutherford Appleton Laboratory
This file is part of Mantid.
Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://svn.mantidproject.org/mantid/trunk/Code/Mantid>.
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class DLLExport Column
{
public:
/// Virtual destructor
virtual ~Column() {}
/// Name (caption) of the column.
Roman Tolchenov
committed
const std::string& name()const{return m_name;}
Roman Tolchenov
committed
const std::string& type()const{return m_type;}
/// Renames the column.
void setName(const std::string& str){m_name = str;}
/// Number of individual elements in the column.
Roman Tolchenov
committed
virtual int size()const = 0;
virtual const std::type_info& get_type_info()const = 0;
virtual const std::type_info& get_pointer_type_info()const = 0;
virtual void print(std::ostream& s, int index) const = 0;
protected:
/// Sets the new column size.
virtual void resize(int count) = 0;
/// Inserts an item.
virtual void insert(int index) = 0;
/// Removes an item.
virtual void remove(int index) = 0;
/// Pointer to a data element
virtual void* void_pointer(int index) = 0;
private:
std::string m_name;///< name
std::string m_type;///< type
friend class ColumnFactoryImpl;
friend class TableWorkspace;
};
} // namespace DataObjects
} // Namespace Mantid
#endif /*MANTID_DATAOBJECTS_ICOLUMN_H_*/