1
//////////////////////////////////////////////////////////////////////////
3
// pgScript - PostgreSQL Tools
4
// RCS-ID: $Id: pgsGenerator.h 7758 2009-03-26 20:49:59Z dpage $
5
// Copyright (C) 2002 - 2009, The pgAdmin Development Team
6
// This software is released under the BSD Licence
8
//////////////////////////////////////////////////////////////////////////
11
#ifndef PGSGENERATOR_H_
12
#define PGSGENERATOR_H_
14
#include "pgscript/pgScript.h"
15
#include "pgscript/generators/pgsObjectGen.h"
16
#include "pgscript/objects/pgsVariable.h"
17
#include "pgscript/utilities/pgsSharedPtr.h"
23
class pgsGenerator : public pgsVariable
28
virtual pgsOperand pgs_plus(const pgsVariable & rhs) const;
30
virtual pgsOperand pgs_minus(const pgsVariable & rhs) const;
32
virtual pgsOperand pgs_times(const pgsVariable & rhs) const;
34
virtual pgsOperand pgs_over(const pgsVariable & rhs) const;
36
virtual pgsOperand pgs_modulo(const pgsVariable & rhs) const;
38
virtual pgsOperand pgs_equal(const pgsVariable & rhs) const;
40
virtual pgsOperand pgs_different(const pgsVariable & rhs) const;
42
virtual pgsOperand pgs_greater(const pgsVariable & rhs) const;
44
virtual pgsOperand pgs_lower(const pgsVariable & rhs) const;
46
virtual pgsOperand pgs_lower_equal(const pgsVariable & rhs) const;
48
virtual pgsOperand pgs_greater_equal(const pgsVariable & rhs) const;
50
virtual pgsOperand pgs_not() const;
52
virtual bool pgs_is_true() const;
54
virtual pgsOperand pgs_almost_equal(const pgsVariable & rhs) const;
58
typedef pgsSharedPtr<pgsObjectGen> pgsRandomizer;
60
mutable pgsRandomizer m_randomizer;
64
pgsGenerator(const pgsTypes & generator_type, pgsObjectGen * randomizer);
66
virtual ~pgsGenerator();
68
virtual pgsVariable * clone() const;
70
/* pgsGenerator(const pgsGenerator & that); */
72
/* pgsGenerator & operator =(const pgsGenerator & that); */
76
virtual wxString value() const;
78
virtual pgsOperand eval(pgsVarMap & vars) const;
82
pgsOperand operand() const;
86
virtual pgsNumber number() const;
88
virtual pgsRecord record() const;
90
virtual pgsString string() const;
94
#endif /*PGSGENERATOR_H_*/