2 Author: Marco Costalba (C) 2005-2007
3 Author: TortoiseGit (C) 2013
5 Copyright: See COPYING file that comes with this distribution
15 #define QVector std::vector
17 typedef std::vector
<CGitHash
> CGitHashList
;
45 BOUNDARY_C
, // corresponds to MERGE_FORK
46 BOUNDARY_R
, // corresponds to MERGE_FORK_R
47 BOUNDARY_L
, // corresponds to MERGE_FORK_L
54 static inline bool isHead(int x
) { return (x
== HEAD
|| x
== HEAD_R
|| x
== HEAD_L
); }
55 static inline bool isTail(int x
) { return (x
== TAIL
|| x
== TAIL_R
|| x
== TAIL_L
); }
56 static inline bool isJoin(int x
) { return (x
== JOIN
|| x
== JOIN_R
|| x
== JOIN_L
); }
57 static inline bool isFreeLane(int x
) { return (x
== NOT_ACTIVE
|| x
== CROSS
|| isJoin(x
)); }
58 static inline bool isBoundary(int x
) { return (x
== BOUNDARY
|| x
== BOUNDARY_C
||
59 x
== BOUNDARY_R
|| x
== BOUNDARY_L
); }
60 static inline bool isMerge(int x
) { return (x
== MERGE_FORK
|| x
== MERGE_FORK_R
||
61 x
== MERGE_FORK_L
|| isBoundary(x
)); }
62 static inline bool isActive(int x
) { return (x
== ACTIVE
|| x
== INITIAL
|| x
== BRANCH
||
65 Lanes() // init() will setup us later, when data is available
72 bool isEmpty() { return typeVec
.empty(); }
73 void init(const CGitHash
& expectedSha
);
75 bool isFork(const CGitHash
& sha
, bool& isDiscontinuity
);
76 void setBoundary(bool isBoundary
);
77 void setFork(const CGitHash
& sha
);
78 void setMerge(const CGitHashList
& parents
);
81 void changeActiveLane(const CGitHash
& sha
);
87 void nextParent(const CGitHash
& sha
);
88 void getLanes(QVector
<int> &ln
) { ln
= typeVec
; } // O(1) vector is implicitly shared
91 int findNextSha(const CGitHash
& next
, int pos
);
92 int findType(int type
, int pos
);
93 int add(int type
, const CGitHash
& next
, int pos
, bool& wasEmptyCross
);
97 QVector
<CGitHash
> nextShaVec
;
99 int NODE
, NODE_L
, NODE_R
;