YARP
Yet Another Robot Platform
TripleSource.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef YARP_SERVERSQL_IMPL_TRIPLESOURCE_H
8 #define YARP_SERVERSQL_IMPL_TRIPLESOURCE_H
9 
11 
12 #include <string>
13 #include <list>
14 
15 
16 namespace yarp {
17 namespace serversql {
18 namespace impl {
19 
24 {
25 public:
26  int rid {-1};
27 
28  TripleContext() = default;
29 
30  void setRid(int rid) {
31  this->rid = rid;
32  }
33 };
34 
41 {
42 public:
44  {
45  reset();
46  }
47 
48  virtual ~TripleSource() = default;
49 
50  virtual void reset()
51  {
52  }
53 
54  virtual int find(Triple& t, TripleContext *context) = 0;
55 
56  virtual void prune(TripleContext *context) = 0;
57 
58  virtual std::list<Triple> query(Triple& ti,
59  TripleContext *context) = 0;
60 
61  virtual void remove_query(Triple& ti,
62  TripleContext *context) = 0;
63 
64  virtual void insert(Triple& t, TripleContext *context) = 0;
65 
66  virtual void update(Triple& t, TripleContext *context) = 0;
67 
68  virtual void begin(TripleContext *context) = 0;
69  virtual void end(TripleContext *context) = 0;
70 };
71 
72 } // namespace impl
73 } // namespace serversql
74 } // namespace yarp
75 
76 
77 #endif // YARP_SERVERSQL_IMPL_TRIPLESOURCE_H
float t
Side information for controlling access to triples.
Definition: TripleSource.h:24
Abstract view of a database as a collection of triples.
Definition: TripleSource.h:41
virtual std::list< Triple > query(Triple &ti, TripleContext *context)=0
virtual void prune(TripleContext *context)=0
virtual void end(TripleContext *context)=0
virtual int find(Triple &t, TripleContext *context)=0
virtual void begin(TripleContext *context)=0
virtual void update(Triple &t, TripleContext *context)=0
virtual void remove_query(Triple &ti, TripleContext *context)=0
virtual void insert(Triple &t, TripleContext *context)=0
The basic unit of data the name server works with.
Definition: Triple.h:25
The main, catch-all namespace for YARP.
Definition: dirs.h:16