AcUtils
A high performance abstraction layer for AccuRev
Public Member Functions | Internal Functions | Properties | List of all members
AcUtils.AcLock Class Reference

A lock object that defines the attributes of an AccuRev lock: The stream name the lock is on and manner (from, to, all), the principal name and type it applies to, and how it's applied (except-for, only-for). More...

Collaboration diagram for AcUtils.AcLock:
Collaboration graph
[legend]

Public Member Functions

string ToString (string format, IFormatProvider provider)
 The ToString implementation. More...
 
Equality comparison
bool Equals (AcLock other)
 IEquatable implementation to determine the equality of instances of type AcLock. Uses stream name the lock is on and manner (from, to, all) to compare instances. More...
 
override bool Equals (object other)
 Overridden to determine equality. More...
 
override int GetHashCode ()
 Override appropriate for type AcLock. More...
 

Internal Functions

 AcLock ()
 Constructor used during AcLocks list construction. It is called internally and not by user code. More...
 

Properties

LockKind Kind [get, set]
 Kind of AccuRev lock: from, to, or all. More...
 
string Name [get, set]
 Name of stream the lock applies to. More...
 
PrinType Type [get, set]
 Whether the lock is for a user or group. More...
 
string ExceptFor [get, set]
 Lock applies to all except this principal. More...
 
string OnlyFor [get, set]
 Lock applies only to this principal. More...
 
string Comment [get, set]
 Comment given to the lock. More...
 

Order comparison

int CompareTo (AcLock other)
 Generic IComparable implementation (default) for comparing AcLock objects to sort by LockKind (descending) then stream name. More...
 
int IComparable. CompareTo (object other)
 Pre-generic interface implementation for code using reflection. More...
 

Detailed Description

A lock object that defines the attributes of an AccuRev lock: The stream name the lock is on and manner (from, to, all), the principal name and type it applies to, and how it's applied (except-for, only-for).

AcLock objects are instantiated during AcLocks construction.

Definition at line 83 of file AcLocks.cs.

Constructor & Destructor Documentation

AcUtils.AcLock.AcLock ( )
inlinepackage

Constructor used during AcLocks list construction. It is called internally and not by user code.

Definition at line 99 of file AcLocks.cs.

Referenced by AcUtils.AcLock.CompareTo().

Member Function Documentation

int AcUtils.AcLock.CompareTo ( AcLock  other)
inline

Generic IComparable implementation (default) for comparing AcLock objects to sort by LockKind (descending) then stream name.

Parameters
otherAn AcLock object to compare with this instance.
Returns
Value indicating the relative order of the AcLock objects being compared.
See also
OrderBy example

Definition at line 154 of file AcLocks.cs.

Referenced by AcUtils.AcLock.CompareTo().

int IComparable. AcUtils.AcLock.CompareTo ( object  other)
inlineprivate

Pre-generic interface implementation for code using reflection.

Parameters
otherAn AcLock object to compare with this instance.
Returns
Return value of generic CompareTo(AcLock) version.
Exceptions
ArgumentExceptionthrown if argument is not an AcLock object.

Definition at line 175 of file AcLocks.cs.

bool AcUtils.AcLock.Equals ( AcLock  other)
inline

IEquatable implementation to determine the equality of instances of type AcLock. Uses stream name the lock is on and manner (from, to, all) to compare instances.

Parameters
otherThe AcLock object being compared to this instance.
Returns
true if AcLock other is the same, false otherwise.

Definition at line 110 of file AcLocks.cs.

Referenced by AcUtils.AcLock.Equals().

override bool AcUtils.AcLock.Equals ( object  other)
inline

Overridden to determine equality.

Returns
Return value of generic Equals(AcLock) version.

Definition at line 124 of file AcLocks.cs.

override int AcUtils.AcLock.GetHashCode ( )
inline

Override appropriate for type AcLock.

Returns
Hash of stream name and LockKind.

Definition at line 136 of file AcLocks.cs.

string AcUtils.AcLock.ToString ( string  format,
IFormatProvider  provider 
)
inline

The ToString implementation.

Parameters
formatThe format specifier to use, e.g. Console.WriteLine(rule.ToString("e"));
providerAllow clients to format output for their own types using ICustomFormatter.
Returns
The formatted string.
Exceptions
FormatExceptionthrown if an invalid format string is specified.
Format specifiers:
  • G Default when not using a format specifier.
  • K Kind - Kind of AccuRev lock: from, to, or all.
  • N Name - Name of stream the lock applies to.
  • T Type - Whether the lock is for a user or group.
  • E ExceptFor - Lock applies to all except this principal.
  • O OnlyFor - Lock applies only to this principal.
  • C Comment - Comment given to the lock.

Definition at line 255 of file AcLocks.cs.

Property Documentation

string AcUtils.AcLock.Comment
getset

Comment given to the lock.

Definition at line 234 of file AcLocks.cs.

Referenced by AcUtils.AcLocks.initList().

string AcUtils.AcLock.ExceptFor
getset

Lock applies to all except this principal.

Definition at line 216 of file AcLocks.cs.

Referenced by AcUtils.AcLocks.initList().

LockKind AcUtils.AcLock.Kind
getset

Kind of AccuRev lock: from, to, or all.

Definition at line 189 of file AcLocks.cs.

Referenced by AcUtils.AcLock.CompareTo(), AcUtils.AcLock.GetHashCode(), and AcUtils.AcLocks.initList().

string AcUtils.AcLock.Name
getset

Name of stream the lock applies to.

Definition at line 198 of file AcLocks.cs.

Referenced by AcUtils.AcLock.CompareTo(), AcUtils.AcLock.GetHashCode(), and AcUtils.AcLocks.initList().

string AcUtils.AcLock.OnlyFor
getset

Lock applies only to this principal.

Definition at line 225 of file AcLocks.cs.

Referenced by AcUtils.AcLocks.initList().

PrinType AcUtils.AcLock.Type
getset

Whether the lock is for a user or group.

Definition at line 207 of file AcLocks.cs.

Referenced by AcUtils.AcLocks.initList().