+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
// $Id$
+// $MpId: AliMpIntPair.cxx,v 1.6 2006/03/17 11:34:46 ivana Exp $
// Category: basic
//
// Class AliMpIntPair
// Included in AliRoot: 2003/05/02
// Authors: David Guez, Ivana Hrivnacova; IPN Orsay
-#include <Riostream.h>
-
#include "AliMpIntPair.h"
+#include <Riostream.h>
+
ClassImp(AliMpIntPair)
: TObject(),
fFirst(ix),
fSecond(iy),
- fValidity(true) {
-//
+ fValidity(true)
+{
+/// Standard constructor
}
//_____________________________________________________________________________
: TObject(),
fFirst(ix),
fSecond(iy),
- fValidity(validity) {
-//
+ fValidity(validity)
+{
+/// Standard constructor with validity argument
}
//_____________________________________________________________________________
//fSecond(9999),
fFirst(0),
fSecond(0),
- fValidity(false) {
-//
+ fValidity(false)
+{
+/// Default constructor
}
+
//_____________________________________________________________________________
AliMpIntPair::AliMpIntPair(const AliMpIntPair& src):
TObject(src),
fSecond(src.fSecond),
fValidity(src.fValidity)
{
-
+/// Copy constructor
}
//_____________________________________________________________________________
-AliMpIntPair::~AliMpIntPair() {
-//
+AliMpIntPair::~AliMpIntPair()
+{
+/// Destructor
}
//_____________________________________________________________________________
Bool_t AliMpIntPair::operator< (const AliMpIntPair& pos2) const
{
+/// Less operator
+
// fFirst prior to fSecond
if (fFirst<pos2.fFirst) return kTRUE;
if (fFirst>pos2.fFirst) return kFALSE;
//_____________________________________________________________________________
Bool_t AliMpIntPair::operator== (const AliMpIntPair& pos2) const
{
+/// Equality operator
+
// are this and pos2 equals?
// one valid, one invalid
//_____________________________________________________________________________
Bool_t AliMpIntPair::operator!= (const AliMpIntPair& pos2) const
{
+/// Non-equality operator
+
// are this and pos2 equals?
return !(*this == pos2);
}
//_____________________________________________________________________________
AliMpIntPair& AliMpIntPair::operator=(const AliMpIntPair& src)
{
- // check assignement to self
+/// Assignment operator
+
+ // check assignment to self
if (this == &src) return *this;
- // base class assignement
+ // base class assignment
TObject::operator=(src);
- // assignement operator
+ // assignment operator
fFirst = src.fFirst;
fSecond = src.fSecond;
fValidity = src.fValidity;
//_____________________________________________________________________________
void AliMpIntPair::operator += (const AliMpIntPair& op)
{
- // incrementation operator
+/// Incrementation operator
+
fFirst += op.fFirst;
fSecond += op.fSecond;
//_____________________________________________________________________________
void AliMpIntPair::operator -= (const AliMpIntPair& op)
{
- // decrementation operator
+/// Decrementation operator
+
fFirst -= op.fFirst;
fSecond -= op.fSecond;
//_____________________________________________________________________________
AliMpIntPair operator-(const AliMpIntPair& op1,const AliMpIntPair& op2)
{
+/// Substraction operator
+
return AliMpIntPair(op1.GetFirst()-op2.GetFirst(),
op1.GetSecond()-op2.GetSecond(),
op1.IsValid() && op2.IsValid());
//_____________________________________________________________________________
AliMpIntPair operator+(const AliMpIntPair& op1,const AliMpIntPair& op2)
{
+/// Addition operator
+
return AliMpIntPair(op1.GetFirst()+op2.GetFirst(),
op1.GetSecond()+op2.GetSecond(),
op1.IsValid() && op2.IsValid());
//_____________________________________________________________________________
AliMpIntPair operator*(const AliMpIntPair& op1,const AliMpIntPair& op2)
{
+/// Multiplication operator
+
return AliMpIntPair(op1.GetFirst()*op2.GetFirst(),
op1.GetSecond()*op2.GetSecond(),
op1.IsValid() && op2.IsValid());
//_____________________________________________________________________________
ostream& operator<< (ostream &stream,const AliMpIntPair& op)
{
+/// Output streaming
+
if (op.IsValid()) {
stream << '(';
stream << op.GetFirst()<<','<<op.GetSecond()<<')';