YARP
Yet Another Robot Platform
TripleSource.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 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
yarp::serversql::impl::TripleSource::reset
virtual void reset()
Definition: TripleSource.h:53
t
float t
Definition: FfmpegWriter.cpp:74
yarp::serversql::impl::TripleContext
Side information for controlling access to triples.
Definition: TripleSource.h:27
yarp::serversql::impl::Triple
The basic unit of data the name server works with.
Definition: Triple.h:28
yarp::serversql::impl::TripleContext::rid
int rid
Definition: TripleSource.h:29
yarp::serversql::impl::TripleSource
Abstract view of a database as a collection of triples.
Definition: TripleSource.h:44
yarp::serversql::impl::TripleSource::begin
virtual void begin(TripleContext *context)=0
yarp::serversql::impl::TripleSource::TripleSource
TripleSource()
Definition: TripleSource.h:46
yarp::serversql::impl::TripleSource::query
virtual std::list< Triple > query(Triple &ti, TripleContext *context)=0
yarp::serversql::impl::TripleContext::setRid
void setRid(int rid)
Definition: TripleSource.h:33
yarp::serversql::impl::TripleContext::TripleContext
TripleContext()=default
yarp::serversql::impl::TripleSource::~TripleSource
virtual ~TripleSource()=default
yarp::serversql::impl::TripleSource::prune
virtual void prune(TripleContext *context)=0
Triple.h
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::serversql::impl::TripleSource::remove_query
virtual void remove_query(Triple &ti, TripleContext *context)=0
yarp::serversql::impl::TripleSource::insert
virtual void insert(Triple &t, TripleContext *context)=0
yarp::serversql::impl::TripleSource::end
virtual void end(TripleContext *context)=0
yarp::serversql::impl::TripleSource::update
virtual void update(Triple &t, TripleContext *context)=0
yarp::serversql::impl::TripleSource::find
virtual int find(Triple &t, TripleContext *context)=0