Jpp  16.0.0-rc.2
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Public Attributes | Friends | List of all members
JTOOLS::JTuple< T > Struct Template Reference

Template data structure. More...

#include <JTuple.hh>

Inheritance diagram for JTOOLS::JTuple< T >:
JMATH::JMath< JFirst_t, JSecond_t > JLANG::JComparable< JFirst_t, JSecond_t >

Public Types

typedef JTypeList< Ttypelist
 

Public Member Functions

 JTuple ()
 Default constructor. More...
 
 JTuple (typename JClass< T >::argument_type __first)
 Constructor. More...
 
JTuplenegate ()
 Negate tuple. More...
 
JTupleadd (const JTuple &tuple)
 Add tuple. More...
 
JTuplesub (const JTuple &tuple)
 Subtract tuple. More...
 
JTuplemul (const double factor)
 Scale tuple. More...
 
JTuplediv (const double factor)
 Scale tuple. More...
 
bool less (const JTuple &tuple) const
 Compare tuple. More...
 
JFirst_t & mul (const JSecond_t &object)
 Multiply with object. More...
 

Public Attributes

T first
 

Friends

std::istream & operator>> (std::istream &in, JTuple &tuple)
 Read tuple from input. More...
 
std::ostream & operator<< (std::ostream &out, const JTuple &tuple)
 Write tuple to output. More...
 
JReaderoperator>> (JReader &in, JTuple &tuple)
 Read tuple from input. More...
 
JWriteroperator<< (JWriter &out, const JTuple &tuple)
 Write tuple to output. More...
 

Detailed Description

template<class T>
struct JTOOLS::JTuple< T >

Template data structure.

Definition at line 44 of file JTuple.hh.

Member Typedef Documentation

template<class T>
typedef JTypeList<T> JTOOLS::JTuple< T >::typelist

Definition at line 49 of file JTuple.hh.

Constructor & Destructor Documentation

template<class T>
JTOOLS::JTuple< T >::JTuple ( )
inline

Default constructor.

Definition at line 54 of file JTuple.hh.

55  {}
template<class T>
JTOOLS::JTuple< T >::JTuple ( typename JClass< T >::argument_type  __first)
inline

Constructor.

Parameters
__firstfirst

Definition at line 63 of file JTuple.hh.

63  :
64  first(__first)
65  {}

Member Function Documentation

template<class T>
JTuple& JTOOLS::JTuple< T >::negate ( )
inline

Negate tuple.

Returns
this tuple

Definition at line 73 of file JTuple.hh.

74  {
75  first = -first;
76 
77  return *this;
78  }
template<class T>
JTuple& JTOOLS::JTuple< T >::add ( const JTuple< T > &  tuple)
inline

Add tuple.

Parameters
tupletuple
Returns
this tuple

Definition at line 87 of file JTuple.hh.

88  {
89  first += tuple.first;
90 
91  return *this;
92  }
template<class T>
JTuple& JTOOLS::JTuple< T >::sub ( const JTuple< T > &  tuple)
inline

Subtract tuple.

Parameters
tupletuple
Returns
this tuple

Definition at line 101 of file JTuple.hh.

102  {
103  first -= tuple.first;
104 
105  return *this;
106  }
template<class T>
JTuple& JTOOLS::JTuple< T >::mul ( const double  factor)
inline

Scale tuple.

Parameters
factormultiplication factor
Returns
this tuple

Definition at line 115 of file JTuple.hh.

116  {
117  first *= factor;
118 
119  return *this;
120  }
template<class T>
JTuple& JTOOLS::JTuple< T >::div ( const double  factor)
inline

Scale tuple.

Parameters
factordivision factor
Returns
this tuple

Definition at line 129 of file JTuple.hh.

130  {
131  first /= factor;
132 
133  return *this;
134  }
template<class T>
bool JTOOLS::JTuple< T >::less ( const JTuple< T > &  tuple) const
inline

Compare tuple.

Parameters
tupletuple
Returns
true if this tuple less than given tuple; else false

Definition at line 143 of file JTuple.hh.

144  {
145  return first < tuple.first;
146  }
template<class JFirst_t, class JSecond_t = JNullType>
JFirst_t& JMATH::JMath< JFirst_t, JSecond_t >::mul ( const JSecond_t &  object)
inlineinherited

Multiply with object.

Parameters
objectobject
Returns
result object

Definition at line 357 of file JMath.hh.

358  {
359  return static_cast<JFirst_t&>(*this) = JCalculator<JFirst_t>::calculator.mul(static_cast<const JFirst_t&>(*this), object);
360  }
Auxiliary class for arithmetic operations on objects.
Definition: JCalculator.hh:18

Friends And Related Function Documentation

template<class T>
std::istream& operator>> ( std::istream &  in,
JTuple< T > &  tuple 
)
friend

Read tuple from input.

Parameters
ininput stream
tupletuple
Returns
input stream

Definition at line 156 of file JTuple.hh.

157  {
158  return in >> tuple.first;
159  }
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:42
template<class T>
std::ostream& operator<< ( std::ostream &  out,
const JTuple< T > &  tuple 
)
friend

Write tuple to output.

Parameters
outoutput stream
tupletuple
Returns
output stream

Definition at line 169 of file JTuple.hh.

170  {
171  return out << tuple.first;
172  }
template<class T>
JReader& operator>> ( JReader in,
JTuple< T > &  tuple 
)
friend

Read tuple from input.

Parameters
inreader
tupletuple
Returns
reader

Definition at line 182 of file JTuple.hh.

183  {
184  return in >> tuple.first;
185  }
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:42
template<class T>
JWriter& operator<< ( JWriter out,
const JTuple< T > &  tuple 
)
friend

Write tuple to output.

Parameters
outwriter
tupletuple
Returns
writer

Definition at line 195 of file JTuple.hh.

196  {
197  return out << tuple.first;
198  }

Member Data Documentation

template<class T>
T JTOOLS::JTuple< T >::first

Definition at line 201 of file JTuple.hh.


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