Wolframe, 0.0.3

programImage.hpp
Go to the documentation of this file.
1 /************************************************************************
2 
3  Copyright (C) 2011 - 2014 Project Wolframe.
4  All rights reserved.
5 
6  This file is part of Project Wolframe.
7 
8  Commercial Usage
9  Licensees holding valid Project Wolframe Commercial licenses may
10  use this file in accordance with the Project Wolframe
11  Commercial License Agreement provided with the Software or,
12  alternatively, in accordance with the terms contained
13  in a written agreement between the licensee and Project Wolframe.
14 
15  GNU General Public License Usage
16  Alternatively, you can redistribute this file and/or modify it
17  under the terms of the GNU General Public License as published by
18  the Free Software Foundation, either version 3 of the License, or
19  (at your option) any later version.
20 
21  Wolframe is distributed in the hope that it will be useful,
22  but WITHOUT ANY WARRANTY; without even the implied warranty of
23  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24  GNU General Public License for more details.
25 
26  You should have received a copy of the GNU General Public License
27  along with Wolframe. If not, see <http://www.gnu.org/licenses/>.
28 
29  If you have questions regarding the use of this file, please contact
30  Project Wolframe.
31 
32 ************************************************************************/
35 #ifndef _DATABASE_VM_PROGRAM_IMAGE_HPP_INCLUDED
36 #define _DATABASE_VM_PROGRAM_IMAGE_HPP_INCLUDED
40 #include "types/variant.hpp"
41 #include <string>
42 #include <vector>
43 #include <boost/cstdint.hpp>
44 #include <boost/shared_ptr.hpp>
45 
46 namespace _Wolframe {
47 namespace db {
48 namespace vm {
50 class Program;
51 
55  :public InstructionSet
56 {
57 public:
58  typedef std::vector<std::string> SubroutineSignature;
61  struct ErrorHint
62  {
63  std::string errorclass;
64  std::string message;
66  ErrorHint( const ErrorHint& o)
68  ErrorHint( const std::string& e, const std::string& m)
69  :errorclass(e),message(m){}
70  };
71  typedef std::vector<ErrorHint> ErrorHintList;
72 
73 public:
75  std::vector<types::Variant> constants;
76  std::vector<std::string> colnames;
77  std::vector<std::string> tagnames;
78  std::vector<std::string> resultnames;
79  std::vector<std::string> statements;
80  std::vector<ErrorHintList> errorhints;
81  std::vector<SubroutineSignature> signatures;
82  std::vector<ValueTupleSetR> tuplesets;
83 
84 public:
89  :code(o.code)
91  ,colnames(o.colnames)
92  ,tagnames(o.tagnames)
98  {}
99 
101  void printInstruction( std::ostream& out, const Instruction& instr) const;
103  void print( std::ostream& out) const;
104 };
105 
106 }}}//namespace
107 #endif
108 
std::vector< std::string > tagnames
tag names
Definition: programImage.hpp:77
std::string message
Definition: programImage.hpp:64
ErrorHint(const std::string &e, const std::string &m)
Definition: programImage.hpp:68
Defines the structure holding a set of tuples (database results, transaction input, suroutine parameters) and providing an iterator on it.
Defines the instruction set of the virtual machine defining database transactions.
std::vector< ErrorHintList > errorhints
hints for error classes of failing database statements
Definition: programImage.hpp:80
std::vector< types::Variant > constants
constants
Definition: programImage.hpp:75
std::vector< ValueTupleSetR > tuplesets
value sets from input path expressions
Definition: programImage.hpp:82
ErrorHint(const ErrorHint &o)
Definition: programImage.hpp:66
std::string errorclass
Definition: programImage.hpp:63
boost::uint32_t Instruction
Instruction.
Definition: instructionSet.hpp:328
std::vector< std::string > SubroutineSignature
Definition: programImage.hpp:58
ProgramImage()
Constructor.
Definition: programImage.hpp:86
std::vector< SubroutineSignature > signatures
subroutine signatures
Definition: programImage.hpp:81
std::vector< std::string > resultnames
result name table
Definition: programImage.hpp:78
std::vector< ErrorHint > ErrorHintList
Definition: programImage.hpp:71
ProgramImage(const ProgramImage &o)
Copy constructor.
Definition: programImage.hpp:88
Variant value type.
ErrorHint()
Definition: programImage.hpp:65
std::vector< std::string > colnames
column names
Definition: programImage.hpp:76
void printInstruction(std::ostream &out, const Instruction &instr) const
Print one instruction without symbolic information.
ProgramCode code
program code
Definition: programImage.hpp:74
The structure for the program code as array of instructions.
Definition: programCode.hpp:49
Defines the structure for the program code as array of instructions.
Enumeration of instructions for the transaction VM with some static functions on them.
Definition: instructionSet.hpp:50
Hint for adding user information to the database error.
Definition: programImage.hpp:61
void print(std::ostream &out) const
Print the whole program without symbolic information.
std::vector< std::string > statements
database statements
Definition: programImage.hpp:79
Program addressing only flat data structures and with symbolic information stripped out...
Definition: programImage.hpp:54