LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Public Member Functions | Private Attributes | Friends | List of all members
lsst::meas::algorithms::shapelet::Form Class Reference

#include <Form.h>

Public Member Functions

 Form ()
 
template<typename T >
BoundForm< T > operator() (T val) const
 
Formprec (int p)
 
Formsci ()
 
Formfix ()
 
Formgen ()
 
Formwidth (int w)
 
Formfill (char c)
 
Formdec ()
 
Formoct ()
 
Formhex ()
 
Formleft ()
 
Formright ()
 
Forminternal ()
 
Formuppercase (bool b=true)
 
Formshowpos (bool b=true)
 
Formshowpoint (bool b=true)
 
Formboolalpha (bool b=true)
 
Formtrail (int n, char ch=' ')
 

Private Attributes

int _prc
 
int _wdt
 
std::ios_base::fmtflags _fmt
 
std::ios_base::fmtflags _base
 
std::ios_base::fmtflags _just
 
char _newFillCh
 
int _doUpper
 
int _doPlus
 
int _doTrail
 
int _doBoolAlpha
 
int _nTrail
 
char _trailCh
 

Friends

template<typename T >
std::ostream & operator<< (std::ostream &, const BoundForm< T > &)
 
void setupFloat (std::ostream &, const Form &)
 
void setupInt (std::ostream &, const Form &)
 

Detailed Description

Definition at line 19 of file Form.h.

Constructor & Destructor Documentation

lsst::meas::algorithms::shapelet::Form::Form ( )
inline

Definition at line 22 of file Form.h.

Member Function Documentation

Form& lsst::meas::algorithms::shapelet::Form::boolalpha ( bool  b = true)
inline

Definition at line 51 of file Form.h.

51 { _doBoolAlpha = b?1:-1; return *this; }
afw::table::Key< double > b
Form& lsst::meas::algorithms::shapelet::Form::dec ( )
inline

Definition at line 40 of file Form.h.

40 { _base = std::ios_base::dec; return *this; }
std::ios_base::fmtflags _base
Definition: Form.h:66
Form& lsst::meas::algorithms::shapelet::Form::fill ( char  c)
inline

Definition at line 38 of file Form.h.

38 { _newFillCh = c; return *this; }
Form& lsst::meas::algorithms::shapelet::Form::fix ( )
inline

Definition at line 34 of file Form.h.

34 { _fmt = std::ios_base::fixed; return *this; }
std::ios_base::fmtflags _fmt
Definition: Form.h:65
Form& lsst::meas::algorithms::shapelet::Form::gen ( )
inline

Definition at line 35 of file Form.h.

35 { _fmt = ~std::ios_base::floatfield; return *this; }
std::ios_base::fmtflags _fmt
Definition: Form.h:65
Form& lsst::meas::algorithms::shapelet::Form::hex ( )
inline

Definition at line 42 of file Form.h.

42 { _base = std::ios_base::hex; return *this; }
std::ios_base::fmtflags _base
Definition: Form.h:66
Form& lsst::meas::algorithms::shapelet::Form::internal ( )
inline

Definition at line 46 of file Form.h.

46 { _just = std::ios_base::internal; return *this; }
std::ios_base::fmtflags _just
Definition: Form.h:67
Form& lsst::meas::algorithms::shapelet::Form::left ( )
inline

Definition at line 44 of file Form.h.

44 { _just = std::ios_base::left; return *this; }
std::ios_base::fmtflags _just
Definition: Form.h:67
Form& lsst::meas::algorithms::shapelet::Form::oct ( )
inline

Definition at line 41 of file Form.h.

41 { _base = std::ios_base::oct; return *this; }
std::ios_base::fmtflags _base
Definition: Form.h:66
template<typename T >
BoundForm< T > lsst::meas::algorithms::shapelet::Form::operator() ( val) const
inline

Definition at line 88 of file Form.h.

89  { return BoundForm<T>(*this,val); }
bool val
Form& lsst::meas::algorithms::shapelet::Form::prec ( int  p)
inline

Definition at line 31 of file Form.h.

31 { _prc = p; return *this; }
Form& lsst::meas::algorithms::shapelet::Form::right ( )
inline

Definition at line 45 of file Form.h.

45 { _just = std::ios_base::right; return *this; }
std::ios_base::fmtflags _just
Definition: Form.h:67
Form& lsst::meas::algorithms::shapelet::Form::sci ( )
inline

Definition at line 33 of file Form.h.

33 { _fmt = std::ios_base::scientific; return *this; }
std::ios_base::fmtflags _fmt
Definition: Form.h:65
Form& lsst::meas::algorithms::shapelet::Form::showpoint ( bool  b = true)
inline

Definition at line 50 of file Form.h.

50 { _doTrail = b?1:-1; return *this; }
afw::table::Key< double > b
Form& lsst::meas::algorithms::shapelet::Form::showpos ( bool  b = true)
inline

Definition at line 49 of file Form.h.

49 { _doPlus = b?1:-1; return *this; }
afw::table::Key< double > b
Form& lsst::meas::algorithms::shapelet::Form::trail ( int  n,
char  ch = ' ' 
)
inline

Definition at line 53 of file Form.h.

54  { _nTrail = n; _trailCh = ch; return *this; }
Form& lsst::meas::algorithms::shapelet::Form::uppercase ( bool  b = true)
inline

Definition at line 48 of file Form.h.

48 { _doUpper = b?1:-1; return *this; }
afw::table::Key< double > b
Form& lsst::meas::algorithms::shapelet::Form::width ( int  w)
inline

Definition at line 37 of file Form.h.

37 { _wdt = w; return *this; }
double w
Definition: CoaddPsf.cc:57

Friends And Related Function Documentation

template<typename T >
std::ostream& operator<< ( std::ostream &  os,
const BoundForm< T > &  bf 
)
friend

Definition at line 171 of file Form.h.

172  {
173  std::ostringstream s;
174  setup(s,bf);
175  s << bf.val;
176  if (bf.f._nTrail>0) s << std::string(bf.f._nTrail,bf.f._trailCh);
177  os << s.str();
178  return os;
179  }
void setup(std::ostream &os, const BoundForm< double > &bf)
Definition: Form.h:129
void setupFloat ( std::ostream &  s,
const Form f 
)
friend

Definition at line 91 of file Form.h.

92  {
93  s.precision(f._prc);
94  s.setf(f._fmt,std::ios_base::floatfield);
95  s.setf(f._just,std::ios_base::adjustfield);
96  if (f._wdt) s.width(f._wdt);
97  if (f._newFillCh) s.fill(f._newFillCh);
98  if (f._doUpper && f._fmt == std::ios_base::scientific) {
99  if (f._doUpper>0) s.setf(std::ios_base::uppercase);
100  else s.unsetf(std::ios_base::uppercase);
101  }
102  if (f._doPlus) {
103  if (f._doPlus>0) s.setf(std::ios_base::showpos);
104  else s.unsetf(std::ios_base::showpos);
105  }
106  if (f._doTrail) {
107  if (f._doTrail>0) s.setf(std::ios_base::showpoint);
108  else s.unsetf(std::ios_base::showpoint);
109  }
110  }
void setupInt ( std::ostream &  s,
const Form f 
)
friend

Definition at line 112 of file Form.h.

113  {
114  s.setf(f._just,std::ios_base::adjustfield);
115  s.setf(f._base,std::ios_base::basefield);
116  if (f._wdt) s.width(f._wdt);
117  if (f._newFillCh) s.fill(f._newFillCh);
118  if (f._doUpper && f._base == std::ios_base::hex) {
119  if (f._doUpper>0) s.setf(std::ios_base::uppercase);
120  else s.unsetf(std::ios_base::uppercase);
121  }
122  if (f._doPlus) {
123  if (f._doPlus>0) s.setf(std::ios_base::showpos);
124  else s.unsetf(std::ios_base::showpos);
125  }
126  if (f._base != std::ios_base::dec) s.setf(std::ios_base::showbase);
127  }

Member Data Documentation

std::ios_base::fmtflags lsst::meas::algorithms::shapelet::Form::_base
private

Definition at line 66 of file Form.h.

int lsst::meas::algorithms::shapelet::Form::_doBoolAlpha
private

Definition at line 72 of file Form.h.

int lsst::meas::algorithms::shapelet::Form::_doPlus
private

Definition at line 70 of file Form.h.

int lsst::meas::algorithms::shapelet::Form::_doTrail
private

Definition at line 71 of file Form.h.

int lsst::meas::algorithms::shapelet::Form::_doUpper
private

Definition at line 69 of file Form.h.

std::ios_base::fmtflags lsst::meas::algorithms::shapelet::Form::_fmt
private

Definition at line 65 of file Form.h.

std::ios_base::fmtflags lsst::meas::algorithms::shapelet::Form::_just
private

Definition at line 67 of file Form.h.

char lsst::meas::algorithms::shapelet::Form::_newFillCh
private

Definition at line 68 of file Form.h.

int lsst::meas::algorithms::shapelet::Form::_nTrail
private

Definition at line 73 of file Form.h.

int lsst::meas::algorithms::shapelet::Form::_prc
private

Definition at line 63 of file Form.h.

char lsst::meas::algorithms::shapelet::Form::_trailCh
private

Definition at line 74 of file Form.h.

int lsst::meas::algorithms::shapelet::Form::_wdt
private

Definition at line 64 of file Form.h.


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