Jpp  15.0.1-rc.1-highqe
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::JMultiKey< 1, JKey_t > Class Template Reference

One-dimensional key. More...

#include <JMultiKey.hh>

Inheritance diagram for JTOOLS::JMultiKey< 1, JKey_t >:
JLANG::JComparable< JFirst_t, JSecond_t >

Public Types

typedef JKey_t key_type
 
typedef JMultiKey< 0, JKey_t > mapped_type
 

Public Member Functions

 JMultiKey ()
 Default constructor. More...
 
 JMultiKey (typename JClass< mapped_type >::argument_type __first, typename JClass< key_type >::argument_type __second)
 Constructor. More...
 
 JMultiKey (typename JClass< key_type >::argument_type __first, typename JClass< mapped_type >::argument_type __second)
 Constructor. More...
 
 JMultiKey (typename JClass< key_type >::argument_type __first)
 Constructor. More...
 
 JMultiKey (typename JArgument< 1, JKey_t >::argument_type key)
 Copy constructor. More...
 
bool less (const JMultiKey< 1, JKey_t > &key) const
 Less than method. More...
 
double getLengthSquared () const
 Get length squared. More...
 
double getLength () const
 Get length. More...
 
key_type back () const
 Get backend key. More...
 

Public Attributes

key_type first
 

Friends

std::istream & operator>> (std::istream &in, JMultiKey< 1, JKey_t > &key)
 Read key from input. More...
 
std::ostream & operator<< (std::ostream &out, const JMultiKey< 1, JKey_t > &key)
 Write key to output. More...
 

Detailed Description

template<class JKey_t>
class JTOOLS::JMultiKey< 1, JKey_t >

One-dimensional key.

Definition at line 374 of file JMultiKey.hh.

Member Typedef Documentation

template<class JKey_t >
typedef JKey_t JTOOLS::JMultiKey< 1, JKey_t >::key_type

Definition at line 379 of file JMultiKey.hh.

template<class JKey_t >
typedef JMultiKey<0, JKey_t> JTOOLS::JMultiKey< 1, JKey_t >::mapped_type

Definition at line 380 of file JMultiKey.hh.

Constructor & Destructor Documentation

template<class JKey_t >
JTOOLS::JMultiKey< 1, JKey_t >::JMultiKey ( )
inline

Default constructor.

Definition at line 386 of file JMultiKey.hh.

386  :
387  first()
388  {}
template<class JKey_t >
JTOOLS::JMultiKey< 1, JKey_t >::JMultiKey ( typename JClass< mapped_type >::argument_type  __first,
typename JClass< key_type >::argument_type  __second 
)
inline

Constructor.

The secondary key is appended to the end of the primary key.

Parameters
__firstprimary key
__secondsecondary key

Definition at line 398 of file JMultiKey.hh.

399  :
400  first(__second)
401  {}
template<class JKey_t >
JTOOLS::JMultiKey< 1, JKey_t >::JMultiKey ( typename JClass< key_type >::argument_type  __first,
typename JClass< mapped_type >::argument_type  __second 
)
inline

Constructor.

The primary key is inserted at the start of the secondary key.

Parameters
__firstprimary key
__secondsecondary key

Definition at line 411 of file JMultiKey.hh.

412  :
413  first(__first)
414  {}
template<class JKey_t >
JTOOLS::JMultiKey< 1, JKey_t >::JMultiKey ( typename JClass< key_type >::argument_type  __first)
inline

Constructor.

Parameters
__firstkey

Definition at line 422 of file JMultiKey.hh.

422  :
423  first(__first)
424  {}
template<class JKey_t >
JTOOLS::JMultiKey< 1, JKey_t >::JMultiKey ( typename JArgument< 1, JKey_t >::argument_type  key)
inline

Copy constructor.

Parameters
keykey

Definition at line 432 of file JMultiKey.hh.

432  :
433  first(key.first)
434  {}

Member Function Documentation

template<class JKey_t >
bool JTOOLS::JMultiKey< 1, JKey_t >::less ( const JMultiKey< 1, JKey_t > &  key) const
inline

Less than method.

Parameters
keykey
Returns
true if this key less than given key; else false

Definition at line 443 of file JMultiKey.hh.

444  {
445  return this->first < key.first;
446  }
template<class JKey_t >
double JTOOLS::JMultiKey< 1, JKey_t >::getLengthSquared ( ) const
inline

Get length squared.

Returns
square of length

Definition at line 454 of file JMultiKey.hh.

455  {
456  return this->first*this->first;
457  }
template<class JKey_t >
double JTOOLS::JMultiKey< 1, JKey_t >::getLength ( ) const
inline

Get length.

Returns
length

Definition at line 465 of file JMultiKey.hh.

466  {
467  return sqrt(this->getLengthSquared());
468  }
double getLengthSquared() const
Get length squared.
Definition: JMultiKey.hh:454
template<class JKey_t >
key_type JTOOLS::JMultiKey< 1, JKey_t >::back ( ) const
inline

Get backend key.

Returns
backend key

Definition at line 476 of file JMultiKey.hh.

477  {
478  return this->first;
479  }

Friends And Related Function Documentation

template<class JKey_t >
std::istream& operator>> ( std::istream &  in,
JMultiKey< 1, JKey_t > &  key 
)
friend

Read key from input.

Parameters
ininput stream
keykey
Returns
input stream

Definition at line 489 of file JMultiKey.hh.

490  {
491  in >> key.first;
492 
493  return in;
494  }
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:41
template<class JKey_t >
std::ostream& operator<< ( std::ostream &  out,
const JMultiKey< 1, JKey_t > &  key 
)
friend

Write key to output.

Parameters
outoutput stream
keykey
Returns
output stream

Definition at line 504 of file JMultiKey.hh.

505  {
506  const JFormat format(out, getFormat< JMultiKey<1, JKey_t> >(JFormat_t(9, 3, std::ios::fixed | std::ios::showpos)));
507 
508  out << format << key.first;
509 
510  return out;
511  }
JFormat_t & getFormat()
Get format for given type.
Definition: JManip.hh:680
Auxiliary class to temporarily define format specifications.
Definition: JManip.hh:632
One-dimensional key.
Definition: JMultiKey.hh:374
Data structure for format specifications.
Definition: JManip.hh:522

Member Data Documentation

template<class JKey_t >
key_type JTOOLS::JMultiKey< 1, JKey_t >::first

Definition at line 514 of file JMultiKey.hh.


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