mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-17 10:31:05 -04:00
Created V0.3.x branch and moved the head into the trunk directory.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@246 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
commit
935745a08e
1318 changed files with 348809 additions and 0 deletions
87
libretroshare/src/pqi/pqiarchive.h
Normal file
87
libretroshare/src/pqi/pqiarchive.h
Normal file
|
@ -0,0 +1,87 @@
|
|||
/*
|
||||
* "$Id: pqiarchive.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_ARCHIVE_STREAMER_HEADER
|
||||
#define MRK_PQI_ARCHIVE_STREAMER_HEADER
|
||||
|
||||
// Only dependent on the base stuff.
|
||||
#include "pqi/pqi_base.h"
|
||||
|
||||
/**************** PQI_USE_XPGP ******************/
|
||||
#if defined(PQI_USE_XPGP)
|
||||
#include "pqi/xpgpcert.h"
|
||||
#else /* X509 Certificates */
|
||||
/**************** PQI_USE_XPGP ******************/
|
||||
#include "pqi/sslcert.h"
|
||||
#endif /* X509 Certificates */
|
||||
/**************** PQI_USE_XPGP ******************/
|
||||
|
||||
#include <list>
|
||||
|
||||
/*******************************************************************
|
||||
* pqiarchive provides an archive stream.
|
||||
* This stores PQItem + Person Reference + Timestamp,
|
||||
*
|
||||
* and allows Objects to be replayed or restored,
|
||||
* independently of the rest of the pqi system.
|
||||
*
|
||||
*/
|
||||
|
||||
class pqiarchive: PQInterface
|
||||
{
|
||||
public:
|
||||
pqiarchive(BinInterface *bio_in, int bio_flagsin, sslroot *);
|
||||
virtual ~pqiarchive();
|
||||
|
||||
// PQInterface
|
||||
virtual int SendItem(PQItem *);
|
||||
virtual PQItem *GetItem();
|
||||
|
||||
virtual int tick();
|
||||
virtual int status();
|
||||
|
||||
virtual void setRealTime(bool r) { realTime = r; }
|
||||
private:
|
||||
int writePkt(PQItem *item);
|
||||
int readPkt(PQItem **item_out, long *ts);
|
||||
|
||||
// Binary Interface for IO, initialisated at startup.
|
||||
BinInterface *bio;
|
||||
unsigned int bio_flags; // only BIN_NO_CLOSE at the moment.
|
||||
|
||||
// Temp Storage for transient data.....
|
||||
PQItem *nextPkt;
|
||||
long nextPktTS; /* timestamp associated with nextPkt */
|
||||
long firstPktTS; /* timestamp associated with first read Pkt */
|
||||
long initTS; /* clock timestamp at first read */
|
||||
sslroot *sslr;
|
||||
|
||||
bool realTime;
|
||||
};
|
||||
|
||||
|
||||
#endif //MRK_PQI_ARCHIVE_STREAMER_HEADER
|
Loading…
Add table
Add a link
Reference in a new issue