#include <STK_IVariable.h>
Inherited by STK::Variable< TYPE >, and STK::Variable< String >.
Public Types | |
| typedef Variable< String > | _VarStringType |
Public Member Functions | |
| virtual | ~IVariable () |
| IVariable & | operator= (const IVariable &V) |
| const IdType & | getType () const |
| const String & | getName () const |
| void | setName (const Integer &num=0, const String &prefix=STRING_VAR) |
| void | setName (const String &name) |
| virtual Integer | size () const =0 |
| Number of elements. | |
| virtual Integer | first () const =0 |
| Index of the first element. | |
| virtual Integer | last () const =0 |
| Index of the last element. | |
| virtual void | shift (const Integer &beg=1)=0 |
| virtual void | pushBackElts (const Integer &n=1)=0 |
| virtual void | insertElts (const Integer &pos, const Integer &n=1)=0 |
| virtual void | popBackElts (const Integer &n=1)=0 |
| virtual void | eraseElts (const Integer &pos, const Integer &n=1)=0 |
| virtual void | resize (const Inx &I=Inx())=0 |
| virtual void | erase (const Integer &pos)=0 |
| virtual void | erase (const Inx &I)=0 |
| virtual void | pop_back ()=0 |
| virtual void | pop_front ()=0 |
| virtual void | setNA (const Integer &pos, const Integer &n=1)=0 |
| virtual void | pushBackNA (const Integer &n=1)=0 |
| virtual void | insertNA (const Integer &pos, const Integer &n=1)=0 |
| virtual IVariable & | importString (Integer &nsuccess, const _VarStringType &V, std::ios_base &(*f)(std::ios_base &)=std::dec)=0 |
| virtual const IVariable & | exportString (_VarStringType &V, std::ios_base &(*f)(std::ios_base &)=std::dec) const =0 |
| virtual IVariable & | operator<< (const _VarStringType &V)=0 |
| virtual const IVariable & | operator>> (_VarStringType &V) const =0 |
| virtual IVariable * | clone (const bool &ref=false) const =0 |
Static Public Member Functions | |
| static String | giveName (const Integer &num=0, const String &prefix=STRING_VAR) |
Protected Member Functions | |
| IVariable (const IdType &type, const String &name) | |
| IVariable (const IVariable &V) | |
Protected Attributes | |
| const IdType | type_ |
| String | name_ |
Definition at line 63 of file STK_IVariable.h.
| typedef Variable<String> STK::IVariable::_VarStringType |
type Variable of String (used for exporting the variable).
Definition at line 89 of file STK_IVariable.h.
| STK::IVariable::IVariable | ( | const IVariable & | V | ) | [inline, protected] |
| virtual STK::IVariable::~IVariable | ( | ) | [inline, virtual] |
Operator = : overwrite the IVariable with T.
Definition at line 97 of file STK_IVariable.h.
References name_.
00098 { 00099 name_ = V.name_; // copy name_ of the variable 00100 return *this; 00101 }
| static String STK::IVariable::giveName | ( | const Integer & | num = 0, |
|
| const String & | prefix = STRING_VAR | |||
| ) | [inline, static] |
Return a default name for variable of the form : prefix + num.
Definition at line 107 of file STK_IVariable.h.
| const IdType& STK::IVariable::getType | ( | ) | const [inline] |
Get the type of the variable.
Definition at line 115 of file STK_IVariable.h.
References type_.
00116 { return type_;}
| const String& STK::IVariable::getName | ( | ) | const [inline] |
Get the name of the variable.
Definition at line 119 of file STK_IVariable.h.
References name_.
Referenced by STK::Variable< String >::exportString(), STK::ReadWriteCsv::getColName(), STK::Variable< String >::importString(), STK::Variable< String >::operator<<(), STK::Variable< String >::operator>>(), and STK::ReadWriteCsv::writeSelection().
00120 { return name_;}
| void STK::IVariable::setName | ( | const Integer & | num = 0, |
|
| const String & | prefix = STRING_VAR | |||
| ) | [inline] |
Set a default name for variable of the form : prefix + num.
Definition at line 125 of file STK_IVariable.h.
References name_.
Referenced by STK::Variable< String >::exportString(), STK::Variable< String >::importString(), STK::Variable< String >::operator<<(), and STK::Variable< String >::operator>>().
00128 { name_ = (prefix+typeToString<Integer> (num));}
| void STK::IVariable::setName | ( | const String & | name | ) | [inline] |
Set the name of the variable.
Definition at line 131 of file STK_IVariable.h.
References name_.
00132 { name_ = name;}
| virtual Integer STK::IVariable::size | ( | ) | const [pure virtual] |
New first index for the object.
| beg | the index of the first column to set |
Implemented in STK::Variable< TYPE >, and STK::Variable< String >.
Referenced by STK::DataFrame::insertVariable(), and STK::DataFrame::pushBackVariable().
| virtual Integer STK::IVariable::first | ( | ) | const [pure virtual] |
Implemented in STK::Variable< TYPE >, and STK::Variable< String >.
| virtual Integer STK::IVariable::last | ( | ) | const [pure virtual] |
Implemented in STK::Variable< TYPE >, and STK::Variable< String >.
| virtual void STK::IVariable::shift | ( | const Integer & | beg = 1 |
) | [pure virtual] |
New first index for the object.
| beg | the index of the first column to set |
Implemented in STK::Variable< TYPE >, and STK::Variable< String >.
Referenced by STK::DataFrame::insertDataFrame(), STK::DataFrame::insertVariable(), STK::DataFrame::pushBackDataFrame(), STK::DataFrame::pushBackVariable(), and STK::DataFrame::shift().
| virtual void STK::IVariable::pushBackElts | ( | const Integer & | n = 1 |
) | [pure virtual] |
Add n Elts to the container.
| n | number of elements to add |
Implemented in STK::Variable< TYPE >, and STK::Variable< String >.
Referenced by STK::DataFrame::pushBackRows().
| virtual void STK::IVariable::insertElts | ( | const Integer & | pos, | |
| const Integer & | n = 1 | |||
| ) | [pure virtual] |
Insert n elts at the position pos of the container.
| pos | index where to insert elements | |
| n | number of elements to insert (default 1) |
Implemented in STK::Variable< TYPE >, and STK::Variable< String >.
Referenced by STK::DataFrame::insertRows().
| virtual void STK::IVariable::popBackElts | ( | const Integer & | n = 1 |
) | [pure virtual] |
Delete last elts of the container.
| n | number of elts to delete |
Implemented in STK::Variable< TYPE >, and STK::Variable< String >.
Referenced by STK::DataFrame::popBackRows().
| virtual void STK::IVariable::eraseElts | ( | const Integer & | pos, | |
| const Integer & | n = 1 | |||
| ) | [pure virtual] |
Delete n elts at the pos index to the container.
| pos | index where to delete elements | |
| n | number of elements to delete (default 1) |
Implemented in STK::Variable< TYPE >, and STK::Variable< String >.
Referenced by STK::DataFrame::eraseRows().
STL compatibility. Resize the container.
shift(I) pushBackElts if there is more elementspopBackElts if three is less elements. | I | the new size of the container |
Implemented in STK::Variable< TYPE >, and STK::Variable< String >.
| virtual void STK::IVariable::erase | ( | const Integer & | pos | ) | [pure virtual] |
STL compatibility. Delete one element at the position pos to the container.
| pos | position of the element to erase |
Implemented in STK::Variable< TYPE >, and STK::Variable< String >.
| virtual void STK::IVariable::erase | ( | const Inx & | I | ) | [pure virtual] |
STL compatibility. Delete the elements of the range [beg,end) to the container.
| I | the range of the elements to delete |
Implemented in STK::Variable< TYPE >, and STK::Variable< String >.
| virtual void STK::IVariable::pop_back | ( | ) | [pure virtual] |
STL compatibility. Pop last element.
Implemented in STK::Variable< TYPE >, and STK::Variable< String >.
| virtual void STK::IVariable::pop_front | ( | ) | [pure virtual] |
STL compatibility. Pop first element.
Implemented in STK::Variable< TYPE >, and STK::Variable< String >.
Put NA values in the range [pos, pos+n).
| pos | index where to set NA values | |
| n | number of elements to set |
Implemented in STK::Variable< TYPE >, and STK::Variable< String >.
| virtual void STK::IVariable::pushBackNA | ( | const Integer & | 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().
insert n NA values at pos.
| pos | index where to set NA values | |
| n | number of elements to insert |
Implemented in STK::Variable< TYPE >, and STK::Variable< String >.
| virtual IVariable& STK::IVariable::importString | ( | Integer & | nsuccess, | |
| const _VarStringType & | V, | |||
| std::ios_base &(*)(std::ios_base &) | f = std::dec | |||
| ) | [pure virtual] |
| 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 | ( | const 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 70 of file STK_IVariable.h.
Referenced by getName(), operator=(), and setName().
1.5.8