#include "TObjArray.h"
///
+/// \class AliMUON1DArray
/// This class is simply a wrapper to a TObjArray, offering in addition a
/// control over the replacement policy when you add
/// something to it.
///
+/// \author Laurent Aphecetche
+/// \cond CLASSIMP
ClassImp(AliMUON1DArray)
+/// \endcond
//_____________________________________________________________________________
AliMUON1DArray::AliMUON1DArray(Int_t theSize)
: AliMUONV1DStore(),
fArray(0x0)
{
- //
- // Default ctor
- //
+/// Default ctor
+
if ( theSize )
{
fArray = new TObjArray(theSize);
: AliMUONV1DStore(),
fArray(0x0)
{
+/// Copy constructor
+
other.CopyTo(*this);
}
AliMUON1DArray&
AliMUON1DArray::operator=(const AliMUON1DArray& other)
{
+/// Assignment operator
+
other.CopyTo(*this);
return *this;
}
//_____________________________________________________________________________
AliMUON1DArray::~AliMUON1DArray()
{
- //
- // dtor, we're the owner of our internal array.
- //
+/// dtor, we're the owner of our internal array.
+
delete fArray;
}
void
AliMUON1DArray::CopyTo(AliMUON1DArray& dest) const
{
- //
- // Make a deep copy
- //
+/// Make a deep copy
+
delete dest.fArray;
dest.fArray = new TObjArray;
dest.fArray->SetOwner(kTRUE);
TObject*
AliMUON1DArray::Get(Int_t i) const
{
- //
- // Get the object located at index i, if it exists, and if i is correct.
- //
+/// Get the object located at index i, if it exists, and if i is correct.
+
if ( i >= 0 && i < fArray->GetSize() )
{
return fArray->At(i);
Bool_t
AliMUON1DArray::Set(Int_t i, TObject* object, Bool_t replace)
{
- //
- // Set the object located at i
- // If replace=kFALSE and there's already an object at location i,
- // this method fails and returns kFALSE, otherwise it returns kTRUE
- //
+/// Set the object located at i
+/// If replace=kFALSE and there's already an object at location i,
+/// this method fails and returns kFALSE, otherwise it returns kTRUE
+
if ( i >= 0 && i < fArray->GetSize() )
{
TObject* o = Get(i);