LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
DataTypes.h
Go to the documentation of this file.
1// Copyright 2002-2013 CEA LIST
2// SPDX-FileCopyrightText: 2022 CEA LIST <gael.de-chalendar@cea.fr>
3//
4// SPDX-License-Identifier: MIT
5
19#ifndef DATATYPES_H
20#define DATATYPES_H
21
22#include "common/LimaCommon.h"
23// #include <../amose_imageprocessing/src/imageProcessing/core/PIRIA/tiff.h>
24
25#include <sstream>
26#include <iostream>
27#include <map>
28#include <vector>
29
30namespace Lima {
31
35 typedef uint64_t STRUCT_ID;
36
40 typedef uint64_t NODE_ID;
41
45 typedef uint64_t CONTENT_ID;
46
50 typedef uint64_t TOPO_POS;
51
52
62{
63public:
65 Node();
66
68 virtual ~Node();
69
71 Node(const Node &n);
72 Node &operator=(const Node &n);
73
88 Node(const std::string &docName,
89 STRUCT_ID structId,
90 NODE_ID nodeId,
91 CONTENT_ID contentId,
92 int indexid ,
93 std::string uri,
94 std::string nodeMedia,
95 std::string nodeType,
96 std::string descrId,
97 TOPO_POS nodeStart,
98 TOPO_POS nodeEnd,
99 TOPO_POS nodeLength,
100 NODE_ID nodeParent);
101 std::string get_DocName() const;
102 void set_DocName ( const std::string& docName );
103 STRUCT_ID get_StructId() const;
104 void set_StructId ( STRUCT_ID structId );
105 NODE_ID get_NodeId() const;
106 void set_NodeId ( NODE_ID NodeId );
107 CONTENT_ID get_ContentId() const;
108 void set_ContentId ( CONTENT_ID ContentId );
109 const std::string& nodeType() const;
110 int32_t indexId() const;
111 void indexId(int32_t id);
112 const std::string& descrId() const;
113
114 TOPO_POS nodeStart() const;
115 void nodeStart(TOPO_POS ns);
116 TOPO_POS nodeEnd() const;
117 void nodeEnd(TOPO_POS ns);
118 TOPO_POS nodeLength() const;
119 void nodeLength(TOPO_POS ns);
120 NODE_ID nodeParent() const;
121 void nodeParent(NODE_ID np);
122
123 const std::string& uri() const;
124 const std::string& nodeMedia() const;
125
126private:
127 NodePrivate* m_d;
128};
129
139{
140public:
141 Structure();
142 Structure(const Structure& s);
143 Structure ( STRUCT_ID structID );
144 Structure& operator=( const Structure& s );
145
147 ~Structure();
148
149 void addNode (const Node& node );
150
151 void addNode ( CONTENT_ID ContentId, const Node& node );
152
156 Node* getNode ( CONTENT_ID ContentId );
157 const Node* getNode ( CONTENT_ID ContentId ) const;
158
161 Node* getFirstNode ( STRUCT_ID /*unused*/ );
162 const Node* getFirstNode ( STRUCT_ID /*unused*/ ) const;
163
166 const std::map<CONTENT_ID, Node>& getNodes() const;
167 std::map<CONTENT_ID, Node>& getNodes();
168
169 STRUCT_ID getStructId() const;
170
171 void setStructId(STRUCT_ID structId);
172
173private:
174 StructurePrivate* m_d;
175};
176
177LIMA_DATA_EXPORT std::ostream& operator<<(std::ostream &os, const Node& node);
178LIMA_DATA_EXPORT QDebug& operator<<(QDebug& os, const Node& node);
179LIMA_DATA_EXPORT std::ostream& operator<<(std::ostream &os, const Structure& structure);
180LIMA_DATA_EXPORT QDebug& operator<<(QDebug& os, const Structure& structure);
181
182} // namespace Lima
183
184#endif
#define LIMA_DATA_EXPORT
Definition LimaCommon.h:128
noeud de contenu au sein d'une structure.
Definition DataTypes.h:62
NAUTITIA.
uint64_t CONTENT_ID
Identifier of an feature content.
Definition DataTypes.h:45
uint64_t STRUCT_ID
Identifier of a structure in the structure index.
Definition DataTypes.h:35
std::ostream & operator<<(ostream &os, const Node &node)
uint64_t NODE_ID
Identifier of a node in a document.
Definition DataTypes.h:40
uint64_t TOPO_POS
Topology information.
Definition DataTypes.h:50