Jpp 20.0.0-195-g190c9e876
the software that should make you happy
Loading...
Searching...
No Matches
JACOUSTICS::JDetectorMechanics Struct Reference

Auxiliary data structure for mechanical model parameters with commented data. More...

#include <JMechanics.hh>

Inheritance diagram for JACOUSTICS::JDetectorMechanics:
JACOUSTICS::JDetectorMechanics_t std::map< int, JMechanics > TObject

Public Types

enum  { WILDCARD = -1 }
 

Public Member Functions

const JMechanicsoperator() (const int string) const
 Get mechanical parameters for given string.
 
 ClassDef (JDetectorMechanics_t, 1)
 

Public Attributes

JComment comment
 

Friends

std::istream & operator>> (std::istream &in, JDetectorMechanics &object)
 Read detector mechanics from input.
 
std::ostream & operator<< (std::ostream &out, const JDetectorMechanics &object)
 Write detector mechanics to output.
 

Detailed Description

Auxiliary data structure for mechanical model parameters with commented data.

Definition at line 36 of file JMechanics.hh.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited
Enumerator
WILDCARD 

wild card for string number.

Definition at line 108 of file JMechanics_t.hh.

108 {
109 WILDCARD = -1 //!< wild card for string number.
110 };
@ WILDCARD
wild card for string number.

Member Function Documentation

◆ operator()()

const JMechanics & JACOUSTICS::JDetectorMechanics_t::operator() ( const int string) const
inlineinherited

Get mechanical parameters for given string.

Parameters
stringstring number
Returns
mechanical parameters

Definition at line 119 of file JMechanics_t.hh.

120 {
121 static const JMechanics mechanics;
122
123 const_iterator p;
124
125 if ((p = this->find(string)) != this->end())
126 return p->second;
127 else if ((p = this->find(WILDCARD)) != this->end())
128 return p->second;
129 else
130 return mechanics;
131 }

◆ ClassDef()

JACOUSTICS::JDetectorMechanics_t::ClassDef ( JDetectorMechanics_t ,
1  )
inherited

Friends And Related Symbol Documentation

◆ operator>>

std::istream & operator>> ( std::istream & in,
JDetectorMechanics & object )
friend

Read detector mechanics from input.

Parameters
ininput stream
objectdetector mechanics
Returns
input stream

Definition at line 46 of file JMechanics.hh.

47 {
48 using namespace JPP;
49
50 JStringStream is(in);
51
52 if (getFileStatus(is.str().c_str())) {
53 is.load();
54 }
55
56 object.clear();
57
58 is >> object.comment;
59
60 int string;
61 JMechanics mechanics;
62
63 while (is >> string >> mechanics) {
64 object[string] = mechanics;
65 }
66
67 return in;
68 }
Wrapper class around STL stringstream class to facilitate optional loading of data from file.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for parameters of mechanical model.

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const JDetectorMechanics & object )
friend

Write detector mechanics to output.

Parameters
outoutput stream
objectdetector mechanics
Returns
output stream

Definition at line 78 of file JMechanics.hh.

79 {
80 using namespace std;
81
82 out << object.comment;
83 out << static_cast<const JDetectorMechanics_t&>(object);
84
85 return out;
86 }

Member Data Documentation

◆ comment

JComment JACOUSTICS::JDetectorMechanics::comment

Definition at line 88 of file JMechanics.hh.


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