Ice 3.7 C++11 API Reference
Plugin.h
Go to the documentation of this file.
1 //
2 // Copyright (c) ZeroC, Inc. All rights reserved.
3 //
4 
5 #ifndef ICE_BT_PLUGIN_H
6 #define ICE_BT_PLUGIN_H
7 
8 #include <Ice/Plugin.h>
9 
10 #ifndef ICEBT_API
11 # if defined(ICE_STATIC_LIBS)
12 # define ICEBT_API
13 # elif defined(ICEBT_API_EXPORTS)
14 # define ICEBT_API ICE_DECLSPEC_EXPORT
15 # else
16 # define ICEBT_API ICE_DECLSPEC_IMPORT
17 # endif
18 #endif
19 
20 namespace IceBT
21 {
22 
24 typedef std::map<std::string, std::string> PropertyMap;
25 
27 typedef std::map<std::string, PropertyMap> DeviceMap;
28 
29 #ifndef ICE_CPP11_MAPPING
30 
34 class ICEBT_API DiscoveryCallback : public IceUtil::Shared
35 {
36 public:
37 
43  virtual void discovered(const std::string& addr, const PropertyMap& props) = 0;
44 };
45 typedef IceUtil::Handle<DiscoveryCallback> DiscoveryCallbackPtr;
46 #endif
47 
53 {
54 public:
55 
64 #ifdef ICE_CPP11_MAPPING
65  virtual void startDiscovery(const std::string& address,
66  std::function<void(const std::string& addr, const PropertyMap& props)> cb) = 0;
67 #else
68  virtual void startDiscovery(const std::string& address, const DiscoveryCallbackPtr& cb) = 0;
69 #endif
70 
76  virtual void stopDiscovery(const std::string& address) = 0;
77 
83  virtual DeviceMap getDevices() const = 0;
84 };
86 
87 }
88 
89 #endif
ICEBT_API
#define ICEBT_API
Definition: Plugin.h:16
Ice::Plugin
A communicator plug-in.
Definition: Plugin.h:78
IceBT::Plugin::startDiscovery
virtual void startDiscovery(const std::string &address, std::function< void(const std::string &addr, const PropertyMap &props)> cb)=0
Start Bluetooth device discovery on the adapter with the specified address.
IceBT::PropertyMap
std::map< std::string, std::string > PropertyMap
A name-value map.
Definition: Plugin.h:24
IceBT::Plugin::stopDiscovery
virtual void stopDiscovery(const std::string &address)=0
Stops Bluetooth device discovery on the adapter with the specified address.
IceBT::Plugin::getDevices
virtual DeviceMap getDevices() const =0
Retrieve a snapshot of all known remote devices.
IceBT::DeviceMap
std::map< std::string, PropertyMap > DeviceMap
A collection of properties for each device.
Definition: Plugin.h:27
IceBT::ICE_DEFINE_PTR
ICE_DEFINE_PTR(PluginPtr, Plugin)
Plugin.h
IceBT::Plugin
Represents the IceBT plug-in object.
Definition: Plugin.h:53
IceSSL::PluginPtr
::std::shared_ptr< Plugin > PluginPtr
Definition: Plugin.h:708
IceUtil::Handle
Definition: Handle.h:143
IceBT
Definition: Plugin.h:21
IceUtil::Shared
Definition: Shared.h:78