Fawkes API Fawkes Development Version
event_trigger.h
1/***************************************************************************
2 * event_trigger.h - Class for handling EventTriggers (such as a subscriber)
3 *
4 *
5 * Created: 7:03:38 PM 2016
6 * Copyright 2016 Frederik Zwilling
7 ****************************************************************************/
8
9/* This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Library General Public License for more details.
18 *
19 * Read the full text in the LICENSE.GPL file in the doc directory.
20 */
21
22#ifndef FAWKES_SRC_PLUGINS_ROBOT_MEMORY_EVENT_TRIGGER_H_
23#define FAWKES_SRC_PLUGINS_ROBOT_MEMORY_EVENT_TRIGGER_H_
24
25#include <boost/function.hpp>
26#include <mongocxx/client.hpp>
27
28///typedef for shorter type description
29typedef std::unique_ptr<mongocxx::cursor> QResCursor;
30
32{
33 /// Information access for Manager
34 friend class EventTriggerManager;
35
36public:
37 EventTrigger(mongocxx::change_stream && change_stream,
38 const bsoncxx::document::view & oplog_query,
39 const std::string & ns,
40 const boost::function<void(bsoncxx::document::view)> &callback);
41 virtual ~EventTrigger();
42
43private:
44 mongocxx::change_stream change_stream;
45 bsoncxx::document::value filter_query;
46 std::string ns;
47 std::string ns_db;
48 boost::function<void(bsoncxx::document::view)> callback;
49};
50
51#endif /* FAWKES_SRC_PLUGINS_ROBOT_MEMORY_EVENT_TRIGGER_H_ */
Manager to realize triggers on events in the robot memory.
Class holding all information about an EventTrigger.
Definition: event_trigger.h:32
EventTrigger(mongocxx::change_stream &&change_stream, const bsoncxx::document::view &oplog_query, const std::string &ns, const boost::function< void(bsoncxx::document::view)> &callback)
Constructor.