libIntegra
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
polling_notification_sink.h
Go to the documentation of this file.
1  /* libIntegra modular audio framework
2  *
3  * Copyright (C) 2007 Birmingham City University
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
18  * USA.
19  */
20 
26 #ifndef INTEGRA_SINGLE_THREADED_NOTIFICATIONS_H
27 #define INTEGRA_SINGLE_THREADED_NOTIFICATIONS_H
28 
29 #include "common_typedefs.h"
30 
31 #include "notification_sink.h"
32 
33 #include <pthread.h>
34 
35 namespace integra_api
36 {
50  class INTEGRA_API CPollingNotificationSink : public INotificationSink
51  {
52  public:
53 
56 
58  typedef std::unordered_map<string, CCommandSource> changed_endpoint_map;
59 
66  void get_changed_endpoints( changed_endpoint_map &changed_endpoints );
67 
68  private:
69 
70  void on_set_command( const IServer &server, const CPath &endpoint_path, const CCommandSource &source );
71 
72  changed_endpoint_map m_changed_endpoints;
73 
74  pthread_mutex_t m_mutex;
75  };
76 }
77 
78 
79 
80 #endif
Helper class to receive notifications within a single thread.
Definition: polling_notification_sink.h:50
Provides methods to query libIntegra and process commands.
Definition: server.h:51
std::unordered_map< string, CCommandSource > changed_endpoint_map
Definition: polling_notification_sink.h:58
Represents an enumeration of command sources.
Definition: command_source.h:39
Provides mechanism to recieve feedback about changes to libIntegra's state.
Definition: notification_sink.h:50
Represents the address of a node endpoint, absolutely or relatively.
Definition: path.h:48
Defines class INotificationSink.
#defines and typedefs used throughout the application