Get the basics of TheWire service working

Added REF fields to Wire Msgs to allow replys to work well.
Added description of how the Message fields should be used.
Added WireGroupDialog for creation of WireGroups.
Updated PulseAddDialog to support publishing Pulses and Replies.
Added classes to display Pulses / Groups.
Added single selection point of WireGroup for publishing.
Added basic "refresh" to reload new GXS data.
This commit is contained in:
drbob 2020-02-29 11:47:00 +11:00
parent b1680bd591
commit 24fd4ae3e7
23 changed files with 2303 additions and 1110 deletions

View file

@ -3,7 +3,7 @@
* *
* libretroshare: retroshare core library *
* *
* Copyright 2012-2012 by Robert Fernie <retroshare@lunamutt.com> *
* Copyright 2012-2020 by Robert Fernie <retroshare@lunamutt.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
@ -83,6 +83,10 @@ void p3Wire::service_tick()
return;
}
RsTokenService* p3Wire::getTokenService() {
return RsGenExchange::getTokenService();
}
void p3Wire::notifyChanges(std::vector<RsGxsNotify*>& changes)
{
@ -175,12 +179,12 @@ bool p3Wire::createGroup(uint32_t &token, RsWireGroup &group)
groupItem->group = group;
groupItem->meta = group.mMeta;
std::cerr << "p3Wire::createGroup(): ";
std::cerr << "p3Wire::createGroup(): ";
std::cerr << std::endl;
std::cerr << group;
std::cerr << std::endl;
std::cerr << "p3Wire::createGroup() pushing to RsGenExchange";
std::cerr << "p3Wire::createGroup() pushing to RsGenExchange";
std::cerr << std::endl;
RsGenExchange::publishGroup(token, groupItem);
@ -193,11 +197,11 @@ bool p3Wire::createPulse(uint32_t &token, RsWirePulse &pulse)
std::cerr << "p3Wire::createPulse(): " << pulse;
std::cerr << std::endl;
RsGxsWirePulseItem* pulseItem = new RsGxsWirePulseItem();
pulseItem->pulse = pulse;
pulseItem->meta = pulse.mMeta;
RsGxsWirePulseItem* pulseItem = new RsGxsWirePulseItem();
pulseItem->pulse = pulse;
pulseItem->meta = pulse.mMeta;
RsGenExchange::publishMsg(token, pulseItem);
RsGenExchange::publishMsg(token, pulseItem);
return true;
}

View file

@ -3,7 +3,7 @@
* *
* libretroshare: retroshare core library *
* *
* Copyright 2012-2012 by Robert Fernie <retroshare@lunamutt.com> *
* Copyright 2012-2020 by Robert Fernie <retroshare@lunamutt.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
@ -34,37 +34,33 @@
*
*/
class p3Wire: public RsGenExchange, public RsWire
{
public:
p3Wire(RsGeneralDataService* gds, RsNetworkExchangeService* nes, RsGixs *gixs);
virtual RsServiceInfo getServiceInfo();
static uint32_t wireAuthenPolicy();
p3Wire(RsGeneralDataService* gds, RsNetworkExchangeService* nes, RsGixs *gixs);
virtual RsServiceInfo getServiceInfo();
static uint32_t wireAuthenPolicy();
protected:
virtual void notifyChanges(std::vector<RsGxsNotify*>& changes) ;
virtual void notifyChanges(std::vector<RsGxsNotify*>& changes) ;
public:
virtual void service_tick();
virtual void service_tick();
virtual RsTokenService* getTokenService();
/* Specific Service Data */
virtual bool getGroupData(const uint32_t &token, std::vector<RsWireGroup> &groups);
virtual bool getPulseData(const uint32_t &token, std::vector<RsWirePulse> &pulses);
/* Specific Service Data */
virtual bool getGroupData(const uint32_t &token, std::vector<RsWireGroup> &groups);
virtual bool getPulseData(const uint32_t &token, std::vector<RsWirePulse> &pulses);
virtual bool createGroup(uint32_t &token, RsWireGroup &group);
virtual bool createPulse(uint32_t &token, RsWirePulse &pulse);
virtual bool createGroup(uint32_t &token, RsWireGroup &group);
virtual bool createPulse(uint32_t &token, RsWirePulse &pulse);
private:
virtual void generateDummyData();
std::string genRandomId();
private:
virtual void generateDummyData();
std::string genRandomId();
RsMutex mWireMtx;
};
#endif