29 #ifndef __casadbus_variant_h__
30 #define __casadbus_variant_h__
45 enum TYPE {
RECORD,
BOOL,
INT,
DOUBLE,
COMPLEX,
STRING,
BOOLVEC,
INTVEC,
DOUBLEVEC,
COMPLEXVEC,
STRINGVEC };
73 {
val.s =
new std::string(arg); }
75 {
val.s =
new std::string(arg); }
78 {
val.bv =
new std::vector<bool>(
arg); }
80 {
val.bv =
new std::vector<bool>(
arg); }
87 {
val.iv =
new std::vector<int>(
arg); }
89 {
val.iv =
new std::vector<int>(
arg); }
96 {
val.dv =
new std::vector<double>(
arg); }
98 {
val.dv =
new std::vector<double>(
arg); }
105 {
val.cv =
new std::vector<std::complex<double> >(
arg); }
107 {
val.cv =
new std::vector<std::complex<double> >(
arg); }
114 {
val.sv =
new std::vector<std::string>(
arg); }
116 {
val.sv =
new std::vector<std::string>(
arg); }
131 std::string
toString(
bool no_brackets=
false )
const;
135 std::vector<std::complex<double> >
toComplexVec( )
const;
158 bool getBool( )
const throw(error);
159 int getInt( ) const throw(error);
161 const std::complex<
double> &
getComplex( ) const throw(error);
162 const std::
string &
getString( ) const throw(error);
163 const std::vector<
int> &
getIntVec( ) const throw(error);
164 const std::vector<
bool> &
getBoolVec( ) const throw(error);
165 const std::vector<
double> &
getDoubleVec( ) const throw(error);
166 const std::vector<std::complex<
double> > &
getComplexVec( ) const throw(error);
167 const std::vector<std::
string> &
getStringVec( ) const throw(error);
169 const std::vector<
int> &
shape() const;
185 std::vector<
int> &
shape();
189 const char *
sig( )
const;
192 void push(
bool,
bool conform =
true);
193 void push(
int,
bool conform =
true);
194 void push(
double,
bool conform =
true);
195 void push(std::complex<double>,
bool conform =
true);
196 void push(
const std::string&,
bool conform =
true);
198 void place(
bool,
unsigned int index,
bool conform =
true);
199 void place(
int,
unsigned int index,
bool conform =
true);
200 void place(
double,
unsigned int index,
bool conform =
true);
201 void place(std::complex<double>,
unsigned int index,
bool conform =
true);
202 void place(
const std::string&,
unsigned int index,
bool conform =
true);
219 std::vector<bool> *
bv;
221 std::vector<int> *
iv;
223 std::vector<double> *
dv;
224 std::complex<double> *
c;
225 std::vector<std::complex<double> > *
cv;
227 std::vector<std::string> *
sv;
void place(bool, unsigned int index, bool conform=true)
std::vector< std::complex< double > > * cv
static unsigned int record_id_count
4294967295
std::complex< double > & getComplexMod()
LatticeExprNode arg(const LatticeExprNode &expr)
variant(std::vector< std::complex< double > > *arg)
bool getBool() const
Const
std::vector< std::complex< double > > & getComplexVecMod()
const std::vector< int > & getIntVec() const
variant(const std::vector< std::complex< double > > &arg, const std::vector< int > &theshape)
bool & getBoolMod()
Modify
void push(bool, bool conform=true)
std::vector< std::string > & getStringVecMod()
variant(const std::string &arg)
std::vector< bool > toBoolVec() const
std::vector< bool > & asBoolVec(int size=-1)
union casa::dbus::variant::@61 val
std::vector< int > & getIntVecMod()
const std::vector< int > & arrayshape() const
const std::vector< std::complex< double > > & getComplexVec() const
std::vector< double > & getDoubleVecMod()
variant(std::vector< int > *arg, std::vector< int > &theshape)
variant(const std::vector< std::complex< double > > &arg)
variant(const std::vector< double > &arg)
const std::vector< std::string > & getStringVec() const
variant(std::complex< double > arg)
variant(std::vector< std::complex< double > > *arg, std::vector< int > &theshape)
std::vector< bool > & getBoolVecMod()
todo: o create python to/from record functions o implement compare() o implement record_to_string() o...
const record & getRecord() const
std::vector< int > toIntVec() const
bool & asBool()
Yet to be implemented.
variant(const std::vector< double > &arg, const std::vector< int > &theshape)
int compare(const variant *) const
variant(const std::vector< int > &arg)
std::vector< int > & asIntVec(int size=-1)
void as(TYPE t, int size=-1)
const std::string & typeString() const
overflow(std::string lbl)
variant(const std::vector< int > &arg, const std::vector< int > &theshape)
variant(std::vector< std::string > *arg, std::vector< int > &theshape)
variant(const std::vector< std::string > &arg)
std::vector< double > * dv
std::vector< std::string > toStringVec() const
const std::complex< double > & getComplex() const
const std::vector< int > & shape() const
std::complex< double > toComplex() const
std::string toString(bool no_brackets=false) const
std::vector< std::complex< double > > & asComplexVec(int size=-1)
variant(std::vector< std::string > *arg)
static TYPE compatible_type(TYPE one, TYPE two)
std::complex< double > & asComplex()
const std::vector< double > & getDoubleVec() const
std::vector< int > shape_
const std::string & message() const
std::vector< double > toDoubleVec() const
variant(std::vector< double > *arg, std::vector< int > &theshape)
variant(std::vector< double > *arg)
std::vector< std::string > & asStringVec(int size=-1)
variant(std::vector< bool > *arg, std::vector< int > &theshape)
std::vector< std::string > * sv
std::string & getStringMod()
std::vector< std::complex< double > > toComplexVec() const
std::string create_message(const std::string s) const
variant(const std::vector< bool > &arg, const std::vector< int > &theshape)
const std::string & getString() const
int shape_size() const
what size does the shape imply
std::vector< double > & asDoubleVec(int size=-1)
std::complex< double > * c
variant(const std::vector< std::string > &arg, const std::vector< int > &theshape)
const std::vector< bool > & getBoolVec() const
variant(std::vector< int > *arg)
variant(const std::vector< bool > &arg)
variant(std::vector< bool > *arg)