table_units Class Reference

Data table class with units. More...

#include <table_units.h>

Inheritance diagram for table_units:

table

Detailed Description

Idea for future:
Make table methods virtual? (not necessary yet since delete_column() isn't referred to internally)

Definition at line 39 of file table_units.h.


Public Member Functions

 table_units (int cmaxlines=0)
 Create a new table_units with space for nlines<=cmaxlines.
std::string get_unit (std::string scol) const
 Get the unit for column scol.
int remove_unit (std::string scol)
 Remove the unit for column scol.
int set_unit (std::string scol, std::string unit)
 Set the unit for column scol to unit.
int convert_to_unit (std::string scol, std::string unit, bool err_on_fail=true)
 Convert the units of column scol to unit.
double get_conv (std::string old_unit, std::string new_unit)
 Get the conversion factor from old_unit to new_unit.
virtual int delete_column (std::string scol)
 Delete column named scol.
virtual const char * type ()
 Return the type, "table_units".
virtual int summary (std::ostream *out, int ncol=79) const
 Output a summary of the information stored.
int set_convert (convert_units &c)
 Set the convert units object.
int show_units ()
 Show the units.
Copy constructors
 table_units (const table_units &t)
 table_units (const table &t)
table_unitsoperator= (const table_units &t)
table_unitsoperator= (const table &t)
 Copy constructor.

Data Fields

convert_units def_cu
 The default object for unit conversions.

Protected Types

Unit map iterator types
typedef std::map< std::string,
std::string, string_comp >
::iterator 
uiter
typedef std::map< std::string,
std::string, string_comp >
::const_iterator 
uciter

Protected Attributes

convert_unitscup
 The pointer to the convert units object.
std::map< std::string,
std::string, string_comp
utree
 Unit map.

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

Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.

Project hosting provided by SourceForge.net Logo, O2scl Sourceforge Project Page