Xpace
node.h
Go to the documentation of this file.
1
2
/**********************************************************/
/**
3
**
4
** @file data/node.h
5
**
6
** Copyright (C) 2012 Xpace, LLC. All rights reserved
7
**
8
** www.xpace.net
9
**
10
**************************************************************/
11
12
#ifndef XPACE_NODE_H
13
#define XPACE_NODE_H
14
15
namespace
Xpace
16
{
17
struct
internalDataType
18
{
19
enum
20
{
21
dt_int
,
// int64, BytesRef
22
dt_float
,
// DecimalFloat
23
dt_string8
,
// BytesRef TODO: rawString8
24
dt_string16
,
// Ref<utf16_t> TODO: rawString16
25
dt_bytes
// BytesRef
26
}
type
;
27
28
size_t
size
;
29
};
30
31
// a low-level data node, location and contents
32
template
<
typename
LOC,
typename
T>
33
struct
Node
34
{
35
LOC
loc
;
36
T
data
;
37
};
38
39
template
<
typename
LOC>
40
class
forEachNode
41
{
42
public
:
43
virtual
~
forEachNode
44
()
45
= 0;
46
47
/// @return true to continue, false to stop
48
bool
operator()
49
(
const
Node<LOC, int64>
&)
50
{
51
return
false
;
52
}
53
bool
operator()
54
(
const
Node<LOC, BytesRef>
&)
55
{
56
return
false
;
57
}
58
bool
operator()
59
(
const
Node<LOC, DecimalFloat>
&)
60
{
61
return
false
;
62
}
63
bool
operator()
64
(
const
Node<LOC, Ref<utf16_t>
>&)
65
{
66
return
false
;
67
}
68
69
protected
:
70
forEachNode
71
()
72
{
73
}
74
};
75
76
inline
77
forEachNode::~forEachNode
78
()
79
{
80
}
81
82
class
TranslateNode
83
{
84
public
:
85
~
TranslateNode
86
()
87
{
88
}
89
90
static
TranslateNode
* create
91
(
const
Configuration
& config);
92
93
// the output type of this translator
94
virtual
internalDataType
getType
95
()
96
const
97
= 0;
98
};
99
}
Xpace::internalDataType::dt_int
Definition:
node.h:21
Xpace::internalDataType::dt_string8
Definition:
node.h:23
Xpace::internalDataType::dt_string16
Definition:
node.h:24
Xpace::internalDataType
Definition:
node.h:17
Xpace::Configuration
Each high-level Xpace object has a Configuration.
Definition:
config.h:29
Xpace::Node::loc
LOC loc
Definition:
node.h:35
Xpace::Node::data
T data
Definition:
node.h:36
Xpace::forEachNode::~forEachNode
virtual ~forEachNode()=0
Definition:
node.h:78
Xpace::internalDataType::dt_float
Definition:
node.h:22
Xpace::Node
Definition:
node.h:33
Xpace::forEachNode
Definition:
node.h:40
Xpace::internalDataType::size
size_t size
Definition:
node.h:28
Xpace::TranslateNode
Translate content Input can be anything Output is to a Sink<LOC> so must be one of its supported type...
Definition:
node.h:82
Xpace::internalDataType::dt_bytes
Definition:
node.h:25
Xpace
Xpace project main namespace
Definition:
datetime.h:18
Xpace::internalDataType::type
enum Xpace::internalDataType::@8 type
current as of Wed Jun 10 2026 12:00:05