Jpp  17.1.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Typedefs | Enumerations | Functions | Variables
JEEP Namespace Reference

General puprpose classes and methods. More...

Classes

class  JArgs
 Data structure to store command line arguments. More...
 
struct  JComment
 Auxiliary class for comment. More...
 
class  JCommunicator
 Auxiliary class to control standard input and output. More...
 
struct  JContainer
 Auxiliary wrapper for I/O of container with optional comment (see JComment). More...
 
struct  JDate
 Auxiliary class for simple date. More...
 
struct  JFunctionAdaptorHelper
 Auxiliary base class for function adaptor. More...
 
struct  JFunctionAdaptor
 Function adaptor. More...
 
struct  JFunctionAdaptor< JReturn_t, JFirst_t, void >
 Function adaptor for function with one argument. More...
 
struct  JMessage
 Auxiliary class for handling debug parameter within a class. More...
 
class  JPropertiesElementInterface
 Interface for I/O of properties element. More...
 
class  JPropertiesTemplateElement
 Template class for I/O of properties element. More...
 
class  JPropertiesTemplateElement< const T >
 Template specialisation of JPropertiesTemplateElement for const data type. More...
 
class  JPropertiesElement
 The property value class. More...
 
class  JProperties
 Utility class to parse parameter values. More...
 
class  JPropertiesTemplateElement< JProperties::JFileReader >
 Template specialisation for JFileReader. More...
 
class  JPropertiesTemplateElement< JProperties >
 Template specialisation for JProperties. More...
 
struct  JStatus
 Auxiliary class for handling status. More...
 
struct  JGetStatusBit
 Auxiliary class to map key to status bit. More...
 
struct  JPutStatusBit
 Auxiliary class to map status bit to key. More...
 
struct  JTime
 Auxiliary class for simple time. More...
 
class  JTimekeeper
 Time keeper. More...
 
class  JTimer
 Auxiliary class for CPU timing and usage. More...
 
struct  JVersion
 Auxiliary data structure for general purpose version number. More...
 
struct  JMessage< JOSCPROB::JOscProbInterpolator< JCollection_t, JFunction1D_t, JFunctionalMaplist_t > >
 JMessage template specialization for oscillation probability interpolators. More...
 

Typedefs

typedef std::vector< std::string > JComment_t
 Type definition of comment block. More...
 
typedef std::multimap< JDate
<'-'>, std::string > 
JGITTags_t
 Type definition of dated GIT tags. More...
 

Enumerations

enum  JMessage_t {
  debug_t = 3, status_t = 2, warning_t = 2, notice_t = 1,
  error_t = 0, fatal_t = 0
}
 Debug level. More...
 
enum  JScale_t {
  femto_t = -15, pico_t = -12, nano_t = -9, micro_t = -6,
  milli_t = -3, unit_t = 0, kilo_t = +3, mega_t = +6,
  giga_t = +9, tera_t = +12, peta_t = +15, exa_t = +18
}
 Enumeration for scaling of quantity. More...
 

Functions

template<class T >
bool compareObjects (const T &first, const T &second, JBool< true >)
 Comparison of comparable objects. More...
 
template<class T >
bool compareObjects (const T &first, const T &second, JBool< false >)
 Comparison of uncomparable objects. More...
 
template<class T >
bool compareObjects (const T &first, const T &second)
 Comparison of objects. More...
 
bool hasWildCard (const std::string &file_name)
 Check presence of wild card. More...
 
std::string setWildCard (const std::string &file_name, const std::string &value)
 Get file name by setting wild card to given value. More...
 
std::string strip (const std::string &file_name)
 Strip leading and trailing white spaces from file name. More...
 
std::string getFilenameExtension (const std::string &file_name)
 Get file name extension, i.e. part after last JEEP::FILENAME_SEPARATOR if any. More...
 
std::string getFilename (const std::string &file_name)
 Get file name part, i.e. part after last JEEP::PATHNAME_SEPARATOR if any. More...
 
std::string getPath (const std::string &file_name)
 Get path, i.e. part before last JEEP::PATHNAME_SEPARATOR if any. More...
 
std::string getFullPath (const std::string &path)
 Get full path, i.e. add JEEP::PATHNAME_SEPARATOR if necessary. More...
 
std::string getFilename (const std::string &path, const std::string &file_name)
 Compose full file name and introduce JEEP::PATHNAME_SEPARATOR if needed. More...
 
std::string getPath (const std::string &variable, const std::string &file_name)
 Get selected path from environment variable for given file name. More...
 
std::string getFullFilename (const std::string &variable, const std::string &file_name)
 Get full file name (see JEEP::getPath). More...
 
std::string getNamespace (const std::string &type_name)
 Get name space, i.e. part before JEEP::TYPENAME_SEPARATOR. More...
 
std::string getClassname (const std::string &type_name)
 Get type name, i.e. part after JEEP::TYPENAME_SEPARATOR. More...
 
std::string getProtocol (const std::string &file_name)
 Get protocol, i.e. part before first JEEP::PROTOCOL_SEPARATOR if any. More...
 
std::string getURL ()
 Get URL of document pages. More...
 
template<class T >
Topen (const std::string &file_name)
 Open file. More...
 
template<>
std::istream * open (const std::string &file_name)
 Open file. More...
 
template<>
std::ostream * open (const std::string &file_name)
 Open file. More...
 
void close (std::istream *pf)
 Close file. More...
 
void close (std::ostream *pf)
 Close file. More...
 
std::string getGITVersion (const std::string &tag)
 Get GIT version for given GIT tag. More...
 
const JGITTags_tgetGITTags ()
 Get GIT dated tags. More...
 
template<class T >
int sign (const T &value)
 Get sign of value. More...
 
std::ostream & getOstream ()
 Get output stream for conversion to std::string. More...
 
const char * getCString (const std::string &input)
 Get output C-string. More...
 
bool fail (std::istream &in)
 Check for stream state. More...
 
template<class T >
JPropertiesgetProperties (T &object, const JEquationParameters &parameters=JEquationParameters(), const int debug=1)
 Get properties of a given object. More...
 
double getValue (const JScale_t scale)
 Get numerical value corresponding to scale. More...
 
const char * getUnit (const int scale)
 Get textual unit corresponding to scale. More...
 
JScale_t getScale (const char unit)
 Get scale corresponding to textual unit. More...
 
void print (std::ostream &out, const JStatus &status, const JPutStatusBit &helper)
 Print status. More...
 
void print (std::ostream &out, const JStatus &status, const JGetStatusBit &helper)
 Print status. More...
 
template<class T >
std::istream & readObject (std::istream &in, T &object)
 Stream input of object. More...
 
template<class T >
std::ostream & writeObject (std::ostream &out, const T &object)
 Stream output of object. More...
 
template<class T >
std::ostream & writeObject (std::ostream &out, const char *prefix, const T &object, const char postfix)
 Stream output of object. More...
 
template<class JFirst_t , class JSecond_t >
std::istream & readObject (std::istream &in, std::pair< JFirst_t, JSecond_t > &object)
 Template specialisation of method readObject() for std::pair. More...
 
template<class JFirst_t , class JSecond_t >
std::ostream & writeObject (std::ostream &out, const std::pair< JFirst_t, JSecond_t > &object)
 Template specialisation of method writeObject() for std::pair. More...
 
template<class JFirst_t , class JSecond_t >
std::ostream & writeObject (std::ostream &out, const char *prefix, const std::pair< JFirst_t, JSecond_t > &object, const char postfix)
 Template specialisation of method writeObject() for std::pair. More...
 
template<class JElement_t , class JAllocator_t >
std::istream & readObject (std::istream &in, std::vector< JElement_t, JAllocator_t > &object)
 Template specialisation of method readObject() for std::vector. More...
 
template<class JElement_t , class JAllocator_t >
std::ostream & writeObject (std::ostream &out, const std::vector< JElement_t, JAllocator_t > &object)
 Template specialisation of method writeObject() for std::vector. More...
 
template<class JElement_t , class JAllocator_t >
std::ostream & writeObject (std::ostream &out, const char *prefix, const std::vector< JElement_t, JAllocator_t > &object, const char postfix)
 Template specialisation of method writeObject() for std::vector. More...
 
template<class JElement_t , class JAllocator_t >
std::istream & readObject (std::istream &in, std::list< JElement_t, JAllocator_t > &object)
 Template specialisation of method readObject() for std::list. More...
 
template<class JElement_t , class JAllocator_t >
std::ostream & writeObject (std::ostream &out, const std::list< JElement_t, JAllocator_t > &object)
 Template specialisation of method writeObject() for std::list. More...
 
template<class JElement_t , class JAllocator_t >
std::ostream & writeObject (std::ostream &out, const char *prefix, const std::list< JElement_t, JAllocator_t > &object, const char postfix)
 Template specialisation of method writeObject() for std::list. More...
 
template<class JElement_t , class JComparator_t , class JAllocator_t >
std::istream & readObject (std::istream &in, std::set< JElement_t, JComparator_t, JAllocator_t > &object)
 Template specialisation of method readObject() for std::set. More...
 
template<class JElement_t , class JComparator_t , class JAllocator_t >
std::ostream & writeObject (std::ostream &out, const std::set< JElement_t, JComparator_t, JAllocator_t > &object)
 Template specialisation of method writeObject() for std::set. More...
 
template<class JElement_t , class JComparator_t , class JAllocator_t >
std::ostream & writeObject (std::ostream &out, const char *prefix, const std::set< JElement_t, JComparator_t, JAllocator_t > &object, const char postfix)
 Template specialisation of method writeObject() for std::set. More...
 
template<class JElement_t , class JComparator_t , class JAllocator_t >
std::istream & readObject (std::istream &in, std::multiset< JElement_t, JComparator_t, JAllocator_t > &object)
 Template specialisation of method readObject() for std::multiset. More...
 
template<class JElement_t , class JComparator_t , class JAllocator_t >
std::ostream & writeObject (std::ostream &out, const std::multiset< JElement_t, JComparator_t, JAllocator_t > &object)
 Template specialisation of method writeObject() for std::multiset. More...
 
template<class JElement_t , class JComparator_t , class JAllocator_t >
std::ostream & writeObject (std::ostream &out, const char *prefix, const std::multiset< JElement_t, JComparator_t, JAllocator_t > &object, const char postfix)
 Template specialisation of method writeObject() for std::multiset. More...
 
template<class JKey_t , class JValue_t , class JComparator_t , class JAllocator_t >
std::istream & readObject (std::istream &in, std::map< JKey_t, JValue_t, JComparator_t, JAllocator_t > &object)
 Template specialisation of method readObject() for std::map. More...
 
template<class JKey_t , class JValue_t , class JComparator_t , class JAllocator_t >
std::ostream & writeObject (std::ostream &out, const std::map< JKey_t, JValue_t, JComparator_t, JAllocator_t > &object)
 Template specialisation of method writeObject() for std::map. More...
 
template<class JKey_t , class JValue_t , class JComparator_t , class JAllocator_t >
std::ostream & writeObject (std::ostream &out, const char *prefix, const std::map< JKey_t, JValue_t, JComparator_t, JAllocator_t > &object, const char postfix)
 Template specialisation of method writeObject() for std::map. More...
 
template<class JKey_t , class JValue_t , class JComparator_t , class JAllocator_t >
std::istream & readObject (std::istream &in, std::multimap< JKey_t, JValue_t, JComparator_t, JAllocator_t > &object)
 Template specialisation of method readObject() for std::multimap. More...
 
template<class JKey_t , class JValue_t , class JComparator_t , class JAllocator_t >
std::ostream & writeObject (std::ostream &out, const std::multimap< JKey_t, JValue_t, JComparator_t, JAllocator_t > &object)
 Template specialisation of method writeObject() for std::multimap. More...
 
template<class JKey_t , class JValue_t , class JComparator_t , class JAllocator_t >
std::ostream & writeObject (std::ostream &out, const char *prefix, const std::multimap< JKey_t, JValue_t, JComparator_t, JAllocator_t > &object, const char postfix)
 Template specialisation of method writeObject() for std::multimap. More...
 
template<class T >
std::ostream & writeArray (std::ostream &out, const char *left, const char *right, const char *sep, T __begin, T __end)
 Write array of objects. More...
 

Variables

static const char *const LD_LIBRARY_PATH = "LD_LIBRARY_PATH"
 Nick names of environment variables. More...
 
static const char *const PATH = "PATH"
 binary file paths More...
 
static const char *const SHELL = "SHELL"
 SHELL. More...
 
static const char *const JPP_PAGES = "JPP_PAGES"
 Jpp document pages. More...
 
static const char PATHNAME_SEPARATOR = '/'
 path name separator More...
 
static const char PATHLIST_SEPARATOR = ':'
 path list separator More...
 
static const char FILENAME_SEPARATOR = '.'
 file name separator More...
 
static const char *const TYPENAME_SEPARATOR = "::"
 type name separator More...
 
static const char PROTOCOL_SEPARATOR = ':'
 protocol separator More...
 
static const char FILENAME_WILD_CARD = '%'
 wild card character for file name substitution More...
 

Detailed Description

General puprpose classes and methods.

Author
mdejong
bjung

Typedef Documentation

typedef std::vector<std::string> JEEP::JComment_t

Type definition of comment block.

Definition at line 31 of file JComment.hh.

typedef std::multimap<JDate<'-'>, std::string> JEEP::JGITTags_t

Type definition of dated GIT tags.

Definition at line 25 of file Jeep/JGITTags.hh.

Enumeration Type Documentation

Debug level.

Enumerator
debug_t 

debug

status_t 

status

warning_t 

warning

notice_t 

notice

error_t 

error

fatal_t 

fatal; exit

Definition at line 27 of file JMessage.hh.

27  {
28 
29  debug_t = 3, //!< debug
30  status_t = 2, //!< status
31  warning_t = 2, //!< warning
32  notice_t = 1, //!< notice
33  error_t = 0, //!< error
34  fatal_t = 0 //!< fatal; exit
35  };
fatal; exit
Definition: JMessage.hh:34
debug
Definition: JMessage.hh:29
notice
Definition: JMessage.hh:32
warning
Definition: JMessage.hh:31
status
Definition: JMessage.hh:30
error
Definition: JMessage.hh:33

Enumeration for scaling of quantity.

Enumerator
femto_t 

femto

pico_t 

pico

nano_t 

nano

micro_t 

micro

milli_t 

milli

unit_t 

unit

kilo_t 

kilo

mega_t 

mega

giga_t 

giga

tera_t 

tera

peta_t 

peta

exa_t 

exa

Definition at line 24 of file JScale.hh.

24  {
25 
26  femto_t = -15, //!< femto
27  pico_t = -12, //!< pico
28  nano_t = -9, //!< nano
29  micro_t = -6, //!< micro
30  milli_t = -3, //!< milli
31  unit_t = 0, //!< unit
32  kilo_t = +3, //!< kilo
33  mega_t = +6, //!< mega
34  giga_t = +9, //!< giga
35  tera_t = +12, //!< tera
36  peta_t = +15, //!< peta
37  exa_t = +18 //!< exa
38  };
exa
Definition: JScale.hh:37
micro
Definition: JScale.hh:29
giga
Definition: JScale.hh:34
kilo
Definition: JScale.hh:32
milli
Definition: JScale.hh:30
peta
Definition: JScale.hh:36
femto
Definition: JScale.hh:26
mega
Definition: JScale.hh:33
nano
Definition: JScale.hh:28
pico
Definition: JScale.hh:27
unit
Definition: JScale.hh:31
tera
Definition: JScale.hh:35

Function Documentation

template<class T >
bool JEEP::compareObjects ( const T first,
const T second,
JBool< true >   
)
inline

Comparison of comparable objects.

Parameters
firstfirst object
secondsecond object
Returns
true if objects are equal; else false

Definition at line 30 of file JComparisonToolkit.hh.

33  {
34  return first == second;
35  }
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
template<class T >
bool JEEP::compareObjects ( const T first,
const T second,
JBool< false >   
)
inline

Comparison of uncomparable objects.

Parameters
firstfirst object
secondsecond object
Returns
false

Definition at line 46 of file JComparisonToolkit.hh.

49  {
50  return false;
51  }
template<class T >
bool JEEP::compareObjects ( const T first,
const T second 
)
inline

Comparison of objects.

Parameters
firstfirst object
secondsecond object
Returns
true if objects are comparable and equal; else false

Definition at line 62 of file JComparisonToolkit.hh.

64  {
65  return compareObjects(first, second, JBool<JComparisonAvailable<T>::has_eq>());
66  }
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
bool compareObjects(const T &first, const T &second, JBool< true >)
Comparison of comparable objects.
bool JEEP::hasWildCard ( const std::string &  file_name)
inline

Check presence of wild card.

Parameters
file_namefile name
Returns
true if wild card present; else false

Definition at line 53 of file JeepToolkit.hh.

54  {
55  return (file_name.find(FILENAME_WILD_CARD) != std::string::npos);
56  }
static const char FILENAME_WILD_CARD
wild card character for file name substitution
Definition: JeepToolkit.hh:44
std::string JEEP::setWildCard ( const std::string &  file_name,
const std::string &  value 
)
inline

Get file name by setting wild card to given value.

Parameters
file_nameinput file name
valuevalue
Returns
output file name

Definition at line 66 of file JeepToolkit.hh.

67  {
68  using namespace std;
69  using namespace JPP;
70 
71  string buffer = file_name;
72 
73  string::size_type pos = buffer.find(FILENAME_WILD_CARD);
74 
75  if (pos == string::npos) {
76  THROW(JNoValue, "Method getFilename(): Missing wild card character \'" << FILENAME_WILD_CARD << "\'.");
77  }
78 
79  return buffer.replace(pos, 1, value);
80  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:696
static const char FILENAME_WILD_CARD
wild card character for file name substitution
Definition: JeepToolkit.hh:44
std::string JEEP::strip ( const std::string &  file_name)
inline

Strip leading and trailing white spaces from file name.

Parameters
file_namefile name
Returns
file name

Definition at line 89 of file JeepToolkit.hh.

90  {
91  using namespace std;
92 
93  string::const_iterator p = file_name. begin();
94  string::const_reverse_iterator q = file_name.rbegin();
95 
96  for ( ; p != file_name.end() && q != file_name.rend() && isspace(*p); ++p) {}
97  for ( ; p != file_name.end() && q != file_name.rend() && isspace(*q); ++q) {}
98 
99  return string(p,q.base());
100  }
std::string JEEP::getFilenameExtension ( const std::string &  file_name)
inline

Get file name extension, i.e. part after last JEEP::FILENAME_SEPARATOR if any.

Parameters
file_namefile name
Returns
extension (excluding separator)

Definition at line 109 of file JeepToolkit.hh.

110  {
111  using namespace std;
112 
113  const size_t pos = file_name.rfind(FILENAME_SEPARATOR);
114 
115  if (pos != string::npos)
116  return file_name.substr(pos + 1);
117  else
118  return "";
119  }
static const char FILENAME_SEPARATOR
file name separator
Definition: JeepToolkit.hh:41
std::string JEEP::getFilename ( const std::string &  file_name)
inline

Get file name part, i.e. part after last JEEP::PATHNAME_SEPARATOR if any.

Parameters
file_namefile name
Returns
file name part (excluding separator)

Definition at line 128 of file JeepToolkit.hh.

129  {
130  using namespace std;
131 
132  const string buffer = strip(file_name);
133  const size_t pos = buffer.rfind(PATHNAME_SEPARATOR);
134 
135  if (pos != string::npos)
136  return buffer.substr(pos + 1);
137  else
138  return buffer;
139  }
std::string strip(const std::string &file_name)
Strip leading and trailing white spaces from file name.
Definition: JeepToolkit.hh:89
static const char PATHNAME_SEPARATOR
path name separator
Definition: JeepToolkit.hh:39
std::string JEEP::getPath ( const std::string &  file_name)
inline

Get path, i.e. part before last JEEP::PATHNAME_SEPARATOR if any.

Parameters
file_namefile name
Returns
path (including separator)

Definition at line 148 of file JeepToolkit.hh.

149  {
150  using namespace std;
151 
152  const string buffer = strip(file_name);
153  const size_t pos = buffer.rfind(PATHNAME_SEPARATOR);
154 
155  if (pos != string::npos)
156  return buffer.substr(0, pos + 1);
157  else
158  return "";
159  }
std::string strip(const std::string &file_name)
Strip leading and trailing white spaces from file name.
Definition: JeepToolkit.hh:89
static const char PATHNAME_SEPARATOR
path name separator
Definition: JeepToolkit.hh:39
std::string JEEP::getFullPath ( const std::string &  path)
inline

Get full path, i.e. add JEEP::PATHNAME_SEPARATOR if necessary.

Parameters
pathpath
Returns
path (including separator)

Definition at line 168 of file JeepToolkit.hh.

169  {
170  using namespace std;
171 
172  const string buffer = strip(path);
173 
174  if (buffer.empty() || *buffer.rbegin() == PATHNAME_SEPARATOR) {
175 
176  return buffer;
177 
178  } else {
179 
180  return buffer + PATHNAME_SEPARATOR;
181  }
182  }
$WORKDIR driver txt done cat $WORKDIR driver txt<< EOFprocess ${DATAFILTER}$FILTER_HOST csh-c '(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&(JDataFilter-H\$SERVER\$-M\$LOGGER\$-d $DEBUG-u ${DATAFILTER}-P $PORT</dev/null > &/dev/null &))';process ${DATAWRITER}$WRITER_HOST csh-c '(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&(JDataWriter-H\$SERVER\$-M\$LOGGER\$-d $DEBUG-u ${DATAWRITER}</dev/null > &/dev/null &))';print enterevent ev_init{RC_CMD}event ev_reset{RC_CMD}event ev_init{RC_CMD}event ev_configure{RC_DFLTR%<$WORKDIR/ev_configure_datafilter.txt > RC_DOM<$WORKDIR/ev_configure_domsimulator.txt > RC_DWRT path
std::string strip(const std::string &file_name)
Strip leading and trailing white spaces from file name.
Definition: JeepToolkit.hh:89
static const char PATHNAME_SEPARATOR
path name separator
Definition: JeepToolkit.hh:39
std::string JEEP::getFilename ( const std::string &  path,
const std::string &  file_name 
)
inline

Compose full file name and introduce JEEP::PATHNAME_SEPARATOR if needed.

Parameters
pathpath
file_namefile name
Returns
file name

Definition at line 192 of file JeepToolkit.hh.

193  {
194  using namespace std;
195 
196  const string buffer = getFullPath(path);
197 
198  if (buffer.empty())
199  return strip(file_name);
200  else
201  return buffer + strip(file_name);
202  }
std::string getFullPath(const std::string &path)
Get full path, i.e. add JEEP::PATHNAME_SEPARATOR if necessary.
Definition: JeepToolkit.hh:168
$WORKDIR driver txt done cat $WORKDIR driver txt<< EOFprocess ${DATAFILTER}$FILTER_HOST csh-c '(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&(JDataFilter-H\$SERVER\$-M\$LOGGER\$-d $DEBUG-u ${DATAFILTER}-P $PORT</dev/null > &/dev/null &))';process ${DATAWRITER}$WRITER_HOST csh-c '(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&(JDataWriter-H\$SERVER\$-M\$LOGGER\$-d $DEBUG-u ${DATAWRITER}</dev/null > &/dev/null &))';print enterevent ev_init{RC_CMD}event ev_reset{RC_CMD}event ev_init{RC_CMD}event ev_configure{RC_DFLTR%<$WORKDIR/ev_configure_datafilter.txt > RC_DOM<$WORKDIR/ev_configure_domsimulator.txt > RC_DWRT path
std::string strip(const std::string &file_name)
Strip leading and trailing white spaces from file name.
Definition: JeepToolkit.hh:89
std::string JEEP::getPath ( const std::string &  variable,
const std::string &  file_name 
)
inline

Get selected path from environment variable for given file name.

The environment variable is parsed according character JEEP::PATHLIST_SEPARATOR. The first path in which a file exists with the given file name is returned. If no existing file is found, an empty path is returned.

Parameters
variableenvironment variable
file_namefile name
Returns
path

Definition at line 216 of file JeepToolkit.hh.

217  {
218  using namespace std;
219 
220  string path = "";
221 
222  if (!file_name.empty() && file_name[0] != PATHNAME_SEPARATOR) {
223 
224  const string buffer(getenv(variable.c_str()));
225 
226  if (!buffer.empty()) {
227 
228  size_t pos = 0, len;
229 
230  do {
231 
232  len = buffer.substr(pos).find(PATHLIST_SEPARATOR);
233  path = buffer.substr(pos,len);
234 
235  } while (!ifstream(getFilename(path, file_name).c_str()).good() && len != string::npos && (pos += len + 1) != buffer.length());
236  }
237  }
238 
239  if (ifstream(getFilename(path, file_name).c_str()).good())
240  return path;
241  else
242  return "";
243  }
$WORKDIR driver txt done cat $WORKDIR driver txt<< EOFprocess ${DATAFILTER}$FILTER_HOST csh-c '(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&(JDataFilter-H\$SERVER\$-M\$LOGGER\$-d $DEBUG-u ${DATAFILTER}-P $PORT</dev/null > &/dev/null &))';process ${DATAWRITER}$WRITER_HOST csh-c '(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&(JDataWriter-H\$SERVER\$-M\$LOGGER\$-d $DEBUG-u ${DATAWRITER}</dev/null > &/dev/null &))';print enterevent ev_init{RC_CMD}event ev_reset{RC_CMD}event ev_init{RC_CMD}event ev_configure{RC_DFLTR%<$WORKDIR/ev_configure_datafilter.txt > RC_DOM<$WORKDIR/ev_configure_domsimulator.txt > RC_DWRT path
static const char PATHLIST_SEPARATOR
path list separator
Definition: JeepToolkit.hh:40
std::string getFilename(const std::string &file_name)
Get file name part, i.e. part after last JEEP::PATHNAME_SEPARATOR if any.
Definition: JeepToolkit.hh:128
static const char PATHNAME_SEPARATOR
path name separator
Definition: JeepToolkit.hh:39
std::string JEEP::getFullFilename ( const std::string &  variable,
const std::string &  file_name 
)
inline

Get full file name (see JEEP::getPath).

Parameters
variableenvironment variable
file_namefile name
Returns
file name

Definition at line 253 of file JeepToolkit.hh.

254  {
255  return getFilename(getPath(variable, file_name), file_name);
256  }
std::string getPath(const std::string &file_name)
Get path, i.e. part before last JEEP::PATHNAME_SEPARATOR if any.
Definition: JeepToolkit.hh:148
std::string getFilename(const std::string &file_name)
Get file name part, i.e. part after last JEEP::PATHNAME_SEPARATOR if any.
Definition: JeepToolkit.hh:128
std::string JEEP::getNamespace ( const std::string &  type_name)
inline

Get name space, i.e. part before JEEP::TYPENAME_SEPARATOR.

Parameters
type_nametype name
Returns
name space (possibly empty)

Definition at line 265 of file JeepToolkit.hh.

266  {
267  using namespace std;
268 
269  const size_t pos = type_name.rfind(TYPENAME_SEPARATOR);
270 
271  if (pos != string::npos)
272  return type_name.substr(0, pos);
273  else
274  return "";
275  }
static const char *const TYPENAME_SEPARATOR
type name separator
Definition: JeepToolkit.hh:42
std::string JEEP::getClassname ( const std::string &  type_name)
inline

Get type name, i.e. part after JEEP::TYPENAME_SEPARATOR.

Parameters
type_nametype name
Returns
class name

Definition at line 284 of file JeepToolkit.hh.

285  {
286  using namespace std;
287 
288  const size_t pos = type_name.rfind(TYPENAME_SEPARATOR);
289 
290  if (pos != string::npos)
291  return type_name.substr(pos + 2);
292  else
293  return type_name;
294  }
static const char *const TYPENAME_SEPARATOR
type name separator
Definition: JeepToolkit.hh:42
std::string JEEP::getProtocol ( const std::string &  file_name)
inline

Get protocol, i.e. part before first JEEP::PROTOCOL_SEPARATOR if any.

Parameters
file_namefile name
Returns
protocol (excluding separator)

Definition at line 303 of file JeepToolkit.hh.

304  {
305  using namespace std;
306 
307  const size_t pos = file_name.find(PROTOCOL_SEPARATOR);
308 
309  if (pos != string::npos)
310  return file_name.substr(0, pos);
311  else
312  return "";
313  }
static const char PROTOCOL_SEPARATOR
protocol separator
Definition: JeepToolkit.hh:43
std::string JEEP::getURL ( )
inline

Get URL of document pages.

Returns
URL

Definition at line 321 of file JeepToolkit.hh.

322  {
323  const char* const url = getenv(JPP_PAGES);
324 
325  return std::string(url != NULL ? url : "");
326  }
static const char *const JPP_PAGES
Jpp document pages.
Definition: JeepToolkit.hh:37
template<class T >
T* JEEP::open ( const std::string &  file_name)
inline

Open file.

Parameters
file_namefile name
Returns
pointer to input stream
Parameters
file_namefile name
Returns
pointer to output stream

Definition at line 346 of file JeepToolkit.hh.

347  {
348  using namespace std;
349  using namespace JPP;
350 
351  if (getFilenameExtension(file_name) == "gz")
352  return new igzstream(file_name.c_str());
353  else if (getFilenameExtension(file_name) == "txt")
354  return new ifstream (file_name.c_str());
355  else
356  return NULL;
357  }
std::string getFilenameExtension(const std::string &file_name)
Get file name extension, i.e. part after last JEEP::FILENAME_SEPARATOR if any.
Definition: JeepToolkit.hh:109
template<>
std::istream* JEEP::open ( const std::string &  file_name)
inline

Open file.

Parameters
file_namefile name
Returns
pointer to input stream

Definition at line 346 of file JeepToolkit.hh.

347  {
348  using namespace std;
349  using namespace JPP;
350 
351  if (getFilenameExtension(file_name) == "gz")
352  return new igzstream(file_name.c_str());
353  else if (getFilenameExtension(file_name) == "txt")
354  return new ifstream (file_name.c_str());
355  else
356  return NULL;
357  }
std::string getFilenameExtension(const std::string &file_name)
Get file name extension, i.e. part after last JEEP::FILENAME_SEPARATOR if any.
Definition: JeepToolkit.hh:109
template<>
std::ostream* JEEP::open ( const std::string &  file_name)
inline

Open file.

Parameters
file_namefile name
Returns
pointer to output stream

Definition at line 367 of file JeepToolkit.hh.

368  {
369  using namespace std;
370  using namespace JPP;
371 
372  if (getFilenameExtension(file_name) == "gz")
373  return new ogzstream(file_name.c_str());
374  else if (getFilenameExtension(file_name) == "txt")
375  return new ofstream (file_name.c_str());
376  else
377  return NULL;
378  }
std::string getFilenameExtension(const std::string &file_name)
Get file name extension, i.e. part after last JEEP::FILENAME_SEPARATOR if any.
Definition: JeepToolkit.hh:109
void JEEP::close ( std::istream *  pf)
inline

Close file.

Parameters
pfpointer to file stream

Definition at line 386 of file JeepToolkit.hh.

387  {
388  using namespace std;
389  using namespace JPP;
390 
391  if (dynamic_cast<ifstream*> (pf) != NULL) { dynamic_cast<ifstream*> (pf)->close(); return; }
392  if (dynamic_cast<igzstream*>(pf) != NULL) { dynamic_cast<igzstream*>(pf)->close(); return; }
393  }
void close(std::istream *pf)
Close file.
Definition: JeepToolkit.hh:386
void JEEP::close ( std::ostream *  pf)
inline

Close file.

Parameters
pfpointer to file stream

Definition at line 401 of file JeepToolkit.hh.

402  {
403  using namespace std;
404  using namespace JPP;
405 
406  if (dynamic_cast<ofstream*> (pf) != NULL) { dynamic_cast<ofstream*> (pf)->close(); return; }
407  if (dynamic_cast<ogzstream*>(pf) != NULL) { dynamic_cast<ogzstream*>(pf)->close(); return; }
408  }
void close(std::istream *pf)
Close file.
Definition: JeepToolkit.hh:386
std::string JEEP::getGITVersion ( const std::string &  tag)
inline

Get GIT version for given GIT tag.

Parameters
tagGIT tag
Returns
GIT version

Definition at line 34 of file Jeep/JGITTags.hh.

35  {
36  if (!tag.empty()) {
37 
38  if (tag[0] == 'v' ||
39  tag[0] == 'V') {
40 
41  return tag.substr(1);
42  }
43  }
44 
45  return tag;
46  }
const JGITTags_t& JEEP::getGITTags ( )
inline

Get GIT dated tags.

Returns
dated GIT tags

Definition at line 54 of file Jeep/JGITTags.hh.

55  {
56  using namespace std;
57  using namespace JPP;
58 
59  static JGITTags_t buffer;
60 
61  if (buffer.empty()) {
62 
63 #ifdef GIT_TAGS
64 
65  istringstream in(GIT_TAGS);
66 
67  JDate<'-'> date;
68  string tag;
69 
70  while (in >> tag >> date) {
71  buffer.insert(make_pair(date, tag));
72  }
73 #endif
74  }
75 
76  return buffer;
77  }
Auxiliary class for simple date.
Definition: Jeep/JDate.hh:39
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 JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
template<class T >
int JEEP::sign ( const T value)
inline

Get sign of value.

Parameters
valuevalue
Returns
-1 if value < 0; 0 if value == 0; +1 if value > 0

Definition at line 20 of file JLib.hh.

21  {
22  return (value > T(0)) - (value < T(0));
23  }
do set_variable OUTPUT_DIRECTORY $WORKDIR T
std::ostream& JEEP::getOstream ( )
inline

Get output stream for conversion to std::string.

Note that the stream is emptied before use.

Returns
output stream

Definition at line 31 of file JPrint.hh.

32  {
33  static std::ostringstream buffer;
34 
35  buffer.str("");
36 
37  return buffer;
38  }
const char* JEEP::getCString ( const std::string &  input)
inline

Get output C-string.

Note that this method is needed to guarentee livetime of underlying std::string.

Parameters
inputinput
Returns
C-string

Definition at line 49 of file JPrint.hh.

50  {
51  static std::string buffer;
52 
53  buffer = input;
54 
55  return buffer.c_str();
56  }
bool JEEP::fail ( std::istream &  in)
inline

Check for stream state.

Note that end-of-file is not defined as an error so to normally process e.g. std::string and std::vector.

Parameters
ininput stream
Returns
true if failure; else false

Definition at line 57 of file JProperties.hh.

58  {
59  return in.bad() || (in.fail() && !in.eof());
60  }
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 JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
template<class T >
JProperties& JEEP::getProperties ( T object,
const JEquationParameters parameters = JEquationParameters(),
const int  debug = 1 
)
inline

Get properties of a given object.

This method transfers the making of the property object to the corresponding class whilst preserving the constness of the argument.
The corresponding class should implement the method:

  template<bool is_constant>
  static JProperties getProperties(typename JCategory<T, is_constant>::reference_type object,
                                const JEquationParameters& equation,
                                const int debug)
Parameters
objectobject
parametersequation parameters
debugdebug level

Definition at line 1267 of file JProperties.hh.

1270  {
1271  using namespace JPP;
1272 
1273  static JProperties properties;
1274 
1275  properties = T::template getProperties<JClass<T>::is_constant>(object, parameters, debug);
1276 
1277  return properties;
1278  }
Utility class to parse parameter values.
Definition: JProperties.hh:496
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
Definition: diff-Tuna.sh:38
int debug
debug level
double JEEP::getValue ( const JScale_t  scale)
inline

Get numerical value corresponding to scale.

Parameters
scalescale
Returns
value

Definition at line 47 of file JScale.hh.

48  {
49  return pow(10.0, scale);
50  }
T pow(const T &x, const double y)
Power .
Definition: JMath.hh:98
void scale(vector< double > &v, double c)
scale vector content
const char* JEEP::getUnit ( const int  scale)
inline

Get textual unit corresponding to scale.

Parameters
scalescale
Returns
textual unit

Definition at line 59 of file JScale.hh.

60  {
61  switch (scale) {
62 
63  case femto_t:
64  return "f";
65 
66  case pico_t:
67  return "p";
68 
69  case nano_t:
70  return "n";
71 
72  case micro_t:
73  return "u";
74 
75  case milli_t:
76  return "m";
77 
78  case unit_t:
79  return "";
80 
81  case kilo_t:
82  return "k";
83 
84  case mega_t:
85  return "M";
86 
87  case giga_t:
88  return "G";
89 
90  case tera_t:
91  return "T";
92 
93  case peta_t:
94  return "P";
95 
96  case exa_t:
97  return "E";
98 
99  default:
100  THROW(JValueOutOfRange, "getUnit(): invalid scale " << scale);
101  };
102  }
exa
Definition: JScale.hh:37
micro
Definition: JScale.hh:29
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:696
giga
Definition: JScale.hh:34
kilo
Definition: JScale.hh:32
milli
Definition: JScale.hh:30
peta
Definition: JScale.hh:36
femto
Definition: JScale.hh:26
mega
Definition: JScale.hh:33
nano
Definition: JScale.hh:28
pico
Definition: JScale.hh:27
unit
Definition: JScale.hh:31
tera
Definition: JScale.hh:35
void scale(vector< double > &v, double c)
scale vector content
JScale_t JEEP::getScale ( const char  unit)
inline

Get scale corresponding to textual unit.

Parameters
unittextual unit
Returns
scale

Definition at line 111 of file JScale.hh.

112  {
113  switch (unit) {
114 
115  case 'f':
116  return femto_t;
117 
118  case 'p':
119  return pico_t;
120 
121  case 'n':
122  return nano_t;
123 
124  case 'u':
125  return micro_t;
126 
127  case 'm':
128  return milli_t;
129 
130  case ' ':
131  return unit_t;
132 
133  case 'k':
134  return kilo_t;
135 
136  case 'M':
137  return mega_t;
138 
139  case 'G':
140  return giga_t;
141 
142  case 'T':
143  return tera_t;
144 
145  case 'P':
146  return peta_t;
147 
148  case 'E':
149  return exa_t;
150 
151  default:
152  THROW(JValueOutOfRange, "getScale(): invalid unit " << unit);
153  };
154  }
exa
Definition: JScale.hh:37
micro
Definition: JScale.hh:29
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:696
giga
Definition: JScale.hh:34
kilo
Definition: JScale.hh:32
milli
Definition: JScale.hh:30
peta
Definition: JScale.hh:36
femto
Definition: JScale.hh:26
mega
Definition: JScale.hh:33
nano
Definition: JScale.hh:28
pico
Definition: JScale.hh:27
unit
Definition: JScale.hh:31
tera
Definition: JScale.hh:35
void JEEP::print ( std::ostream &  out,
const JStatus status,
const JPutStatusBit helper 
)
inline

Print status.

Parameters
outoutput stream
statusstatus
helperhelper

Definition at line 264 of file JStatus.hh.

265  {
266  using namespace std;
267 
268  for (const auto& i : helper) {
269  out << setw(24) << left << i.second << right << status.has(i.first) << endl;
270  }
271  }
bool has(const int bit) const
Test PMT status.
Definition: JStatus.hh:120
void JEEP::print ( std::ostream &  out,
const JStatus status,
const JGetStatusBit helper 
)
inline

Print status.

Parameters
outoutput stream
statusstatus
helperhelper

Definition at line 281 of file JStatus.hh.

282  {
283  using namespace std;
284 
285  for (const auto& i : helper) {
286  out << setw(24) << left << i.first << right << status.has(i.second) << endl;
287  }
288  }
bool has(const int bit) const
Test PMT status.
Definition: JStatus.hh:120
template<class T >
std::istream& JEEP::readObject ( std::istream &  in,
T object 
)
inline

Stream input of object.

Parameters
ininput stream
objectobject
Returns
input stream

Definition at line 28 of file JStreamToolkit.hh.

29  {
30  return in >> object;
31  }
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 JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
template<class T >
std::ostream& JEEP::writeObject ( std::ostream &  out,
const T object 
)
inline

Stream output of object.

Parameters
outoutput stream
objectobject
Returns
output stream

Definition at line 42 of file JStreamToolkit.hh.

43  {
44  return out << object;
45  }
template<class T >
std::ostream& JEEP::writeObject ( std::ostream &  out,
const char *  prefix,
const T object,
const char  postfix 
)
inline

Stream output of object.

Parameters
outoutput stream
prefixprefix
objectobject
postfixpostfix
Returns
output stream

Definition at line 58 of file JStreamToolkit.hh.

62  {
63  return out << prefix << object << postfix;
64  }
template<class JFirst_t , class JSecond_t >
std::istream& JEEP::readObject ( std::istream &  in,
std::pair< JFirst_t, JSecond_t > &  object 
)
inline

Template specialisation of method readObject() for std::pair.

Parameters
ininput stream
objectobject
Returns
input stream

Definition at line 75 of file JStreamToolkit.hh.

76  {
77  readObject(in, object.first);
78  readObject(in, object.second);
79 
80  return in;
81  }
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
std::istream & readObject(std::istream &in, T &object)
Stream input of object.
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 JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
template<class JFirst_t , class JSecond_t >
std::ostream& JEEP::writeObject ( std::ostream &  out,
const std::pair< JFirst_t, JSecond_t > &  object 
)
inline

Template specialisation of method writeObject() for std::pair.

Parameters
outoutput stream
objectobject
Returns
output stream

Definition at line 92 of file JStreamToolkit.hh.

93  {
94  writeObject(out, object.first);
95  writeObject(out, ' ');
96  writeObject(out, object.second);
97 
98  return out;
99  }
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
std::ostream & writeObject(std::ostream &out, const T &object)
Stream output of object.
template<class JFirst_t , class JSecond_t >
std::ostream& JEEP::writeObject ( std::ostream &  out,
const char *  prefix,
const std::pair< JFirst_t, JSecond_t > &  object,
const char  postfix 
)
inline

Template specialisation of method writeObject() for std::pair.

Parameters
outoutput stream
prefixprefix
objectobject
postfixpostfix
Returns
output stream

Definition at line 112 of file JStreamToolkit.hh.

116  {
117  writeObject(out, prefix);
118  writeObject(out, object.first);
119  writeObject(out, ' ');
120  writeObject(out, object.second);
121  writeObject(out, postfix);
122 
123  return out;
124  }
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
std::ostream & writeObject(std::ostream &out, const T &object)
Stream output of object.
template<class JElement_t , class JAllocator_t >
std::istream& JEEP::readObject ( std::istream &  in,
std::vector< JElement_t, JAllocator_t > &  object 
)
inline

Template specialisation of method readObject() for std::vector.

Parameters
ininput stream
objectobject
Returns
input stream

Definition at line 135 of file JStreamToolkit.hh.

136  {
137  for (JElement_t element; readObject(in, element); ) {
138  object.push_back(element);
139  }
140 
141  return in;
142  }
std::istream & readObject(std::istream &in, T &object)
Stream input of object.
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 JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
template<class JElement_t , class JAllocator_t >
std::ostream& JEEP::writeObject ( std::ostream &  out,
const std::vector< JElement_t, JAllocator_t > &  object 
)
inline

Template specialisation of method writeObject() for std::vector.

Parameters
outoutput stream
objectobject
Returns
output stream

Definition at line 153 of file JStreamToolkit.hh.

154  {
155  for (typename std::vector<JElement_t, JAllocator_t>::const_iterator i = object.begin(); i != object.end(); ++i) {
156  writeObject(out, ' ');
157  writeObject(out, *i);
158  }
159 
160  return out;
161  }
std::ostream & writeObject(std::ostream &out, const T &object)
Stream output of object.
template<class JElement_t , class JAllocator_t >
std::ostream& JEEP::writeObject ( std::ostream &  out,
const char *  prefix,
const std::vector< JElement_t, JAllocator_t > &  object,
const char  postfix 
)
inline

Template specialisation of method writeObject() for std::vector.

Parameters
outoutput stream
prefixprefix
objectobject
postfixpostfix
Returns
output stream

Definition at line 174 of file JStreamToolkit.hh.

178  {
179  for (typename std::vector<JElement_t, JAllocator_t>::const_iterator i = object.begin(); i != object.end(); ++i) {
180  writeObject(out, prefix, *i, postfix);
181  }
182 
183  return out;
184  }
std::ostream & writeObject(std::ostream &out, const T &object)
Stream output of object.
template<class JElement_t , class JAllocator_t >
std::istream& JEEP::readObject ( std::istream &  in,
std::list< JElement_t, JAllocator_t > &  object 
)
inline

Template specialisation of method readObject() for std::list.

Parameters
ininput stream
objectobject
Returns
input stream

Definition at line 195 of file JStreamToolkit.hh.

196  {
197  for (JElement_t element; readObject(in, element); ) {
198  object.push_back(element);
199  }
200 
201  return in;
202  }
std::istream & readObject(std::istream &in, T &object)
Stream input of object.
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 JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
template<class JElement_t , class JAllocator_t >
std::ostream& JEEP::writeObject ( std::ostream &  out,
const std::list< JElement_t, JAllocator_t > &  object 
)
inline

Template specialisation of method writeObject() for std::list.

Parameters
outoutput stream
objectobject
Returns
output stream

Definition at line 213 of file JStreamToolkit.hh.

214  {
215  for (typename std::list<JElement_t, JAllocator_t>::const_iterator i = object.begin(); i != object.end(); ++i) {
216  writeObject(out, ' ');
217  writeObject(out, *i);
218  }
219 
220  return out;
221  }
std::ostream & writeObject(std::ostream &out, const T &object)
Stream output of object.
template<class JElement_t , class JAllocator_t >
std::ostream& JEEP::writeObject ( std::ostream &  out,
const char *  prefix,
const std::list< JElement_t, JAllocator_t > &  object,
const char  postfix 
)
inline

Template specialisation of method writeObject() for std::list.

Parameters
outoutput stream
prefixprefix
objectobject
postfixpostfix
Returns
output stream

Definition at line 234 of file JStreamToolkit.hh.

238  {
239  for (typename std::list<JElement_t, JAllocator_t>::const_iterator i = object.begin(); i != object.end(); ++i) {
240  writeObject(out, prefix, *i, postfix);
241  }
242 
243  return out;
244  }
std::ostream & writeObject(std::ostream &out, const T &object)
Stream output of object.
template<class JElement_t , class JComparator_t , class JAllocator_t >
std::istream& JEEP::readObject ( std::istream &  in,
std::set< JElement_t, JComparator_t, JAllocator_t > &  object 
)
inline

Template specialisation of method readObject() for std::set.

Parameters
ininput stream
objectobject
Returns
input stream

Definition at line 255 of file JStreamToolkit.hh.

256  {
257  for (JElement_t element; readObject(in, element); ) {
258 
260 
261  if (!result.second) {
262  object.erase (result.first);
263  object.insert(element);
264  }
265  }
266 
267  return in;
268  }
std::istream & readObject(std::istream &in, T &object)
Stream input of object.
return result
Definition: JPolint.hh:764
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 JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
template<class JElement_t , class JComparator_t , class JAllocator_t >
std::ostream& JEEP::writeObject ( std::ostream &  out,
const std::set< JElement_t, JComparator_t, JAllocator_t > &  object 
)
inline

Template specialisation of method writeObject() for std::set.

Parameters
outoutput stream
objectobject
Returns
output stream

Definition at line 279 of file JStreamToolkit.hh.

280  {
281  for (typename std::set<JElement_t, JComparator_t, JAllocator_t>::const_iterator i = object.begin(); i != object.end(); ++i) {
282  writeObject(out, ' ');
283  writeObject(out, *i);
284  }
285 
286  return out;
287  }
std::ostream & writeObject(std::ostream &out, const T &object)
Stream output of object.
template<class JElement_t , class JComparator_t , class JAllocator_t >
std::ostream& JEEP::writeObject ( std::ostream &  out,
const char *  prefix,
const std::set< JElement_t, JComparator_t, JAllocator_t > &  object,
const char  postfix 
)
inline

Template specialisation of method writeObject() for std::set.

Parameters
outoutput stream
prefixprefix
objectobject
postfixpostfix
Returns
output stream

Definition at line 300 of file JStreamToolkit.hh.

304  {
305  for (typename std::set<JElement_t, JComparator_t, JAllocator_t>::const_iterator i = object.begin(); i != object.end(); ++i) {
306  writeObject(out, prefix, *i, postfix);
307  }
308 
309  return out;
310  }
std::ostream & writeObject(std::ostream &out, const T &object)
Stream output of object.
template<class JElement_t , class JComparator_t , class JAllocator_t >
std::istream& JEEP::readObject ( std::istream &  in,
std::multiset< JElement_t, JComparator_t, JAllocator_t > &  object 
)
inline

Template specialisation of method readObject() for std::multiset.

Parameters
ininput stream
objectobject
Returns
input stream

Definition at line 321 of file JStreamToolkit.hh.

322  {
323  for (JElement_t element; readObject(in, element); ) {
324  object.insert(element);
325  }
326 
327  return in;
328  }
std::istream & readObject(std::istream &in, T &object)
Stream input of object.
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 JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
template<class JElement_t , class JComparator_t , class JAllocator_t >
std::ostream& JEEP::writeObject ( std::ostream &  out,
const std::multiset< JElement_t, JComparator_t, JAllocator_t > &  object 
)
inline

Template specialisation of method writeObject() for std::multiset.

Parameters
outoutput stream
objectobject
Returns
output stream

Definition at line 339 of file JStreamToolkit.hh.

340  {
341  for (typename std::multiset<JElement_t, JComparator_t, JAllocator_t>::const_iterator i = object.begin(); i != object.end(); ++i) {
342  writeObject(out, ' ');
343  writeObject(out, *i);
344  }
345 
346  return out;
347  }
std::ostream & writeObject(std::ostream &out, const T &object)
Stream output of object.
template<class JElement_t , class JComparator_t , class JAllocator_t >
std::ostream& JEEP::writeObject ( std::ostream &  out,
const char *  prefix,
const std::multiset< JElement_t, JComparator_t, JAllocator_t > &  object,
const char  postfix 
)
inline

Template specialisation of method writeObject() for std::multiset.

Parameters
outoutput stream
prefixprefix
objectobject
postfixpostfix
Returns
output stream

Definition at line 360 of file JStreamToolkit.hh.

364  {
365  for (typename std::multiset<JElement_t, JComparator_t, JAllocator_t>::const_iterator i = object.begin(); i != object.end(); ++i) {
366  writeObject(out, prefix, *i, postfix);
367  }
368 
369  return out;
370  }
std::ostream & writeObject(std::ostream &out, const T &object)
Stream output of object.
template<class JKey_t , class JValue_t , class JComparator_t , class JAllocator_t >
std::istream& JEEP::readObject ( std::istream &  in,
std::map< JKey_t, JValue_t, JComparator_t, JAllocator_t > &  object 
)
inline

Template specialisation of method readObject() for std::map.

Parameters
ininput stream
objectobject
Returns
input stream

Definition at line 381 of file JStreamToolkit.hh.

382  {
383  for (std::pair<JKey_t, JValue_t> element; readObject(in, element); ) {
384 
386 
387  if (!result.second) {
388  result.first->second = element.second;
389  }
390  }
391 
392  return in;
393  }
std::istream & readObject(std::istream &in, T &object)
Stream input of object.
return result
Definition: JPolint.hh:764
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 JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
template<class JKey_t , class JValue_t , class JComparator_t , class JAllocator_t >
std::ostream& JEEP::writeObject ( std::ostream &  out,
const std::map< JKey_t, JValue_t, JComparator_t, JAllocator_t > &  object 
)
inline

Template specialisation of method writeObject() for std::map.

Parameters
outoutput stream
objectobject
Returns
output stream

Definition at line 404 of file JStreamToolkit.hh.

405  {
406  for (typename std::map<JKey_t, JValue_t, JComparator_t, JAllocator_t>::const_iterator i = object.begin(); i != object.end(); ++i) {
407  writeObject(out, ' ');
408  writeObject(out, *i);
409  }
410 
411  return out;
412  }
std::ostream & writeObject(std::ostream &out, const T &object)
Stream output of object.
template<class JKey_t , class JValue_t , class JComparator_t , class JAllocator_t >
std::ostream& JEEP::writeObject ( std::ostream &  out,
const char *  prefix,
const std::map< JKey_t, JValue_t, JComparator_t, JAllocator_t > &  object,
const char  postfix 
)
inline

Template specialisation of method writeObject() for std::map.

Parameters
outoutput stream
prefixprefix
objectobject
postfixpostfix
Returns
output stream

Definition at line 425 of file JStreamToolkit.hh.

429  {
430  for (typename std::map<JKey_t, JValue_t, JComparator_t, JAllocator_t>::const_iterator i = object.begin(); i != object.end(); ++i) {
431  writeObject(out, prefix, *i, postfix);
432  }
433 
434  return out;
435  }
std::ostream & writeObject(std::ostream &out, const T &object)
Stream output of object.
template<class JKey_t , class JValue_t , class JComparator_t , class JAllocator_t >
std::istream& JEEP::readObject ( std::istream &  in,
std::multimap< JKey_t, JValue_t, JComparator_t, JAllocator_t > &  object 
)
inline

Template specialisation of method readObject() for std::multimap.

Parameters
ininput stream
objectobject
Returns
input stream

Definition at line 446 of file JStreamToolkit.hh.

447  {
448  for (std::pair<JKey_t, JValue_t> element; readObject(in, element); ) {
449  object.insert(element);
450  }
451 
452  return in;
453  }
std::istream & readObject(std::istream &in, T &object)
Stream input of object.
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 JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
template<class JKey_t , class JValue_t , class JComparator_t , class JAllocator_t >
std::ostream& JEEP::writeObject ( std::ostream &  out,
const std::multimap< JKey_t, JValue_t, JComparator_t, JAllocator_t > &  object 
)
inline

Template specialisation of method writeObject() for std::multimap.

Parameters
outoutput stream
objectobject
Returns
output stream

Definition at line 464 of file JStreamToolkit.hh.

465  {
466  for (typename std::multimap<JKey_t, JValue_t, JComparator_t, JAllocator_t>::const_iterator i = object.begin(); i != object.end(); ++i) {
467  writeObject(out, ' ');
468  writeObject(out, *i);
469  }
470 
471  return out;
472  }
std::ostream & writeObject(std::ostream &out, const T &object)
Stream output of object.
template<class JKey_t , class JValue_t , class JComparator_t , class JAllocator_t >
std::ostream& JEEP::writeObject ( std::ostream &  out,
const char *  prefix,
const std::multimap< JKey_t, JValue_t, JComparator_t, JAllocator_t > &  object,
const char  postfix 
)
inline

Template specialisation of method writeObject() for std::multimap.

Parameters
outoutput stream
prefixprefix
objectobject
postfixpostfix
Returns
output stream

Definition at line 485 of file JStreamToolkit.hh.

489  {
490  for (typename std::multimap<JKey_t, JValue_t, JComparator_t, JAllocator_t>::const_iterator i = object.begin(); i != object.end(); ++i) {
491  writeObject(out, prefix, *i, postfix);
492  }
493 
494  return out;
495  }
std::ostream & writeObject(std::ostream &out, const T &object)
Stream output of object.
template<class T >
std::ostream& JEEP::writeArray ( std::ostream &  out,
const char *  left,
const char *  right,
const char *  sep,
T  __begin,
T  __end 
)
inline

Write array of objects.

Parameters
outoutput stream
leftleft bracket
rightright bracket
sepseparator
__beginbegin of data
__endend of data
Returns
output stream

Definition at line 510 of file JStreamToolkit.hh.

516  {
517  if (std::distance(__begin, __end) != 0) {
518 
519  out << left;
520 
521  T i = __begin;
522 
523  writeObject(out, *i);
524 
525  while (++i != __end) {
526 
527  out << sep;
528 
529  JEEP::writeObject(out, *i);
530  }
531 
532  out << right;
533  }
534 
535  return out;
536  }
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
do set_variable OUTPUT_DIRECTORY $WORKDIR T
std::ostream & writeObject(std::ostream &out, const T &object)
Stream output of object.

Variable Documentation

const char* const JEEP::LD_LIBRARY_PATH = "LD_LIBRARY_PATH"
static

Nick names of environment variables.

library file paths

Definition at line 34 of file JeepToolkit.hh.

const char* const JEEP::PATH = "PATH"
static

binary file paths

Definition at line 35 of file JeepToolkit.hh.

const char* const JEEP::SHELL = "SHELL"
static

SHELL.

Definition at line 36 of file JeepToolkit.hh.

const char* const JEEP::JPP_PAGES = "JPP_PAGES"
static

Jpp document pages.

Definition at line 37 of file JeepToolkit.hh.

const char JEEP::PATHNAME_SEPARATOR = '/'
static

path name separator

Definition at line 39 of file JeepToolkit.hh.

const char JEEP::PATHLIST_SEPARATOR = ':'
static

path list separator

Definition at line 40 of file JeepToolkit.hh.

const char JEEP::FILENAME_SEPARATOR = '.'
static

file name separator

Definition at line 41 of file JeepToolkit.hh.

const char* const JEEP::TYPENAME_SEPARATOR = "::"
static

type name separator

Definition at line 42 of file JeepToolkit.hh.

const char JEEP::PROTOCOL_SEPARATOR = ':'
static

protocol separator

Definition at line 43 of file JeepToolkit.hh.

const char JEEP::FILENAME_WILD_CARD = '%'
static

wild card character for file name substitution

Definition at line 44 of file JeepToolkit.hh.