#include <simgear/misc/strutils.hxx>
#include <simgear/threads/SGQueue.hxx>
#include <simgear/misc/sg_dir.hxx>
+#include <simgear/debug/BufferedLogCallback.hxx>
#ifdef HAVE_SVN_CLIENT_H
# ifdef HAVE_LIBSVN_CLIENT_1
_userCbData(NULL)
{
_svnThread = new SvnThread();
+ _log = new BufferedLogCallback(SG_TERRAIN, SG_INFO);
+ _log->truncateAt(255);
+
+ sglog().addCallback(_log);
}
SGTerraSync::~SGTerraSync()
_tiedProperties.Untie();
delete _svnThread;
_svnThread = NULL;
+ sglog().removeCallback(_log);
+ delete _log;
}
void SGTerraSync::init()
{
const int NOWHERE = -9999;
+class BufferedLogCallback;
+
typedef void (*SGTerraSyncCallback)(void* userData, long tileIndex);
class SGTerraSync : public SGSubsystem
bool schedulePosition(int lat, int lon);
void setTileRefreshCb(SGTerraSyncCallback refreshCb, void* userData = NULL);
+ /// retrive the associated log object, for displaying log
+ /// output somewhere (a UI, presumably)
+ BufferedLogCallback* log() const
+ { return _log; }
protected:
void syncAirportsModels();
void syncArea(int lat, int lon);
SGTerraSyncCallback _refreshCb;
void* _userCbData;
simgear::TiedPropertyList _tiedProperties;
+ BufferedLogCallback* _log;
};
}