|
STK++ 1.0
|
IVariable is an Interface class for all Variables classes. More...
#include <STK_IVariable.h>

Public Types | |
| typedef Variable< String > | _VarStringType |
| type Variable of String (used for exporting the variable). | |
Public Member Functions | |
| virtual | ~IVariable () |
| destructor. | |
| IVariable & | operator= (const IVariable &V) |
| Operator = : overwrite the IVariable with T. | |
| const IdType & | getType () const |
| Get the type of the variable. | |
| String const & | name () const |
| Get the name of the variable. | |
| void | setName (Integer const &num=0, const String &prefix=STRING_VAR) |
| Set a default name for variable of the form : prefix + num. | |
| void | setName (String const &name) |
| Set the name of the variable. | |
| virtual void | pushBackNAValues (Integer const &n=1)=0 |
| push back n NA values. | |
| virtual Integer | importString (const _VarStringType &V, std::ios_base &(*f)(std::ios_base &)=std::dec)=0 |
| overwrite the IVariable by converting the strings contained in V into the Type. | |
| virtual const IVariable & | exportString (_VarStringType &V, std::ios_base &(*f)(std::ios_base &)=std::dec) const =0 |
| Overwrite the variable V by converting the data into strings. | |
| virtual IVariable & | operator<< (const _VarStringType &V)=0 |
| Operator << : overwrite the IVariable by converting the strings contained in V into the Type. | |
| virtual const IVariable & | operator>> (_VarStringType &V) const =0 |
| Operator >> : convert the Variable V into strings. | |
| virtual IVariable * | clone (bool ref=false) const =0 |
| clone return a ptr on a copy of the object. | |
Static Public Member Functions | |
| static String | giveName (Integer const &num=0, const String &prefix=STRING_VAR) |
| Return a default name for variable of the form : prefix + num. | |
Protected Member Functions | |
| IVariable (const IdType &type, String const &name) | |
| Default constructor. | |
| IVariable (const IVariable &V) | |
| Copy constructor. | |
Protected Attributes | |
| const IdType | type_ |
| Id Type of the variable. | |
| String | name_ |
| Name of the variable. | |
IVariable is an Interface class for all Variables classes.
A Variable have a name and a type, the implementation have to choose some one-dimensional container class derived from ITContainer1D for storing the data.
The pure virtual function defined in this class are the one needed by the DataFrame container.
Definition at line 61 of file STK_IVariable.h.
| typedef Variable<String> STK::IVariable::_VarStringType |
type Variable of String (used for exporting the variable).
Definition at line 85 of file STK_IVariable.h.
Default constructor.
Definition at line 72 of file STK_IVariable.h.
| STK::IVariable::IVariable | ( | const IVariable & | V | ) | [inline, protected] |
Copy constructor.
Definition at line 78 of file STK_IVariable.h.
| virtual STK::IVariable::~IVariable | ( | ) | [inline, virtual] |
Operator = : overwrite the IVariable with T.
Definition at line 91 of file STK_IVariable.h.
References name_.
{
name_ = V.name_; // copy name_ of the variable
return *this;
}
| static String STK::IVariable::giveName | ( | Integer const & | num = 0, |
| const String & | prefix = STRING_VAR |
||
| ) | [inline, static] |
Return a default name for variable of the form : prefix + num.
Definition at line 99 of file STK_IVariable.h.
Referenced by STK::operator>>().
{ return (prefix+typeToString<Integer> (num));}
| const IdType& STK::IVariable::getType | ( | ) | const [inline] |
Get the type of the variable.
Definition at line 105 of file STK_IVariable.h.
References type_.
Referenced by STK::ExportToArray2D< TYPE >::ExportToArray2D().
{ return type_;}
| String const& STK::IVariable::name | ( | ) | const [inline] |
Get the name of the variable.
Definition at line 109 of file STK_IVariable.h.
References name_.
Referenced by STK::Variable< String >::exportString(), STK::Variable< String >::importString(), STK::ReadWriteCsv::name(), STK::Variable< String >::operator<<(), STK::Variable< String >::operator>>(), setName(), and STK::ReadWriteCsv::writeSelection().
{ return name_;}
| void STK::IVariable::setName | ( | Integer const & | num = 0, |
| const String & | prefix = STRING_VAR |
||
| ) | [inline] |
Set a default name for variable of the form : prefix + num.
Definition at line 113 of file STK_IVariable.h.
References name_.
Referenced by STK::Variable< String >::exportString(), STK::Variable< String >::importString(), STK::Variable< String >::operator<<(), STK::Variable< String >::operator>>(), STK::operator>>(), and STK::ReadWriteCsv::setName().
{ name_ = (prefix+typeToString<Integer> (num));}
| void STK::IVariable::setName | ( | String const & | name | ) | [inline] |
| virtual void STK::IVariable::pushBackNAValues | ( | Integer const & | n = 1 | ) | [pure virtual] |
push back n NA values.
| n | number of NA values to add |
Implemented in STK::Variable< TYPE >, and STK::Variable< String >.
Referenced by STK::DataFrame::insertDataFrame(), STK::DataFrame::insertVariable(), STK::DataFrame::pushBackDataFrame(), and STK::DataFrame::pushBackVariable().
| virtual Integer STK::IVariable::importString | ( | const _VarStringType & | V, |
| std::ios_base &(*)(std::ios_base &) | f = std::dec |
||
| ) | [pure virtual] |
overwrite the IVariable by converting the strings contained in V into the Type.
Give the number of success.
| V | Variable of String |
| f | io flags |
Implemented in STK::Variable< TYPE >, and STK::Variable< String >.
| virtual const IVariable& STK::IVariable::exportString | ( | _VarStringType & | V, |
| std::ios_base &(*)(std::ios_base &) | f = std::dec |
||
| ) | const [pure virtual] |
Overwrite the variable V by converting the data into strings.
| V | Variable of String |
| f | io flags |
Referenced by STK::ExportToCsv::ExportToCsv().
| virtual IVariable& STK::IVariable::operator<< | ( | const _VarStringType & | V | ) | [pure virtual] |
| virtual const IVariable& STK::IVariable::operator>> | ( | _VarStringType & | V | ) | const [pure virtual] |
| virtual IVariable* STK::IVariable::clone | ( | bool | ref = false | ) | const [pure virtual] |
clone return a ptr on a copy of the object.
| ref | true if we don't want to copy the data |
Implemented in STK::Variable< TYPE >, and STK::Variable< String >.
Referenced by STK::DataFrame::insertDataFrame(), and STK::DataFrame::pushBackDataFrame().
const IdType STK::IVariable::type_ [protected] |
String STK::IVariable::name_ [protected] |
Name of the variable.
Definition at line 68 of file STK_IVariable.h.
Referenced by name(), operator=(), and setName().