1 ///////////////////////////////////////////////////////////////////////////////
2 // Copyright (c) 2000-2014 Ericsson Telecom AB
3 // All rights reserved. This program and the accompanying materials
4 // are made available under the terms of the Eclipse Public License v1.0
5 // which accompanies this distribution, and is available at
6 // http://www.eclipse.org/legal/epl-v10.html
7 ///////////////////////////////////////////////////////////////////////////////
11 /*****************************************************
13 // include usage_stats.hh before dbgnew.hh!!
14 // XYSender sender; // XYSender is a subclass of Sender
15 // int timeout = 200; // timeout in msec for the data sender thread
16 // UsageData::getInstance().sendDataThreaded("info", timeout, &sender);
19 // for Solaris -lnsl -lsocket -lresolv
20 // for Linux -lpthread -lrt
22 // iodine: use iodine as a library from /etc/dns/iodine/lib/libiodine.a
23 // or via pipe as an outside process
24 // uncomment this and the DNSSender::send function
25 //#include "../etc/dns/iodine/src/iodine.h"
26 *****************************************************/
30 #include "version_internal.h"
36 virtual void send(const char*) = 0;
39 class DNSSender: public Sender {
43 void send(const char*);
46 const char* nameserver;
50 class HttpSender: public Sender {
54 void send(const char*);
60 static UsageData& getInstance()
62 static UsageData instance; // Guaranteed to be destroyed.
63 return instance; // Instantiated on first use.
65 static void sendDataThreaded(std::string msg, Sender* sender);
71 UsageData(UsageData const&); // Don't Implement
72 void operator=(UsageData const&); // Don't implement
74 static void* sendData(void*);
76 static std::string id;
77 static std::string host;
78 static std::string platform;
81 #endif /* USAGE_STATS_H_ */