1 /* ------------------------------------------------
2 Copyright 2014 AT&T Intellectual Property
3 Licensed under the Apache License, Version 2.0 (the "License");
4 you may not use this file except in compliance with the License.
5 You may obtain a copy of the License at
7 http://www.apache.org/licenses/LICENSE-2.0
9 Unless required by applicable law or agreed to in writing, software
10 distributed under the License is distributed on an "AS IS" BASIS,
11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 See the License for the specific language governing permissions and
13 limitations under the License.
14 ------------------------------------------- */
23 /* vstring_type specifis the format in which vstirng data is stored
24 we will use the reserved field of vstirng to store the vstring_type
25 vstring_type desclaration should probably be in host.h
28 // data immediately follows the tuple fields
30 // data allocated on a heap in one block
31 // offset is interpreted as pointer to data
33 // vstring is a shallow copy of another vstring (or its part)
34 // offset is interpreted as pointer to data
36 // data allocated on a heap as single linked list of data blocks
37 // offset is interpreted as pointer to the head of the list
38 // list node has the following format
39 // {int length, node* next) followed by the data block
41 // data allocated on a heap as double linked list of data blocks
42 // offset is interpreted as pointer to the head of the list
43 // list node has the following format
44 // {int length, node* next, node* prev) followed by the data block
50 size_t tuple_size; // tuple size in bytes
51 void* data; // tuple data
52 unsigned int channel; // input or output channel the tuple should go to
53 bool heap_resident; // indicates whether tuple is heap or stack resident
55 // we need to use reference counting for query plans that are DAGs
58 host_tuple() {ref_cnt = NULL;}
62 inline void free_tuple() {
67 else if (*ref_cnt == 0) {
81 #endif // HOST_TUPLE_H