RetroShare/libretroshare/src/pqi/pqiindic.h
drbob 806b8285f2 Lots of little changes to libretroshare. Improvements mainly focused
on configuration storage and loading:
 * Improved Configuration Manager (almost finished)
 * Mutex protections for Configuration system
 * added Configuration storage to p3ConnectMgr.
 * added Configuration storage to p3MsgService.
 * bugfixes in p3GeneralConfig.
 * Added Config Save notification where necessary.
 * added safe FinalConfigSave before exit().
 * added RsPeerNetItem + RsPeerStunItem (serialiser)
 * reordered startup for correct config loading.
 * enabled Loading of certs in AuthXPGP.
 * move sockaddr_clear() to util/rsnet.h
 * switched p3MsgService sendMessage checking to pqiMonitor syste,.
 * corrected pqiarchive saving of PeerIds.
 * added setNetworkMode() & setVisState() to p3ConnectMgr.
 * added Mutex protection to p3ranking.



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@336 b45a01b8-16f6-495d-af2f-9b41ad6348cc
2008-02-07 16:18:34 +00:00

66 lines
1.5 KiB
C++

/*
* "$Id: pqiindic.h,v 1.3 2007-02-18 21:46:49 rmf24 Exp $"
*
* 3P/PQI network interface for RetroShare.
*
* Copyright 2004-2006 by Robert Fernie.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License Version 2 as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems to "retroshare@lunamutt.com".
*
*/
#ifndef MRK_PQI_INDICATOR_HEADER
#define MRK_PQI_INDICATOR_HEADER
#include <vector>
// This will indicate to num different sources
// when the event has occured.
class Indicator
{
public:
Indicator(uint16_t n = 1)
:num(n), changeFlags(n) {IndicateChanged();}
void IndicateChanged()
{
for(uint16_t i = 0; i < num; i++)
changeFlags[i]=true;
}
bool Changed(uint16_t idx = 0)
{
/* catch overflow */
if (idx > num - 1)
return false;
bool ans = changeFlags[idx];
changeFlags[idx] = false;
return ans;
}
private:
uint16_t num;
std::vector<bool> changeFlags;
};
#endif