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 {
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>
41  {
42  public:
43  virtual ~forEachNode
44  ()
45  = 0;
46 
47  /// @return true to continue, false to stop
48  bool operator()
50  {
51  return false;
52  }
53  bool operator()
55  {
56  return false;
57  }
58  bool operator()
60  {
61  return false;
62  }
63  bool operator()
65  {
66  return false;
67  }
68 
69  protected:
71  ()
72  {
73  }
74  };
75 
76  inline
78  ()
79  {
80  }
81 
83  {
84  public:
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 }
Each high-level Xpace object has a Configuration.
Definition: config.h:29
LOC loc
Definition: node.h:35
T data
Definition: node.h:36
virtual ~forEachNode()=0
Definition: node.h:78
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 project main namespace
Definition: datetime.h:18
enum Xpace::internalDataType::@8 type

current as of Wed Jun 10 2026 12:00:05