ATLAS Offline Software
Loading...
Searching...
No Matches
TestClassSTLContainersExt Class Reference

#include <TestClassSTLContainersExt.h>

Collaboration diagram for TestClassSTLContainersExt:

Public Member Functions

 TestClassSTLContainersExt ()=default
void setNonZero ()
bool operator== (const TestClassSTLContainersExt &rhs) const
bool operator!= (const TestClassSTLContainersExt &rhs) const
std::ostream & streamOut (std::ostream &os) const

Public Attributes

std::list< double > m_list_of_double
std::deque< float > m_deque_of_float

Detailed Description

Definition at line 14 of file TestClassSTLContainersExt.h.

Constructor & Destructor Documentation

◆ TestClassSTLContainersExt()

TestClassSTLContainersExt::TestClassSTLContainersExt ( )
default

Member Function Documentation

◆ operator!=()

bool TestClassSTLContainersExt::operator!= ( const TestClassSTLContainersExt & rhs) const
inline

Definition at line 85 of file TestClassSTLContainersExt.h.

86{
87 return ( ( (*this) == rhs ) ? false : true );
88}

◆ operator==()

bool TestClassSTLContainersExt::operator== ( const TestClassSTLContainersExt & rhs) const
inline

Definition at line 58 of file TestClassSTLContainersExt.h.

59{
60 // Check first the sizes of the containers
61 if ( m_list_of_double.size() != rhs.m_list_of_double.size() ) return false;
62 if ( m_deque_of_float.size() != rhs.m_deque_of_float.size() ) return false;
63
64 // Check element by element.
65 std::list< double >::const_iterator this_i_list_of_double = m_list_of_double.begin();
66 std::list< double >::const_iterator rhs_i_list_of_double = rhs.m_list_of_double.begin();
67 while ( this_i_list_of_double != m_list_of_double.end() ) {
68 if ( *this_i_list_of_double != *rhs_i_list_of_double ) return false;
69 ++this_i_list_of_double;
70 ++rhs_i_list_of_double;
71 }
72
73 std::deque< float >::const_iterator this_i_deque_of_float = m_deque_of_float.begin();
74 std::deque< float >::const_iterator rhs_i_deque_of_float = rhs.m_deque_of_float.begin();
75 while ( this_i_deque_of_float != m_deque_of_float.end() ) {
76 if ( *this_i_deque_of_float != *rhs_i_deque_of_float ) return false;
77 ++this_i_deque_of_float;
78 ++rhs_i_deque_of_float;
79 }
80
81 return true;
82}

◆ setNonZero()

void TestClassSTLContainersExt::setNonZero ( )
inline

Definition at line 30 of file TestClassSTLContainersExt.h.

31{
32 m_list_of_double.clear();
33 m_list_of_double.push_back( 2 );
34 m_list_of_double.push_back( 3 );
35 m_deque_of_float.clear();
36 m_deque_of_float.push_back( 9 );
37 m_deque_of_float.push_front( 10 );
38}

◆ streamOut()

std::ostream & TestClassSTLContainersExt::streamOut ( std::ostream & os) const
inline

Definition at line 41 of file TestClassSTLContainersExt.h.

42{
43 os << "m_list_of_double( " << m_list_of_double.size() << " ) :";
44 for ( std::list< double >::const_iterator i = m_list_of_double.begin();
45 i != m_list_of_double.end(); ++i ) {
46 os << " " << *i;
47 }
48 os << std::endl;
49 os << "m_deque_of_float( " << m_deque_of_float.size() << " ) :";
50 for ( std::deque< float >::const_iterator i = m_deque_of_float.begin();
51 i != m_deque_of_float.end(); ++i ) {
52 os << " " << *i;
53 }
54 return os;
55}

Member Data Documentation

◆ m_deque_of_float

std::deque< float > TestClassSTLContainersExt::m_deque_of_float

Definition at line 25 of file TestClassSTLContainersExt.h.

◆ m_list_of_double

std::list< double > TestClassSTLContainersExt::m_list_of_double

Definition at line 24 of file TestClassSTLContainersExt.h.


The documentation for this class was generated from the following file: