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 <mongo/client/dbclient.h>
26 
27 #include <boost/function.hpp>
28 
29 ///typedef for shorter type description
30 typedef std::unique_ptr<mongo::DBClientCursor> QResCursor;
31 
33 {
34  /// Information access for Manager
35  friend class EventTriggerManager;
36 
37 public:
38  EventTrigger(mongo::Query oplog_query,
39  const std::string & ns,
40  const boost::function<void(mongo::BSONObj)> &callback);
41  virtual ~EventTrigger();
42 
43 private:
44  mongo::Query oplog_query;
45  std::string ns;
46  std::string ns_db;
47  QResCursor oplog_cursor;
48  boost::function<void(mongo::BSONObj)> 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(mongo::Query oplog_query, const std::string &ns, const boost::function< void(mongo::BSONObj)> &callback)
Constructor.