34#ifndef DRAIN_VARIABLE_T
35#define DRAIN_VARIABLE_T
37#include <drain/Castable.h>
38#include <drain/UniTuple.h>
93 typedef std::pair<const char *,const drain::VariableT<T> > init_pair_t;
109 template <
class ...TT>
175 this->assignCastable(x);
187 this->assignCastable(x);
196 this->assignCastable(x);
197 std::cerr << __FILE__ <<
':' << __FUNCTION__ <<
": ? for inner class: "<<
TypeName<T>::str() << std::endl;
208 this->assignCastable(x);
225 this->assignContainer(l,
false);
242 template <
class T2,
size_t N>
245 this->assignContainer(unituple);
263 return Castable::operator==((
const Castable &) v);
269 return Castable::operator==(x);
274 return Castable::operator==(s);
279 bool operator!=(
const VariableT<T2> & v)
const{
280 return ! Castable::operator==((
const Castable &) v);
285 bool operator!=(
const T2 &x)
const {
286 return ! Castable::operator==(x);
290 bool operator!=(
const char *x)
const {
292 return ! Castable::operator==(x);
298 void info(std::ostream & ostr = std::cout)
const {
virtual void info(std::ostream &ostr=std::cout) const
Print value, type and element count.
Definition Castable.cpp:244
Tuple of N elements of type T.
Definition UniTuple.h:65
VariableT is a final class applied through typedefs Variable, Reference and FlexibleVariable.
Definition VariableT.h:87
VariableT(D &arg)
C++ bug? : Copy constructor will not catch.
Definition VariableT.h:134
VariableT & operator=(const T2 &x)
General assignment operator.
Definition VariableT.h:216
VariableT()
Default constructor.
Definition VariableT.h:97
VariableT & operator=(const VariableT< T2 > &x)
Assignment of objects of similar classes.
Definition VariableT.h:186
void info(std::ostream &ostr=std::cout) const
Redefine for "ambivalent" FlexibleVariable: indicate if local or ref.
Definition VariableT.h:298
virtual bool suggestType(const std::type_info &t)
Sets type, only if unset, and object is not a Reference.
Definition FlexibleVariable.cpp:50
VariableT & operator=(const T &x)
Assignment of base classes (VariableLike or Castable)
Definition VariableT.h:195
virtual bool requestType(const std::type_info &t)
Sets or changes the type if possible - that is, object is not a Reference.
Definition FlexibleVariable.cpp:38
VariableT & operator=(const char *x)
Assignment of C strings. [Obligatory].
Definition VariableT.h:236
bool operator==(const VariableT< T2 > &v) const
debugging
Definition VariableT.h:262
virtual bool requestSize(size_t elementCount)
Change the array size, if For Castable (and Reference) does nothing and returns false.
Definition FlexibleVariable.cpp:60
VariableT & operator=(const Castable &x)
Assignment of objects of the same class.
Definition VariableT.h:207
VariableT & operator=(std::initializer_list< T2 > l)
General assignment operator.
Definition VariableT.h:224
VariableT & operator=(const VariableT< T > &x)
Assignment of objects of the same class.
Definition VariableT.h:174
VariableT(const VariableT< T > &v)
Copy constructor.
Definition VariableT.h:101
VariableT(const TT &...args)
Single constructor template, forwarded to init(args...) defined in base classes.
Definition VariableT.h:111
static const std::string & str()
Default implementation: name returned by std::type_info::name()
Definition TypeName.h:68