All Classes Namespaces Functions Variables Groups Pages
SewioWebSocketClient.qm.dox.h
// -*- mode: c++; indent-tabs-mode: nil -*-
/* SewioWebSocketClient.qm Copyright 2013 - 2017 Qore Technologies, s.r.o.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
// minimum required Qore version
// require type definitions everywhere
// enable all warnings
namespace SewioWebSocketClient {
const WsSchemes = (
"sewiows": (
"ssl": False,
),
"sewiowss": (
"ssl": True,
),
);
class SewioWebSocketClient : public WebSocketClient::WebSocketClient {
public:
public :
const RequiredOptions = (
// the Sewio "API key"
"apikey",
);
const Version = "1.0";
const DefaultUserAgent = sprintf("Qore-SewioWebSocketClient/%s", SewioWebSocketClient::Version);
public:
private:internal {
// Sewio API key
string apikey;
}
constructor(code cb, hash opts) ;
sendData(string method, string resource, *hash h);
hash getSchemes();
private:
hash connectUnlocked(*hash hdr, *reference<hash> info);
public:
private:
static code getCallback(code cb);
public:
};
class SewioWebSocketConnection : public WebSocketClient::WebSocketConnectionObject {
public:
constructor(string name, string desc, string url, bool monitor, *hash opts, hash urlh) ;
string getType();
private:
SewioWebSocketClient getImpl(bool connect = True, *hash rtopts);
public:
hash getOptions();
*hash getDefaultOptions();
static SewioWebSocketConnection make(string name, string desc, string url, bool monitor, *hash opts, hash urlh);
};
};
ConnectionProvider::AbstractConnection::monitor
bool monitor
sprintf
string sprintf(string fmt,...)
SewioWebSocketClient::SewioWebSocketClient::sendData
sendData(string method, string resource, *hash h)
sends data to the server
ConnectionProvider::AbstractConnection::opts
*hash opts
True
const True
ConnectionProvider::AbstractConnection::name
string name
SewioWebSocketClient::SewioWebSocketConnection
class for Sewio RTLS Studio websocket connections; returns an object of class SewioWebSocketClient fo...
Definition: SewioWebSocketClient.qm.dox.h:192
SewioWebSocketClient::SewioWebSocketClient::DefaultUserAgent
const DefaultUserAgent
default user agent string for HTTP requests
Definition: SewioWebSocketClient.qm.dox.h:121
ConnectionProvider::AbstractConnection::urlh
hash urlh
SewioWebSocketClient::SewioWebSocketClient::connectUnlocked
hash connectUnlocked(*hash hdr, *reference< hash > info)
connects to the target server and starts the event listener thread
False
const False
WebSocketClient::WebSocketClient
SewioWebSocketClient::SewioWebSocketConnection::make
static SewioWebSocketConnection make(string name, string desc, string url, bool monitor, *hash opts, hash urlh)
static constructor
WebSocketClient::WebSocketConnectionObject
SewioWebSocketClient::SewioWebSocketConnection::getOptions
hash getOptions()
gets options
SewioWebSocketClient::SewioWebSocketConnection::getImpl
SewioWebSocketClient getImpl(bool connect=True, *hash rtopts)
returns a SewioWebSocketClient object
SewioWebSocketClient::SewioWebSocketClient::RequiredOptions
const RequiredOptions
required options
Definition: SewioWebSocketClient.qm.dox.h:112
SewioWebSocketClient::WsSchemes
const WsSchemes
known websocket schemes
Definition: SewioWebSocketClient.qm.dox.h:85
SewioWebSocketClient::SewioWebSocketClient::constructor
constructor(code cb, hash opts)
creates the object and optionally sets logging targets
SewioWebSocketClient::SewioWebSocketClient::getSchemes
hash getSchemes()
returns a hash of URL scheme information for URL schemes supported by this object ...
ConnectionProvider::AbstractConnection::desc
string desc
SewioWebSocketClient::SewioWebSocketConnection::getType
string getType()
returns &quot;sewiowebsocket&quot;
SewioWebSocketClient::SewioWebSocketClient
the main Sewio websocket client class
Definition: SewioWebSocketClient.qm.dox.h:107
SewioWebSocketClient::SewioWebSocketConnection::constructor
constructor(string name, string desc, string url, bool monitor, *hash opts, hash urlh)
creates the SewioWebSocketConnection object
SewioWebSocketClient::SewioWebSocketClient::Version
const Version
module version
Definition: SewioWebSocketClient.qm.dox.h:118
ConnectionProvider::AbstractConnection::url
string url
hash
hash hash(object obj)
SewioWebSocketClient::SewioWebSocketConnection::getDefaultOptions
*hash getDefaultOptions()
returns default options
SewioWebSocketClient::SewioWebSocketClient::getCallback
static code getCallback(code cb)
extern callback wrapper to parse the JSON and call the user&#39;s callback with the deserialized data ...