ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
TCvecPtr Class Reference

#include <TestClass.h>

Inheritance diagram for TCvecPtr:
Collaboration diagram for TCvecPtr:

Public Member Functions

 TCvecPtr ()
 
 TCvecPtr (const int i)
 
void Set (const int i)
 
 ~TCvecPtr ()
 
void print () const
 
std::string getKey () const
 
bool isEqual (const TestClass *otherobj) const
 

Public Attributes

std::vector< int * > my_ptrint
 
std::string key
 

Detailed Description

Definition at line 493 of file TestClass.h.

Constructor & Destructor Documentation

◆ TCvecPtr() [1/2]

TCvecPtr::TCvecPtr ( )
inline

Definition at line 498 of file TestClass.h.

498 {}

◆ TCvecPtr() [2/2]

TCvecPtr::TCvecPtr ( const int  i)
inline

Definition at line 499 of file TestClass.h.

499  { Set(i);
500 
501  }

◆ ~TCvecPtr()

TCvecPtr::~TCvecPtr ( )
inline

Definition at line 509 of file TestClass.h.

509  {
510  const int siz = my_ptrint.size();
511  for (int j=0; j<siz; j++) delete my_ptrint.at(j);
512  }

Member Function Documentation

◆ getKey()

std::string TCvecPtr::getKey ( ) const
inlinevirtual

Reimplemented from TestClass.

Definition at line 523 of file TestClass.h.

523  {
524  return("TCvecPtr");
525 
526  }

◆ isEqual()

bool TCvecPtr::isEqual ( const TestClass otherobj) const
inlinevirtual

Implements TestClass.

Definition at line 528 of file TestClass.h.

528  {
529 
530  TCvecPtr *tc = (TCvecPtr *)otherobj;
531  for(unsigned int j=0; j<my_ptrint.size(); j++){
532  if(tc->my_ptrint.at(j)){
533 
534  }
535  else{
536  return false;
537  }
538  }
539  return true;
540  }

◆ print()

void TCvecPtr::print ( ) const
inlinevirtual

Implements TestClass.

Definition at line 514 of file TestClass.h.

514  {
515  std::cout <<"Output::"<< getKey() << " vector of pointer to integers: ";
516  const int maxsiz = (my_ptrint.size()<5 ? my_ptrint.size() : 5);
517  // std::cout << "maxsiz=" << maxsiz "\t";
518  for (int i=0; i<maxsiz; i++)
519  std::cout << *(my_ptrint.at(i)) << "\t";
520  std::cout << std::endl;
521  }

◆ Set()

void TCvecPtr::Set ( const int  i)
inline

Definition at line 503 of file TestClass.h.

503  {
504  for (int j=0; j<i; j++){
505  my_ptrint.push_back(new int(j+i*10));
506  }
507  }

Member Data Documentation

◆ key

std::string TestClass::key
inherited

Definition at line 19 of file TestClass.h.

◆ my_ptrint

std::vector<int*> TCvecPtr::my_ptrint

Definition at line 495 of file TestClass.h.


The documentation for this class was generated from the following file:
TCvecPtr::getKey
std::string getKey() const
Definition: TestClass.h:523
lumiFormat.i
int i
Definition: lumiFormat.py:92
TCvecPtr
Definition: TestClass.h:493
TCvecPtr::Set
void Set(const int i)
Definition: TestClass.h:503
TCvecPtr::my_ptrint
std::vector< int * > my_ptrint
Definition: TestClass.h:495