jnltrack.h #1

  • //
  • guest/
  • perforce_software/
  • p4/
  • 2016-1/
  • support/
  • jnltrack.h
  • View
  • Commits
  • Open Download .zip Download (900 B)
/*
 * Copyright 1995, 2009 Perforce Software.  All rights reserved.
 *
 * This file is part of Perforce - the FAST SCM System.
 */

class JnlTracker {

    public:
	JnlTracker();

	enum Kind { MIDDLE, END };

	// Returns 1 if at a consistency point, 0 otherwise
	int	Marker( long pid, Kind kind );

	int	MarkerCount( Kind kind ) const
		    { return markcnt[ kind ]; }

	int	ConsistentCount() const { return consistentcnt; }

	int	MaxCount() const { return maxpids; }

	int	XactCount() const { return npids; }

	int	AtStartOfRecord() const { return scanstate == 0; }

	void	ScanJournal( const char *, int, const char **xact = 0 );

	void	Clear();

	void	Restart() { npids = 0; }

	int	SawJournalTrailer();

    private:
	IntArray	pids;
	int		npids;
	int		markcnt[2];
	int		consistentcnt;
	int		sawJTrailer;
	int		maxpids;

	// for journal scanning
	int		scanstate;
	int		scanpid;
	Kind		scankind;
};
# Change User Description Committed
#1 19472 Liz Lam Initial add of the 2016.1 p4/p4api source code.