iLab Neuromorphic Robotics Toolkit  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BlackboardNetHandler.H
Go to the documentation of this file.
1 /*! @file
2  @author Randolph Voorhies
3  @copyright GNU Public License (GPL v3)
4  @section License
5  @verbatim
6  // ////////////////////////////////////////////////////////////////////////
7  // The iLab Neuromorphic Robotics Toolkit (NRT) //
8  // Copyright 2010-2012 by the University of Southern California (USC) //
9  // and the iLab at USC. //
10  // //
11  // iLab - University of Southern California //
12  // Hedco Neurociences Building, Room HNB-10 //
13  // Los Angeles, Ca 90089-2520 - USA //
14  // //
15  // See http://ilab.usc.edu for information about this project. //
16  // ////////////////////////////////////////////////////////////////////////
17  // This file is part of The iLab Neuromorphic Robotics Toolkit. //
18  // //
19  // The iLab Neuromorphic Robotics Toolkit is free software: you can //
20  // redistribute it and/or modify it under the terms of the GNU General //
21  // Public License as published by the Free Software Foundation, either //
22  // version 3 of the License, or (at your option) any later version. //
23  // //
24  // The iLab Neuromorphic Robotics Toolkit is distributed in the hope //
25  // that it will be useful, but WITHOUT ANY WARRANTY; without even the //
26  // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR //
27  // PURPOSE. See the GNU General Public License for more details. //
28  // //
29  // You should have received a copy of the GNU General Public License //
30  // along with The iLab Neuromorphic Robotics Toolkit. If not, see //
31  // <http://www.gnu.org/licenses/>. //
32  // ////////////////////////////////////////////////////////////////////////
33  @endverbatim */
34 
35 
36 
37 #ifndef INCLUDE_NRT_CORE_BLACKBOARD_NETWORK_BLACKBOARDNETHANDLER_H
38 #define INCLUDE_NRT_CORE_BLACKBOARD_NETWORK_BLACKBOARDNETHANDLER_H
39 
43 
44 namespace nrt
45 {
46  //! Blackboard network handler interface
48  {
49  public:
50  //! Virtual destructor for safe inheritance
51  virtual ~BlackboardNetHandler() { }
52 
53  //! Start a blackboard master
54  /*! If a port == 0 is given, then try to find an open port and return it. */
55  virtual int startMaster(int const port) = 0;
56 
57  //! Start a blackboard client
58  virtual void startClient(std::string const & masterIP, int const masterPort) = 0;
59 
60  //! Stop a blackboard client
61  virtual void stopClient() = 0;
62 
63  //! Let all blackboards on the network know about our posts/checks/subscriptions
64  virtual void registerClientBlackboard(nrt::blackboard::BlackboardSummary const & bs) = 0;
65 
66  //! Get the UID (as a string) of the Blackboard federation master
67  virtual std::string masterbbuid() = 0;
68 
69  //! Get a remote post handler
70  virtual nrt::blackboard::MessageSubscriberRemotePostHandler
71  getRemotePostHandler(std::string const & bbuid, std::string const & msgtype,
72  std::string const & modulepportname) = 0;
73 
74  //! Get a remote callback
75  virtual nrt::blackboard::MessageSubscriberRemoteCallback
76  getRemoteCallback(std::string const & bbuid, std::string const & modulesportname) = 0;
77 
78  //! Get a remote check function
79  virtual nrt::blackboard::MessageCheckerRemoteCall
80  getRemoteCheckCall(std::string const & bbuid, std::string const & msgtype,
81  std::string const & modulecportname) = 0;
82 
83  //! Send a notification of a local Parameter changed to a remote Blackboard
84  virtual void sendNotifyParamChanged(std::string const & rbbuid, std::string const & module,
85  nrt::ParameterState const state, nrt::ParameterSummary const & ps) = 0;
86 
87  //! Set a parameter value on a remote blackboard
88  virtual void setParam(std::string const & bbuid, std::string const & descriptor, std::string const & value) = 0;
89 
90  //! Set a parameter value on a remote blackboard
91  virtual void setModuleParam(std::string const & bbuid, std::string const & module,
92  std::string const & relativedescriptor, std::string const & value) = 0;
93 
94  //! Run a command on a remote Blackboard and get results back
95  /*! The results are placed back in the args of the outgoing command, after deleting the outgoing args. If bbuid is
96  "ALL" then the command is dispatched to all known Blackboards at the time, one after the other serially (this
97  is used, e.g., to start/stop a whole federation); note that in this case there are no results returned. */
98  virtual void runRemoteCommand(std::string const & bbuid, nrt::blackboard::RemoteCommand & cmd) = 0;
99  };
100 }
101 
102 #endif // INCLUDE_NRT_CORE_BLACKBOARD_NETWORK_BLACKBOARDNETHANDLER_H
103