Loading...
Searching...
No Matches
quadruple.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
// $Id: quadruple.h,v 1.13 2003/08/26 08:04:11 oliver Exp $
//
#ifndef BALL_DATATYPE_QUADRUPLE_H
#define BALL_DATATYPE_QUADRUPLE_H
#ifndef BALL_COMMON_H
# include <BALL/common.h>
#endif
namespace BALL
{
template <typename T1, typename T2, typename T3, typename T4>
class Quadruple
{
public:
BALL_CREATE(Quadruple)
Quadruple();
Quadruple(const Quadruple& quadruple, bool deep = true);
Quadruple(const T1& new_first, const T2& new_second,
const T3& new_third, const T4& new_fourth);
virtual ~Quadruple();
virtual void clear();
const Quadruple& operator = (const Quadruple& quadruple);
void set(const T1& t1, const T2& t2, const T3& t3, const T4& t4);
void get(T1& first, T2& second, T3& third, T4& fourth) const;
bool operator == (const Quadruple& quadruple) const;
bool operator != (const Quadruple& quadruple) const;
bool operator < (const Quadruple& quadruple) const;
bool operator <= (const Quadruple& quadruple) const;
bool operator >= (const Quadruple& quadruple) const;
bool operator > (const Quadruple& quadruple) const;
T1 first;
T2 second;
T3 third;
T4 fourth;
};
template <typename T1, typename T2, typename T3, typename T4>
Quadruple<T1, T2, T3, T4>::Quadruple()
{
}
template <typename T1, typename T2, typename T3, typename T4>
Quadruple<T1, T2, T3, T4>::Quadruple
(const Quadruple<T1, T2, T3, T4>& quadruple, bool /* deep */)
: first(quadruple.first),
second(quadruple.second),
third(quadruple.third),
fourth(quadruple.fourth)
{
}
template <typename T1, typename T2, typename T3, typename T4>
Quadruple<T1, T2, T3, T4>::Quadruple
(const T1& new_first, const T2& new_second, const T3& new_third, const T4& fourth)
: first(new_first),
second(new_second),
third(new_third),
fourth(fourth)
{
}
template <typename T1, typename T2, typename T3, typename T4>
Quadruple<T1, T2, T3, T4>::~Quadruple()
{
}
template <typename T1, typename T2, typename T3, typename T4>
BALL_INLINE
void Quadruple<T1, T2, T3, T4>::set(const T1& new_first, const T2& new_second, const T3& new_third, const T4& new_fourth)
{
first = new_first;
second = new_second;
third = new_third;
fourth = new_fourth;
}
template <typename T1, typename T2, typename T3, typename T4>
BALL_INLINE
const Quadruple<T1, T2, T3, T4>& Quadruple<T1, T2, T3, T4>::operator =
(const Quadruple<T1, T2, T3, T4>& quadruple)
{
first = quadruple.first;
second = quadruple.second;
third = quadruple.third;
fourth = quadruple.fourth;
return *this;
}
template <typename T1, typename T2, typename T3, typename T4>
BALL_INLINE
void Quadruple<T1, T2, T3, T4>::get(T1& t1, T2& t2, T3& t3, T4& t4) const
{
t1 = first;
t2 = second;
t3 = third;
t4 = fourth;
}
template <typename T1, typename T2, typename T3, typename T4>
BALL_INLINE
bool Quadruple<T1, T2, T3, T4>::operator == (const Quadruple& quadruple) const
{
return (first == quadruple.first
&& second == quadruple.second
&& third == quadruple.third
&& fourth == quadruple.fourth);
}
template <typename T1, typename T2, typename T3, typename T4>
BALL_INLINE
bool Quadruple<T1, T2, T3, T4>::operator != (const Quadruple& quadruple) const
{
return (first != quadruple.first
|| second != quadruple.second
|| third != quadruple.third
|| fourth != quadruple.fourth);
}
template <typename T1, typename T2, typename T3, typename T4>
BALL_INLINE
void Quadruple<T1, T2, T3, T4>::clear()
{
first = T1();
second = T2();
third = T3();
fourth = T4();
}
template <typename T1, typename T2, typename T3, typename T4>
BALL_INLINE
bool Quadruple<T1, T2, T3, T4>::operator <
(const Quadruple<T1, T2, T3, T4>& quadruple) const
{
return (first < quadruple.first ||
(first == quadruple.first && second < quadruple.second) ||
(first == quadruple.first && second == quadruple.second && third < quadruple.third) ||
(first == quadruple.first && second == quadruple.second && third == quadruple.third
&& fourth < quadruple.fourth));
}
template <typename T1, typename T2, typename T3, typename T4>
BALL_INLINE
bool Quadruple<T1, T2, T3, T4>::operator <=
(const Quadruple<T1, T2, T3, T4>& quadruple) const
{
return (first < quadruple.first ||
(first == quadruple.first && second < quadruple.second) ||
(first == quadruple.first && second == quadruple.second && third < quadruple.third) ||
(first == quadruple.first && second == quadruple.second && third == quadruple.third
&& fourth <= quadruple.fourth));
}
template <typename T1, typename T2, typename T3, typename T4>
BALL_INLINE
bool Quadruple<T1, T2, T3, T4>::operator >=
(const Quadruple<T1, T2, T3, T4>& quadruple) const
{
return (first > quadruple.first ||
(first == quadruple.first && second > quadruple.second) ||
(first == quadruple.first && second == quadruple.second && third > quadruple.third) ||
(first == quadruple.first && second == quadruple.second && third == quadruple.third
&& fourth >= quadruple.fourth));
}
template <typename T1, typename T2, typename T3, typename T4>
BALL_INLINE
bool Quadruple<T1, T2, T3, T4>::operator >
(const Quadruple<T1, T2, T3, T4>& quadruple) const
{
return (first > quadruple.first ||
(first == quadruple.first && second > quadruple.second) ||
(first == quadruple.first && second == quadruple.second && third > quadruple.third) ||
(first == quadruple.first && second == quadruple.second && third == quadruple.third
&& fourth > quadruple.fourth));
}
} // namespace BALL
#endif // BALL_DATATYPE_QUADRUPLE_H
BALL::Quadruple< String, PDB::Character, PDB::Integer, PDB::AChar >::clear
virtual void clear()
BALL::Quadruple::~Quadruple
virtual ~Quadruple()
Definition quadruple.h:166
BALL::Quadruple< String, PDB::Character, PDB::Integer, PDB::AChar >::first
String first
Definition quadruple.h:124
BALL::Quadruple< String, PDB::Character, PDB::Integer, PDB::AChar >::set
void set(const String &t1, const PDB::Character &t2, const PDB::Integer &t3, const PDB::AChar &t4)
BALL::Quadruple< String, PDB::Character, PDB::Integer, PDB::AChar >::fourth
PDB::AChar fourth
Definition quadruple.h:136
BALL::Quadruple< String, PDB::Character, PDB::Integer, PDB::AChar >::third
PDB::Integer third
Definition quadruple.h:132
BALL::Quadruple::operator!=
bool operator!=(const Quadruple &quadruple) const
Definition quadruple.h:216
BALL::Quadruple::operator==
bool operator==(const Quadruple &quadruple) const
Definition quadruple.h:206
BALL::Quadruple::Quadruple
Quadruple()
Definition quadruple.h:141
BALL::Quadruple< String, PDB::Character, PDB::Integer, PDB::AChar >::second
PDB::Character second
Definition quadruple.h:128
BALL::Quadruple< String, PDB::Character, PDB::Integer, PDB::AChar >::get
void get(String &first, PDB::Character &second, PDB::Integer &third, PDB::AChar &fourth) const
common.h
BALL_CREATE
#define BALL_CREATE(name)
Definition create.h:62
BALL_INLINE
#define BALL_INLINE
Definition debug.h:15
BALL
Definition constants.h:13