YARP
Yet Another Robot Platform
TripleSource.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * Copyright (C) 2006-2010 RobotCub Consortium
4  * All rights reserved.
5  *
6  * This software may be modified and distributed under the terms of the
7  * BSD-3-Clause license. See the accompanying LICENSE file for details.
8  */
9 
10 #ifndef YARP_SERVERSQL_IMPL_TRIPLESOURCE_H
11 #define YARP_SERVERSQL_IMPL_TRIPLESOURCE_H
12 
14 
15 #include <string>
16 #include <list>
17 
18 
19 namespace yarp {
20 namespace serversql {
21 namespace impl {
22 
27 {
28 public:
29  int rid {-1};
30 
31  TripleContext() = default;
32 
33  void setRid(int rid) {
34  this->rid = rid;
35  }
36 };
37 
44 {
45 public:
47  {
48  reset();
49  }
50 
51  virtual ~TripleSource() = default;
52 
53  virtual void reset()
54  {
55  }
56 
57  virtual int find(Triple& t, TripleContext *context) = 0;
58 
59  virtual void prune(TripleContext *context) = 0;
60 
61  virtual std::list<Triple> query(Triple& ti,
62  TripleContext *context) = 0;
63 
64  virtual void remove_query(Triple& ti,
65  TripleContext *context) = 0;
66 
67  virtual void insert(Triple& t, TripleContext *context) = 0;
68 
69  virtual void update(Triple& t, TripleContext *context) = 0;
70 
71  virtual void begin(TripleContext *context) = 0;
72  virtual void end(TripleContext *context) = 0;
73 };
74 
75 } // namespace impl
76 } // namespace serversql
77 } // namespace yarp
78 
79 
80 #endif // YARP_SERVERSQL_IMPL_TRIPLESOURCE_H
float t
Side information for controlling access to triples.
Definition: TripleSource.h:27
Abstract view of a database as a collection of triples.
Definition: TripleSource.h:44
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:28
The main, catch-all namespace for YARP.
Definition: environment.h:25